--- loncom/interface/lonmenu.pm 2016/05/04 05:54:51 1.447 +++ loncom/interface/lonmenu.pm 2016/05/23 17:38:55 1.449 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.447 2016/05/04 05:54:51 raeburn Exp $ +# $Id: lonmenu.pm,v 1.449 2016/05/23 17:38:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1634,11 +1634,10 @@ END # LC_interval_done is true. # sub done_button_js { - my ($type,$width,$height,$proctor) = @_; + my ($type,$width,$height,$proctor,$donebuttontext) = @_; return unless (($type eq 'map') || ($type eq 'resource')); my %lt = &Apache::lonlocal::texthash( title => 'WARNING!', - button => 'Done', preamble => 'You are trying to end this timed event early.', map => 'Confirming that you are done will cause the time to expire and prevent you from changing any answers in the current folder.', resource => 'Confirming that you are done will cause the time to expire for this question, and prevent you from changing your answer(s).', @@ -1698,6 +1697,7 @@ sub done_button_js { $lt{'miss'} .= ' '.&mt('If you confirm you are done you will be unable to submit an answer for it.').'</p>'; } } + $donebuttontext = &HTML::Entities::encode($donebuttontext,'<>&"'); if ($proctor) { if ($height !~ /^\d+$/) { $height = 400; @@ -1715,14 +1715,14 @@ sub done_button_js { <form method="post" name="LCdoneButton" action=""> <input type="hidden" name="LC_interval_done" value="" /> <input type="hidden" name="LC_interval_done_proctorpass" value="" /> - <button id="LC_done-confirm-opener" type="button">$lt{'button'}</button> + <button id="LC_done-confirm-opener" type="button">$donebuttontext</button> </form> <div id="LC_done-confirm" title="$lt{'title'}"> <p>$lt{'preamble'} $lt{$type}</p> $lt{'miss'} <p>$lt{'proctor'}</p> - <form> + <form name="LCdoneButtonProctor" action=""> <label>$lt{'key'}<input type="password" name="LC_interval_done_proctorkey" value="" /></label> <input type="submit" tabindex="-1" style="position:absolute; top:-1000px" /> </form> @@ -1796,7 +1796,7 @@ END <form method="post" name="LCdoneButton" action=""> <input type="hidden" name="LC_interval_done" value="" /> - <button id="LC_done-confirm-opener" type="button">$lt{'button'}</button> + <button id="LC_done-confirm-opener" type="button">$donebuttontext</button> </form> <div id="LC_done-confirm" title="$lt{'title'}"> @@ -2501,9 +2501,17 @@ sub countdown_timer { } my $duedate = &Apache::lonnet::EXT("resource.0.duedate"); my @interval=&Apache::lonnet::EXT("resource.0.interval"); - my ($timelimit,$usesdone,$proctor,$secret); + my ($timelimit,$usesdone,$donebuttontext,$proctor,$secret); if (@interval > 1) { - ($timelimit,$usesdone,$proctor,$secret) = split(/_/,$interval[0]); + ($timelimit,my $donesuffix) = split(/_/,$interval[0],2); + if ($donesuffix =~ /^done\:([^\:]+)\:(.*)$/) { + $usesdone = 'done'; + $donebuttontext = $1; + (undef,$proctor,$secret) = split(/_/,$2); + } elsif ($donesuffix =~ /^done(|_.+)$/) { + $donebuttontext = &mt('Done'); + ($usesdone,$proctor,$secret) = split(/_/,$donesuffix); + } my $first_access=&Apache::lonnet::get_first_access($interval[1]); if ($first_access > 0) { if ($first_access+$timelimit > time) { @@ -2521,7 +2529,7 @@ sub countdown_timer { $collapse = '► '; if ((@interval > 1) && ($hastimeleft)) { if ($usesdone eq 'done') { - $donebutton = &done_button_js($interval[1],'','',$proctor); + $donebutton = &done_button_js($interval[1],'','',$proctor,$donebuttontext); } } } else {