--- loncom/xml/lonxml.pm 2008/03/07 21:17:04 1.473 +++ loncom/xml/lonxml.pm 2008/05/28 01:32:59 1.478 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.473 2008/03/07 21:17:04 www Exp $ +# $Id: lonxml.pm,v 1.478 2008/05/28 01:32:59 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1080,6 +1080,7 @@ Optional Arguments: sub increment_counter { my ($increment, $part_response) = @_; + if ($env{'form.grade_target'} eq 'analyze') { return; } if (!defined($increment) || $increment le 0) { $increment = 1; } @@ -1121,7 +1122,7 @@ sub init_counter { } sub store_counter { - &Apache::lonnet::appenv(('form.counter' => $Apache::lonxml::counter)); + &Apache::lonnet::appenv({'form.counter' => $Apache::lonxml::counter}); $Apache::lonxml::counter_changed=0; return ''; } @@ -1142,7 +1143,7 @@ sub store_counter { sub restore_problem_counter { if (defined($state)) { - &Apache::lonnet::appenv(('form.counter' => $state)); + &Apache::lonnet::appenv({'form.counter' => $state}); } } sub get_problem_counter { @@ -1379,7 +1380,7 @@ sub writeallows { &Apache::lonnet::hreflocation($thisdir,&unescape($_))}=$thisurl; } @extlinks=(); - &Apache::lonnet::appenv(%httpref); + &Apache::lonnet::appenv(\%httpref); } sub register_ssi { @@ -1496,6 +1497,30 @@ sub verify_html { return ''; } +sub renderingoptions { + my %langchoices=('' => ''); + foreach (&Apache::loncommon::languageids()) { + if (&Apache::loncommon::supportedlanguagecode($_)) { + $langchoices{&Apache::loncommon::supportedlanguagecode($_)} + = &Apache::loncommon::plainlanguagedescription($_); + } + } + return + ''. + &mt('Language: '). + &Apache::loncommon::select_form($env{'form.languages'},'languages', + %langchoices).' + + '. + &mt('Math Rendering: '). + &Apache::loncommon::select_form($env{'form.texengine'},'texengine', + ('' => '', + 'tth' => 'tth', + 'jsMath' => 'jsMath', + 'mimetex' => 'mimetex')).' + '; +} + sub inserteditinfo { my ($filecontents, $filetype, $filename)=@_; $filecontents = &HTML::Entities::encode($filecontents,'<>&"'); @@ -1559,7 +1584,7 @@ FULLPAGE my $form_events = &Apache::edit::form_change_detection(); my $htmlerror=&verify_html($filecontents); if ($htmlerror) { - $htmlerror=''.$htmlerror.'

'; + $htmlerror=''.$htmlerror.''; } my $editfooter=(<"; } return $result; } @@ -1815,7 +1841,7 @@ sub error { # If printing in construction space, put the error inside

 	push(@Apache::lonxml::error_messages,
 	     $Apache::lonxml::warnings_error_header.
-	     "ERROR:".join("
\n",@errors)."
\n"); + "".&mt('ERROR:')."".join("
\n",@errors)."
\n"); $Apache::lonxml::warnings_error_header=''; } else { my $errormsg; @@ -1825,7 +1851,9 @@ sub error { $errormsg=&mt("An error occured while processing this resource. The author has been notified."); } my $host=$Apache::lonnet::perlvar{'lonHostID'}; - push(@errors, "The error occurred on host $host"); + push(@errors, + &mt("The error occurred on host [_1]", + "$host")); my $msg = join('
', @errors);