| … | |
… | |
| 1244 | "submitted for a grade"),"\n",$mesg,"\n", |
1244 | "submitted for a grade"),"\n",$mesg,"\n", |
| 1245 | "You may, however, check your answers to see what you did" . |
1245 | "You may, however, check your answers to see what you did" . |
| 1246 | " right or wrong."), "\n\n"; |
1246 | " right or wrong."), "\n\n"; |
| 1247 | print CGI::end_div(); |
1247 | print CGI::end_div(); |
| 1248 | } else { |
1248 | } else { |
|
|
1249 | |
|
|
1250 | # FIXME: This assumes that there IS a time limit! |
|
|
1251 | # FIXME: We need to drop this out gracefully if there isn't! |
|
|
1252 | # set up a timer |
|
|
1253 | my $timeNow = time(); |
|
|
1254 | my $timeLeft = $set->due_date() - $timeNow; # this is in seconds |
| 1249 | print CGI::start_div({class=>"gwTiming"}); |
1255 | print CGI::start_div({class=>"gwTiming"}); |
| 1250 | print CGI::p(CGI::strong("This version started ", |
1256 | print CGI::startform({-name=>"gwtimer", -method=>"POST", |
| 1251 | scalar(localtime($set->open_date())), |
1257 | -action=>$r->uri}), "\n"; |
| 1252 | CGI::br(),"\nTime limit : ", |
1258 | print CGI::hidden({-name=>"gwpagetimeleft", -value=>$timeLeft}), "\n"; |
| 1253 | ($set->version_time_limit()/60), |
1259 | print CGI::strong("Time Remaining:"); |
| 1254 | " minutes (must be completed by: ", |
1260 | print CGI::textfield({-name=>'gwtime', -default=>0, -size=>8}), |
| 1255 | scalar(localtime($set->due_date())), ")", CGI::br(), |
1261 | CGI::strong("min:sec"), CGI::br(), "\n"; |
| 1256 | "The current time is ", scalar(localtime()))), "\n\n"; |
1262 | print CGI::endform(); |
|
|
1263 | if ( $timeLeft < 1 ) { |
|
|
1264 | print CGI::span({-class=>"resultsWithError"}, |
|
|
1265 | CGI::b("You have less than 1 minute to ", |
|
|
1266 | "complete this test.\n")); |
|
|
1267 | } |
| 1257 | print CGI::end_div(); |
1268 | print CGI::end_div(); |
| 1258 | if ( $set->due_date() - $set->version_time_limit() < 1 ) { |
1269 | # print CGI::strong("Time Remaining: |
| 1259 | print CGI::start_div({class=>"gwWarning"}); |
1270 | # scalar(localtime($set->open_date())), |
| 1260 | print CGI::p(CGI::strong("You have less than 1 minute to ", |
1271 | # CGI::br(),"\nTime limit : ", |
| 1261 | "complete this version.\n")); |
1272 | # ($set->version_time_limit()/60), |
| 1262 | print CGI::end_div(); |
1273 | # " minutes (must be completed by: ", |
| 1263 | } |
1274 | # scalar(localtime($set->due_date())), ")", CGI::br(), |
|
|
1275 | # "The current time is ", scalar(localtime())), "\n\n"; |
| 1264 | } |
1276 | } |
| 1265 | |
1277 | |
| 1266 | |
1278 | |
| 1267 | print CGI::startform({-name=>"gwquiz", -method=>"POST", -action=>$r->uri}), $self->hidden_authen_fields, |
1279 | print CGI::startform({-name=>"gwquiz", -method=>"POST", -action=>$r->uri}), $self->hidden_authen_fields, |
| 1268 | $self->hidden_proctor_authen_fields; |
1280 | $self->hidden_proctor_authen_fields; |
| … | |
… | |
| 1277 | |
1289 | |
| 1278 | # some links to easily move between problems |
1290 | # some links to easily move between problems |
| 1279 | my $jumpLinks = "Jump to problem: "; |
1291 | my $jumpLinks = "Jump to problem: "; |
| 1280 | for my $i ( 0 .. $#pg_results ) { |
1292 | for my $i ( 0 .. $#pg_results ) { |
| 1281 | my $pn = $i+1; |
1293 | my $pn = $i+1; |
| 1282 | $jumpLinks .= "/ " . CGI::a({-href=>".", -onclick=>"jumpTo($i);return false;"}, "$pn") . " /"; |
1294 | $jumpLinks .= "/ " . CGI::a({-href=>".", -onclick=>"jumpTo($pn);return false;"}, "$pn") . " /"; |
| 1283 | } |
1295 | } |
| 1284 | print CGI::p($jumpLinks,"\n"); |
1296 | print CGI::p($jumpLinks,"\n"); |
| 1285 | |
1297 | |
| 1286 | # print out problems and attempt results, as appropriate |
1298 | # print out problems and attempt results, as appropriate |
| 1287 | # note: args to attemptResults are (self,) $pg, $showAttemptAnswers, |
1299 | # note: args to attemptResults are (self,) $pg, $showAttemptAnswers, |
| … | |
… | |
| 1364 | $resultsTable = $self->attemptResults($pg, 1, 0, 0, 0, 1); |
1376 | $resultsTable = $self->attemptResults($pg, 1, 0, 0, 0, 1); |
| 1365 | # print $self->attemptResults($pg, 1, 0, 0, 0, 1); |
1377 | # print $self->attemptResults($pg, 1, 0, 0, 0, 1); |
| 1366 | } |
1378 | } |
| 1367 | |
1379 | |
| 1368 | print CGI::start_div({class=>"gwProblem"}); |
1380 | print CGI::start_div({class=>"gwProblem"}); |
|
|
1381 | my $i1 = $i+1; |
| 1369 | print CGI::a({-name=>"#$i"},""); |
1382 | print CGI::a({-name=>"#$i1"},""); |
| 1370 | print CGI::strong("Problem $problemNumber."), "\n", $recordMessage; |
1383 | print CGI::strong("Problem $problemNumber."), "\n", $recordMessage; |
| 1371 | print CGI::p($pg->{body_text}), |
1384 | print CGI::p($pg->{body_text}), |
| 1372 | CGI::p($pg->{result}->{msg} ? CGI::b("Note: ") : "", |
1385 | CGI::p($pg->{result}->{msg} ? CGI::b("Note: ") : "", |
| 1373 | CGI::i($pg->{result}->{msg})); |
1386 | CGI::i($pg->{result}->{msg})); |
| 1374 | print CGI::p({class=>"gwPreview"}, |
1387 | print CGI::p({class=>"gwPreview"}, |