From b423cff11a834a2b0db44099998330e18381876d Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 12 Apr 2007 22:16:47 +0000 Subject: [PATCH] MDL-9325 - mod/quiz:ignoretimelimits does not work. This is a really horrific short-term fix to a problem not of my making. Merged from MOODLE_18_STABLE. --- lib/questionlib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index 21411cc1cf..94bcdc27ca 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1228,6 +1228,9 @@ function question_isgradingevent($event) { * for incorrect earlier responses are subtracted. */ function question_apply_penalty_and_timelimit(&$question, &$state, $attempt, $cmoptions) { + // TODO. Quiz dependancy. The fact that the attempt that is passed in here + // is from quiz_attempts, and we use things like $cmoptions->timelimit. + // deal with penalty if ($cmoptions->penaltyscheme) { $state->grade = $state->raw_grade - $state->sumpenalty; @@ -1239,7 +1242,9 @@ function question_apply_penalty_and_timelimit(&$question, &$state, $attempt, $cm // deal with timelimit if ($cmoptions->timelimit) { // We allow for 5% uncertainty in the following test - if (($state->timestamp - $attempt->timestart) > ($cmoptions->timelimit * 63)) { + if (($state->timestamp - $attempt->timestart) > ($cmoptions->timelimit * 63) && + !has_capability('mod/quiz:ignoretimelimits', get_context_instance(CONTEXT_MODULE, get_coursemodule_from_instance('quiz', $cmoptions->id)->id), $attempt->userid, false)) { +echo "

Frog: ''.

"; // DONOTCOMMIT $state->grade = 0; } } -- 2.39.5