From: tjhunt Date: Mon, 23 Mar 2009 01:59:30 +0000 (+0000) Subject: quiz: MDL-18635 log every single hit to mod/quiz/attempts.php X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=44d1cba4af9a1953caece0f734829c887d45fd24;p=moodle.git 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. --- diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 6cb43ff12d..01c5df5220 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -57,13 +57,10 @@ } $accessmanager->do_password_check($attemptobj->is_preview_user()); -/// Log continuation of the attempt, but only if some time has passed. - if ((time() - $attemptobj->get_attempt()->timemodified) > QUIZ_CONTINUE_ATTEMPT_LOG_INTERVAL) { - /// This action used to be 'continue attempt' but the database field has only 15 characters. - add_to_log($attemptobj->get_courseid(), 'quiz', 'continue attemp', - 'review.php?attempt=' . $attemptobj->get_attemptid(), - $attemptobj->get_quizid(), $attemptobj->get_cmid()); - } +/// This action used to be 'continue attempt' but the database field has only 15 characters. + add_to_log($attemptobj->get_courseid(), 'quiz', 'continue attemp', + 'review.php?attempt=' . $attemptobj->get_attemptid(), + $attemptobj->get_quizid(), $attemptobj->get_cmid()); /// Get the list of questions needed by this page. $questionids = $attemptobj->get_question_ids($page); diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 8608b42b94..174bf32045 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -61,12 +61,6 @@ define('QUIZ_STATE_CLOSED', 'closed'); define('QUIZ_STATE_TEACHERACCESS', 'teacheraccess'); // State only relevant if you are in a studenty role. /**#@-*/ -/** - * We don't log every single hit on attempt.php, only significant ones like starting and - * ending an attempt, and periodically during the attempt, as defined by this constant. (10 mins) - */ -define('QUIZ_CONTINUE_ATTEMPT_LOG_INTERVAL', '600'); - /** * We show the countdown timer if there is less than this amount of time left before the * the quiz close date. (1 hour)