From 1dac3d1e9995a058309b6fb9d7892eb2c75c98f5 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 21 Nov 2024 20:54:21 +0100 Subject: [PATCH] feat: Enhances question detail display in reports Displays question name and text in report tables to improve clarity of user responses alongside their grades. Improves readability and context by enriching question details. --- details.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/details.php b/details.php index 00def78..a4a3e5a 100644 --- a/details.php +++ b/details.php @@ -56,7 +56,7 @@ if ($mform->is_cancelled()) { $attempt_table->head = array(get_string('question', 'report_usergrades'), get_string('response', 'report_usergrades'), get_string('grade', 'report_usergrades')); $question_usages = $DB->get_records('question_usages', array('id' => $attempt->uniqueid)); - + foreach ($question_usages as $question_usage) { $question_attempts = $DB->get_records('question_attempts', array('questionusageid' => $question_usage->id)); @@ -68,7 +68,7 @@ if ($mform->is_cancelled()) { foreach ($question_grades as $question_grade) { if ($question_grade->fraction) { - $attempt_table->data[] = array($question->name, $response, $question_grade->fraction); + $attempt_table->data[] = array($question->name . ': ' . $question->questiontext, $response, $question_grade->fraction); } } } @@ -79,7 +79,6 @@ if ($mform->is_cancelled()) { $total_grade = $DB->get_record('quiz_grades', array('quiz' => $quiz->id, 'userid' => $user->id)); echo $OUTPUT->heading(get_string('totalgrade', 'report_usergrades') . ': ' . $total_grade->grade . ' / ' . $quiz->grade, 6); - } } }