Hide grading fields for unanswered questions

This commit is contained in:
Wojtek
2026-10-16 21:35:23 +02:00
parent 1da3149e2f
commit 1c1720e1e1
5 changed files with 8 additions and 6 deletions
@@ -202,7 +202,7 @@ class ResultModel extends BaseDatabaseModel
$questionIds = [];
foreach ($item->answers as $questionId => $answer) {
$question = $item->questions[(int) $questionId] ?? null;
if ($question && $question->question_type === 'open' && empty($answer['correct'])) {
if ($question && $question->question_type === 'open' && empty($answer['correct']) && trim((string) ($answer['selected'] ?? '')) !== '') {
$questionIds[] = (int) $questionId;
}
}