From 5cae3a321c0d2b2ebcbe23a6232a1f873b2164ac Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 3 Mar 2005 08:42:43 +0000 Subject: [PATCH] Fixed timesincestart stuff, I think. bug 2466 --- mod/quiz/attempt.php | 10 ++++------ mod/quiz/imsattempt.php | 12 +++++------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 23149b285dc..4660720bddd 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -174,12 +174,6 @@ } } - if($timelimit > 0) { - if(($timelimit + 60) <= $timesincestart) { - $quiz->timesincestart = $timesincestart; - } - } - /// Retrieve ->maxgrade for all questions If (!($grades = quiz_get_question_grades($quiz->id, $quiz->questions))) { $grades = array(); @@ -188,6 +182,10 @@ $questions[$qid]->maxgrade = $grade->grade; } + if (isset($timesincestart)) { + $quiz->timesincestart = $timesincestart; // To pass it on to quiz_grade_responses + } + if (!$result = quiz_grade_responses($quiz, $questions, $unattempt->id)) { error("Could not grade your quiz attempt!"); } diff --git a/mod/quiz/imsattempt.php b/mod/quiz/imsattempt.php index fe29f8400b5..23b2956c35a 100644 --- a/mod/quiz/imsattempt.php +++ b/mod/quiz/imsattempt.php @@ -142,12 +142,6 @@ frageplayer_error($error); } - if($timelimit > 0) { - if(($timelimit + 60) <= $timesincestart) { - $quiz->timesincestart = $timesincestart; - } - } - /// Retrieve ->maxgrade for all questions If (!($grades = quiz_get_question_grades($quiz->id, $quiz->questions))) { $grades = array(); @@ -156,6 +150,10 @@ $questions[$qid]->maxgrade = $grade->grade; } + if (isset($timesincestart)) { + $quiz->timesincestart = $timesincestart; // To pass it on to quiz_grade_responses + } + if (!$result = quiz_grade_responses($quiz, $questions)) { frageplayer_error("Could not grade your quiz attempt"); } @@ -296,4 +294,4 @@ } } -?> \ No newline at end of file +?>