]> git.mjollnir.org Git - moodle.git/commitdiff
quiz: MDL-18635 log every single hit to mod/quiz/attempts.php
authortjhunt <tjhunt>
Mon, 23 Mar 2009 01:59:30 +0000 (01:59 +0000)
committertjhunt <tjhunt>
Mon, 23 Mar 2009 01:59:30 +0000 (01:59 +0000)
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
mod/quiz/locallib.php

index 6cb43ff12df55ef320789b82681cf11f5b9a5d90..01c5df5220ae2af521143f683e4ea23fa7fce663 100644 (file)
     }
     $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);
index 8608b42b947e8a05da0f06411df853c28f599184..174bf32045314ba5b4514c148a1a5c314ed0b9ff 100644 (file)
@@ -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)