--- loncom/homework/structuretags.pm 2005/06/13 20:20:33 1.294 +++ loncom/homework/structuretags.pm 2005/07/05 18:59:03 1.297 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.294 2005/06/13 20:20:33 albertel Exp $ +# $Id: structuretags.pm,v 1.297 2005/07/05 18:59:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -88,11 +88,10 @@ sub body_tag_start { $body_tag_start.=' style="font-size: x-large;" '; } $body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1); + + &Apache::lontexconvert::jsMath_reset(); if ($env{'environment.texengine'} eq 'jsMath') { - $body_tag_start.=''."\n". - ''."\n"; + $body_tag_start.=&Apache::lontexconvert::jsMath_header(); } return $body_tag_start; } @@ -119,8 +118,10 @@ sub page_start { my $body_tag_start; if (!defined($found{'body'}) && $env{'request.state'} eq 'construct' && $env{'environment.remote'} eq 'off') { - $body_tag_start=&Apache::loncommon::bodytag(); - $body_tag_start.=&Apache::lonxml::message_location(); + if ($target eq 'web') { + $body_tag_start=&Apache::loncommon::bodytag(); + $body_tag_start.=&Apache::lonxml::message_location(); + } } elsif (!defined($found{'body'})) { my $background=&Apache::lonxml::get_param('background',$parstack, $safeeval); @@ -510,6 +511,7 @@ sub start_problem { defined($env{'form.problemtype'})) { $Apache::lonhomework::type=$env{'form.problemtype'}; } + $Apache::lonhomework::default_type = $Apache::lonhomework::type; &Apache::lonxml::debug("Found this to be of type :$Apache::ltonhomework::type:"); } if ($Apache::lonhomework::type eq '' ) { @@ -1134,7 +1136,7 @@ sub start_part { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result=''; my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($id eq '') { $id = $Apache::lonxml::curdepth; } + if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; } $Apache::inputtags::part=$id; push(@Apache::inputtags::partlist,$id); @Apache::inputtags::response=(); @@ -1261,6 +1263,7 @@ sub end_part { } pop @Apache::inputtags::status; $Apache::inputtags::part=''; + $Apache::lonhomework::type = $Apache::lonhomework::default_type; return $result; }