--- loncom/interface/lonmenu.pm 2015/04/14 21:35:52 1.431.2.2 +++ loncom/interface/lonmenu.pm 2015/05/26 13:25:43 1.431.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.431.2.2 2015/04/14 21:35:52 musolffc Exp $ +# $Id: lonmenu.pm,v 1.431.2.3 2015/05/26 13:25:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1536,34 +1536,53 @@ function toggleCountdown() { END } -# This creates a "done button" for timed events. The confirmation box is a jQuerey -# dialog widget. Clicking OK will set (done = 'true') which is checked in +# This creates a "done button" for timed events. The confirmation box is a jQuery +# dialog widget. Clicking OK will set (LC_interval_done = 'true') which is checked in # lonhomework.pm. sub done_button_js { - return < - - - + my ($type,$height) = @_; + if ($height !~ /^\d+$/) { + $height = 320; + } + 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).', + ok => 'Click "OK" if you are completely finished.', + cancel => 'Click "Cancel" to continue working.', + ); + my $confirm; + if (($type eq 'map') || ($type eq 'resource')) { + $confirm = $lt{'preamble'}.' '.$lt{$type}.' '.$lt{'ok'}.' '.$lt{'cancel'}; + } + if ($confirm) { + return < + + + -
-

You are trying to end this timed event early. Confirming that you are done will cause the time to expire and prevent you from changing any answers in the current folder. Click "OK" if you are completely finished. Click "Cancel" to continue working.

+
+

$confirm

- END + } else { + return; + } } sub utilityfunctions { @@ -2256,9 +2279,9 @@ sub countdown_timer { ($type eq 'Task' && $slothastime)) { $currdisp = 'inline'; $collapse = '► '; - $donebutton = &done_button_js(); - - + if ((@interval > 1) && ($hastimeleft)) { + $donebutton = &done_button_js($interval[1]); + } } else { $currdisp = 'none'; $expand = '◄ '; @@ -2270,7 +2293,7 @@ sub countdown_timer { my $desc = &mt('Countdown to due date/time'); return < $collapse @@ -2279,7 +2302,6 @@ $collapse $expand $alttxt$title -$donebutton END } }