Skip to content

Commit

Permalink
Test: Fix Accessing Value on Null in ClozeQuestion
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Nov 12, 2024
1 parent 9fc97b9 commit 0b31db0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Modules/TestQuestionPool/classes/class.assClozeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,11 @@ public function calculateCombinationResult($user_result): array
break;
case CLOZE_SELECT:
$answer = $this->gaps[$gap_key]->getItem($gap_answers[$gap_key]);
$answertext = $answer->getAnswertext();
$answertext = '';
if ($answer !== null) {
$answertext = $answer->getAnswertext();
}

if ($answertext != $combination_gap_answer['answer']) {
$combination_fulfilled = false;
}
Expand Down

0 comments on commit 0b31db0

Please sign in to comment.