]> git.mjollnir.org Git - moodle.git/commitdiff
Inconsistency between quiz attempt->id and attempt.uniqueid
authortjhunt <tjhunt>
Wed, 21 May 2008 11:10:06 +0000 (11:10 +0000)
committertjhunt <tjhunt>
Wed, 21 May 2008 11:10:06 +0000 (11:10 +0000)
mod/quiz/lib.php

index 5b9df4eb16db4c27ad17a261ad8ca3c8196a0dbc..cc5eb56b63bd8efee7b35c166b010cec5a020c62 100644 (file)
@@ -1054,14 +1054,14 @@ function quiz_reset_userdata($data) {
  * Checks whether the current user is allowed to view a file uploaded in a quiz.
  * Teachers can view any from their courses, students can only view their own.
  *
- * @param int $attemptid int attempt id
+ * @param int $attemptuniqueid int attempt id
  * @param int $questionid int question id
  * @return boolean to indicate access granted or denied
  */
-function quiz_check_file_access($attemptid, $questionid) {
+function quiz_check_file_access($attemptuniqueid, $questionid) {
     global $USER;
 
-    $attempt = get_record("quiz_attempts", 'id', $attemptid);
+    $attempt = get_record("quiz_attempts", 'uniqueid', $attemptid);
     $quiz = get_record("quiz", 'id', $attempt->quiz);
     $context = get_context_instance(CONTEXT_COURSE, $quiz->course);