From: tjhunt Date: Wed, 21 May 2008 11:10:06 +0000 (+0000) Subject: Inconsistency between quiz attempt->id and attempt.uniqueid X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=95de57b8ac92ca4f4b4785986c2ed0ef5bb8d99a;p=moodle.git Inconsistency between quiz attempt->id and attempt.uniqueid --- diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 5b9df4eb16..cc5eb56b63 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -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);