From: Gavin L. v. a. <we...@ma...> - 2005-06-09 15:02:17
|
Log Message: ----------- Gateway update: revise gateway template file Tags: ---- rel-2-1-a1 Modified Files: -------------- webwork2/conf/templates: gw.template Revision Data ------------- Index: gw.template =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/templates/Attic/gw.template,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -Lconf/templates/gw.template -Lconf/templates/gw.template -u -r1.1.2.2 -r1.1.2.3 --- conf/templates/gw.template +++ conf/templates/gw.template @@ -200,7 +200,7 @@ </style> <script language="javascript" type="text/javascript"> -function jumpTo(ref) { // scrolling javascript functin +function jumpTo(ref) { // scrolling javascript function if ( ref ) { var pn = ref - 1; // we start anchors at 1, not zero if ( navigator.appName == "Netscape" && @@ -222,6 +222,8 @@ // timer for gateway var theTime = -1; // -1 before we've initialized +var alerted = -1; // -1 = no alert set; 1 = 1st alert set + // this shouldn't really be needed function runtimer() { // aesthetically this is displeasing: we're assuming that the @@ -241,10 +243,26 @@ theTime = st; tm.value = toMinSec(theTime); setTimeout("runtimer()", 1000); // 1000 ms = 1 sec - } else { + } else if ( theTime == 0 && alerted != 3 ) { + alert("* You are out of time! *"); + alerted = 3; + } else if ( alerted != 3 ) { theTime--; tm.value = toMinSec(theTime); setTimeout("runtimer()", 1000); // 1000 ms = 1 sec + if ( theTime == 35 && alerted != 2 ) { // time is in seconds + alert("* You have only about 30 seconds to complete " + + "this assignment. Press Grade very soon! *\n" + + "* The timer stops while this alert box is open. *"); + alerted = 2; + theTime -= 5; + } else if ( theTime == 75 && alerted != 1) { + alert("* You have only about a minute left " + + "to complete this assignment! *\n" + + "* The timer stops while this alert box is open. *"); + alerted = 1; + theTime -= 5; + } } } } |