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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user