From 26843fb8bcaf403a03d4c8716bd7c3f73bf0a9d0 Mon Sep 17 00:00:00 2001 From: Peter Sistrom Date: Fri, 14 Apr 2023 17:08:10 +1000 Subject: [PATCH] Fix unit test - Resolves issue #659 --- classes/modules/turnitin_quiz.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/modules/turnitin_quiz.class.php b/classes/modules/turnitin_quiz.class.php index 059f03ef..75519115 100644 --- a/classes/modules/turnitin_quiz.class.php +++ b/classes/modules/turnitin_quiz.class.php @@ -82,7 +82,8 @@ public function update_mark($attemptid, $identifier, $userid, $grade, $quizgrade foreach ($attempt->get_slots() as $slot) { $answer = $attempt->get_question_attempt($slot)->get_response_summary(); // Check if this is the slot the mark is for by matching content. - if (sha1($answer.$slot) == $identifier) { + $answerslot = $answer ? $answer.$slot : $answer; + if (sha1($answerslot) == $identifier) { // Translate the TFS grade to a mark for the question. $questionmaxmark = $attempt->get_question_attempt($slot)->get_max_mark();