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.
This commit is contained in:
Kumi 2024-11-21 20:54:21 +01:00
parent 77614bc8c3
commit 1dac3d1e99
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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);
}
}
}