fix: Fixes retrieval of question grades

Changes the database query to retrieve multiple records
instead of a single record. This addresses an issue where
only one grade was being fetched even if multiple
assessment steps exist for a question attempt, ensuring
correct display of all attempts and associated grades.
This commit is contained in:
Kumi 2024-11-21 20:51:24 +01:00
parent 6692dbb617
commit 0388d71ef9
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -64,7 +64,7 @@ if ($mform->is_cancelled()) {
$question = $questions[$question_attempt->questionid];
$response = $question_attempt->responsesummary;
$question_grades = $DB->get_record('question_attempt_steps', array('questionattemptid' => $question_attempt->id));
$question_grades = $DB->get_records('question_attempt_steps', array('questionattemptid' => $question_attempt->id));
foreach ($question_grades as $question_grade) {
$attempt_table->data[] = array($question->name, $response, $question_grade->fraction);