version 1.40, 2001/06/02 03:59:59
|
version 1.41, 2001/06/05 16:32:18
|
Line 48 sub start_problem {
|
Line 48 sub start_problem {
|
my $status; |
my $status; |
my $datemsg; |
my $datemsg; |
|
|
|
#should get back a <html> or the neccesary stuff to start XML/MathML |
my $result=&Apache::londefdef::start_html($target,$token,$tagstack,$parstack,$parser,$safeeval); |
my $result=&Apache::londefdef::start_html($target,$token,$tagstack,$parstack,$parser,$safeeval); |
|
|
|
my $head_tag_start='<head>'.&Apache::lonxml::registerurl(); |
|
my $body_tag_start='<body onLoad="'.&Apache::lonxml::loadevents().'" '. |
|
'onUnload="'.&Apache::lonxml::unloadevents().'" '. |
|
'bgcolor="#FFFFFF">'; |
if ($target eq 'web' || $target eq 'grade') { |
if ($target eq 'web' || $target eq 'grade') { |
($status,$datemsg) = &Apache::lonhomework::check_date('0'); |
($status,$datemsg) = &Apache::lonhomework::check_date('0'); |
push (@Apache::inputtags::status,$status); |
push (@Apache::inputtags::status,$status); |
Line 59 sub start_problem {
|
Line 64 sub start_problem {
|
if ( $status eq 'CLOSED' ) { |
if ( $status eq 'CLOSED' ) { |
my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); |
my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); |
if ( $target eq "web" ) { |
if ( $target eq "web" ) { |
return $result."<body bgcolor=\"#FFFFFF\"> <br />Problem is not open to be viewed. The problem $datemsg<br />"; |
$result.= $head_tag_start.'</head>'; |
|
return $result . $body_tag_start . |
|
" <br />Problem is not open to be viewed. The problem $datemsg<br />"; |
} |
} |
} |
} |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval); |
Line 72 sub start_problem {
|
Line 79 sub start_problem {
|
$Apache::lonhomework::name=$name; |
$Apache::lonhomework::name=$name; |
if ($status eq 'CAN_ANSWER') { |
if ($status eq 'CAN_ANSWER') { |
# create a page header and exit |
# create a page header and exit |
$result.="<head><title>$name</title></head>\n |
$result.="$head_tag_start<title>$name</title></head>\n |
<body bgcolor=\"#FFFFFF\">\n |
$body_tag_start\n |
<form name=\"lonhomework\" method=\"POST\" action=\"".$ENV{'request.uri'}."\">". |
<form name=\"lonhomework\" method=\"POST\" action=\"".$ENV{'request.uri'}."\">". |
'<input type="hidden" name="submitted" value="yes" />'; |
'<input type="hidden" name="submitted" value="yes" />'; |
if ($ENV{'request.state'} eq "construct") { |
if ($ENV{'request.state'} eq "construct") { |
Line 82 sub start_problem {
|
Line 89 sub start_problem {
|
} |
} |
return $result; |
return $result; |
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'CLOSED') { |
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'CLOSED') { |
return $result."<title>$name</title>\n<body bgcolor=\"#FFFFFF\">\n"; |
return $result.$head_tag_start."<title>$name</title></head>\n$body_tag_start\n"; |
} |
} |
} |
} |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result.='<body bgcolor="#FFFFFF"> |
$result.=$head_tag_start."</head>".$body_tag_start. |
<form name="lonhomework" method="POST" action="'.$ENV{'request.uri'}.'"> |
'<form name="lonhomework" method="POST" action="'.$ENV{'request.uri'}.'"> |
<input type="hidden" name="submitted" value="edit" /> |
<input type="hidden" name="submitted" value="edit" /> |
<input type="hidden" name="problemmode" value="Edit" /> |
<input type="hidden" name="problemmode" value="Edit" /> |
<input type="submit" name="problemmode" value="View" /> |
<input type="submit" name="problemmode" value="View" /> |
<input type="submit" name="Undo" value="undo" /> <hr /> |
<input type="submit" name="Undo" value="undo" /> <hr /> |
'; |
'; |
my $temp=&Apache::edit::insertlist($target,$token); |
my $temp=&Apache::edit::insertlist($target,$token); |
$result.=$temp; |
$result.=$temp; |
return $result; |
return $result; |
Line 118 sub end_problem {
|
Line 125 sub end_problem {
|
# if part is zero, no <part>s existed, so we need show the current |
# if part is zero, no <part>s existed, so we need show the current |
# grading status |
# grading status |
$result.= &Apache::inputtags::gradestatus($Apache::inputtags::part); |
$result.= &Apache::inputtags::gradestatus($Apache::inputtags::part); |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
if ($status eq 'CAN_ANSWER') { |
if ($status eq 'CAN_ANSWER') { |
$result.="</form></body>\n"; |
$result.="</form></body>\n"; |
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') { |
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') { |
$result.="</body>\n"; |
$result.="</body>\n"; |
} |
} |
} |
} |
} |
} |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
if ($Apache::inputtags::part eq '0') { |
if ($Apache::inputtags::part eq '0') { |
$result=&Apache::response::mandatory_part_meta; |
$result=&Apache::response::mandatory_part_meta; |