]> git.mjollnir.org Git - moodle.git/commitdiff
Quiztimer stuff added
authorjulmis <julmis>
Tue, 27 Jul 2004 02:03:19 +0000 (02:03 +0000)
committerjulmis <julmis>
Tue, 27 Jul 2004 02:03:19 +0000 (02:03 +0000)
- Skip regrading if attempt is overdued

mod/quiz/report/regrade/report.php

index 351bf1173761298ce4c21a0b89874d6d8ef6e346..890b74cf85547b48e7f01cd838043d39e2ec1bee 100644 (file)
@@ -27,6 +27,15 @@ class quiz_report extends quiz_default_report {
                 continue;
             }
 
+            if($quiz->timelimit > 0) {
+                $timelimit = ($quiz->timelimit * 60) + 60;
+                $timetaken = $attempt->timefinish - $attempt->timestart;
+                if($timetaken > $timelimit) {
+                    // Skip overdued attempts
+                    continue;
+                }
+            }
+
             $count->attempt++;
 
             if (! $questions = quiz_get_attempt_questions($quiz, $attempt)) {
@@ -55,7 +64,7 @@ class quiz_report extends quiz_default_report {
                     notify("Could not save best grade for user $userid!");
                 }
             }
-        }   
+        }
 
         print_heading(get_string("regradecomplete", "quiz"));
         print_heading(get_string("regradecount", "quiz", $count));