--- loncom/homework/structuretags.pm 2019/11/05 18:14:39 1.512.2.22 +++ loncom/homework/structuretags.pm 2024/07/07 21:45:07 1.512.2.28 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.512.2.22 2019/11/05 18:14:39 raeburn Exp $ +# $Id: structuretags.pm,v 1.512.2.28 2024/07/07 21:45:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,6 +63,7 @@ use Apache::londefdef; use Apache::lonenc(); use Apache::loncommon(); use Time::HiRes qw( gettimeofday tv_interval ); +use HTML::Entities(); use lib '/home/httpd/lib/perl/'; use LONCAPA; @@ -271,7 +272,7 @@ sub homework_js { } return &Apache::loncommon::resize_textarea_js(). &Apache::loncommon::colorfuleditor_js(). - &setmode_javascript(). + &Apache::lonxml::setmode_javascript(). <<"JS"; -ENDSCRIPT -} - sub page_start { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name, $extra_head)=@_; @@ -1388,9 +1374,11 @@ sub firstaccess_msg { my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); my $buttontext = &mt('Show Resource'); my $timertext = &mt('Start Timer?'); + my $shownsymb = &HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb),'\'"<>&'); $result .= (< + ENDCHECKOUT @@ -1717,10 +1705,13 @@ sub start_problem { $result.='\noindent \vskip 1 mm '. $startminipage.'\vskip 0 mm'; if ($status eq 'UNAVAILABLE') { - $result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm '; + $result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.'); + } elsif ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { + $result.=&mt('Problem is not open to be viewed. It')." $accessmsg"; } else { - $result.=&mt('Problem is not open to be viewed. It')." $accessmsg \\vskip 0 mm "; + $result.=&mt('Problem is not open to be viewed.'); } + $result .= " \\vskip 0 mm "; } } elsif ($status eq 'NEEDS_CHECKIN') { my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser, @@ -2031,7 +2022,8 @@ ENDJS # computation: # if ($target eq 'web') { - $result .= &Apache::lonhtmlcommon::set_compute_end_time(); + $result .= &Apache::lonhtmlcommon::dash_to_minus_js(). + &Apache::lonhtmlcommon::set_compute_end_time(); # # Closing tags delayed so any tags # not in head can appear inside body, for valid xhtml. @@ -2854,7 +2846,11 @@ sub end_part { $gradestatus=''; } $result.=$gradestatus; - if ($$tagstack[-2] eq 'td' and $target eq 'tex') {$result.='\end{minipage}';} + if ($$tagstack[-2] eq 'td' and $target eq 'tex') { + if (not $env{'form.problem_split'}=~/yes/) { + $result.='\end{minipage}'; + } + } } elsif ($target eq 'edit') { $result.=&Apache::edit::end_table(); } elsif ($target eq 'modified') { @@ -3153,7 +3149,7 @@ sub randomizetry_part_header { my ($header,$text); if ($reqtries eq 'none') { $header = &mt('No Question Variation'); - $text = &mt('For this question there will no new variation after a try.'); + $text = &mt('For this question there will be no new variation after a try.'); } elsif ($reqtries > 1) { $header = &mt('New Question Variation After Every [quant,_1,Try,Tries]',$reqtries); if (($problemstatus eq 'no') ||