From d5c0dec1cda413b24c6c2ac04f87dd33f97f9cfc Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 23 Mar 2009 01:59:24 +0000 Subject: [PATCH] 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. --- mod/quiz/attempt.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 1b8b6e1c8b2..f063e2f4b37 100644 --- a/mod/quiz/attempt.php +++ b/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