--- loncom/homework/structuretags.pm 2008/08/21 20:46:23 1.428 +++ loncom/homework/structuretags.pm 2008/10/12 13:35:34 1.432 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.428 2008/08/21 20:46:23 raeburn Exp $ +# $Id: structuretags.pm,v 1.432 2008/10/12 13:35:34 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,7 +74,7 @@ sub start_tex { if ($target ne 'edit' && $target ne 'modified') { my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser,$style); if ($target eq 'tex') { - return $bodytext.' '; + return $bodytext.'{}'; } } elsif ($target eq "edit" ) { my $bodytext = @@ -1392,9 +1392,15 @@ sub end_languageblock { my $result = &Apache::lonxml::endredirection(); my $which = &Apache::lonxml::get_param('which',$parstack, $safeeval); - foreach my $language (split(/\s*\,\s*/,$which)) { - unless ($language=~/\w/) { next; } - $available_texts{$language} = $result; + if ($which=~/\w/) { + $available_texts{$which} = $result; + } + my $otherlangs = &Apache::lonxml::get_param('other',$parstack, + $safeeval); + foreach my $language (split(/\s*\,\s*/,$otherlangs)) { + if ($language=~/\w/) { + $available_texts{$language} = $result; + } } } @@ -1493,7 +1499,7 @@ sub end_while { $return = &Apache::run::run($code,$safeeval); } if ($error) { - &Apache::lonxml::error('
'.&mt('Code ran too long. It ran for more than').' '.$Apache::lonnet::perlvar{'lonScriptTimeout'}.' '.&mt('seconds occured while running <while> on line').' '.$line.'
'); + &Apache::lonxml::error('
'.&mt('Code ran too long. It ran for more than').' '.$Apache::lonnet::perlvar{'lonScriptTimeout'}.' '.&mt('seconds occurred while running <while> on line').' '.$line.'
'); } } elsif ($target eq "edit") { $result.= &Apache::edit::tag_end($target,$token,''); @@ -1887,7 +1893,6 @@ sub end_startouttext { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; my $text=''; - if ($target eq 'edit') { my $areaid = 'homework_edit_'.$Apache::lonxml::curdepth; $text=&Apache::lonxml::get_all_text("endouttext",$parser,$style); @@ -1898,7 +1903,10 @@ sub end_startouttext { unless ($env{'environment.wysiwygeditor'} eq 'on') { $result.='' .&Apache::lonhtmlcommon::dragmath_button($areaid,1) - .''; + .'' + .'' + .&Apache::edit::insertlist($target,$token) + .''; } $result.='' . &Apache::loncommon::helpLatexCheatsheet().