Skip to content
Browse files

quiz: MDL-18635 log every single hit to mod/quiz/attempts.php

I don't know why the quiz only logged every 10 minutes. No other part of Moodle worked like that. However, it has always been like that and I did not have a good reason to change it until now.

What was a problem becuase it made it harder to catch people doing a primitive DOS attack against the server by hitting Reload repeatedly.
  • Loading branch information...
1 parent 103965d commit d5c0dec1cda413b24c6c2ac04f87dd33f97f9cfc tjhunt committed Mar 23, 2009
Showing with 3 additions and 9 deletions.
  1. +3 −9 mod/quiz/attempt.php
View
12 mod/quiz/attempt.php
@@ -237,12 +237,8 @@
"$quiz->id", $cm->id);
}
} else {
- // log continuation of attempt only if some time has lapsed
- if (($timestamp - $attempt->timemodified) > 600) { // 10 minutes have elapsed
- add_to_log($course->id, 'quiz', 'continue attemp', // this action used to be called 'continue attempt' but the database field has only 15 characters
- "review.php?attempt=$attempt->id",
- "$quiz->id", $cm->id);
- }
+ add_to_log($course->id, 'quiz', 'continue attemp', // this action used to be called 'continue attempt' but the database field has only 15 characters
+ 'review.php?attempt=' . $attempt->id, $quiz->id, $cm->id);
}
if (!$attempt->timestart) { // shouldn't really happen, just for robustness
$attempt->timestart = time();
@@ -383,9 +379,7 @@
save_question_session($question, $closestates[$key]);
}
- add_to_log($course->id, 'quiz', 'close attempt',
- "review.php?attempt=$attempt->id",
- "$quiz->id", $cm->id);
+ add_to_log($course->id, 'quiz', 'close attempt', 'review.php?attempt=' . $attempt->id, $quiz->id, $cm->id);
}
/// Update the quiz attempt and the overall grade for the quiz

0 comments on commit d5c0dec

Please sign in to comment.
Something went wrong with that request. Please try again.