--- loncom/homework/structuretags.pm 2001/06/02 03:59:59 1.40 +++ loncom/homework/structuretags.pm 2001/06/05 16:32:18 1.41 @@ -48,8 +48,13 @@ sub start_problem { my $status; my $datemsg; + #should get back a or the neccesary stuff to start XML/MathML my $result=&Apache::londefdef::start_html($target,$token,$tagstack,$parstack,$parser,$safeeval); + my $head_tag_start=''.&Apache::lonxml::registerurl(); + my $body_tag_start=''; if ($target eq 'web' || $target eq 'grade') { ($status,$datemsg) = &Apache::lonhomework::check_date('0'); push (@Apache::inputtags::status,$status); @@ -59,9 +64,11 @@ sub start_problem { if ( $status eq 'CLOSED' ) { my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); if ( $target eq "web" ) { - return $result."
Problem is not open to be viewed. The problem $datemsg
"; + $result.= $head_tag_start.''; + return $result . $body_tag_start . + "
Problem is not open to be viewed. The problem $datemsg
"; } - } + } } if ($target eq 'web') { my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval); @@ -72,8 +79,8 @@ sub start_problem { $Apache::lonhomework::name=$name; if ($status eq 'CAN_ANSWER') { # create a page header and exit - $result.="$name\n - \n + $result.="$head_tag_start$name\n + $body_tag_start\n
". ''; if ($ENV{'request.state'} eq "construct") { @@ -82,17 +89,17 @@ sub start_problem { } return $result; } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'CLOSED') { - return $result."$name\n\n"; + return $result.$head_tag_start."$name\n$body_tag_start\n"; } } if ($target eq 'edit') { - $result.=' - - - - -
-'; + $result.=$head_tag_start."".$body_tag_start. + ' + + + +
+ '; my $temp=&Apache::edit::insertlist($target,$token); $result.=$temp; return $result; @@ -118,15 +125,15 @@ sub end_problem { # if part is zero, no s existed, so we need show the current # grading status $result.= &Apache::inputtags::gradestatus($Apache::inputtags::part); - } + } if ($target eq 'web') { if ($status eq 'CAN_ANSWER') { $result.="\n"; } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') { - $result.="\n"; - } + $result.="\n"; + } } - } + } if ($target eq 'meta') { if ($Apache::inputtags::part eq '0') { $result=&Apache::response::mandatory_part_meta;