Skip to content

Commit

Permalink
Replace deprecated Moodle 4.4+ language strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ngandrass committed May 13, 2024
1 parent f2809b0 commit e4fc13a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function generate(int $attemptid, array $sections): string {
'content' => userdate($attempt->timefinish),
];
$quiz_header_data['timetaken'] = [
'title' => get_string('timetaken', 'quiz'),
'title' => get_string('attemptduration', 'quiz'),
'content' => $timetaken,
];
}
Expand All @@ -444,7 +444,7 @@ public function generate(int $attemptid, array $sections): string {
if ($options->marks >= \question_display_options::MARK_AND_MAX && quiz_has_grades($quiz)) {
if (is_null($grade)) {
$quiz_header_data['grade'] = [
'title' => get_string('grade', 'quiz'),
'title' => get_string('gradenoun'),
'content' => quiz_format_grade($quiz, $grade),
];
}
Expand Down Expand Up @@ -473,7 +473,7 @@ public function generate(int $attemptid, array $sections): string {
$formattedgrade = get_string('outof', 'quiz', $a);
}
$quiz_header_data['grade'] = [
'title' => get_string('grade', 'quiz'),
'title' => get_string('gradenoun'),
'content' => $formattedgrade,
];
}
Expand Down Expand Up @@ -504,6 +504,7 @@ public function generate(int $attemptid, array $sections): string {
// FIXME: Remove after Moodle 4.1 (LTS) support ends on 2025-12-08
$html .= $renderer->review_summary_table($quiz_header_data, 0);
} else {
// TODO: Rework into proper use of new 4.4 API but create appropriate test cases first.
$html .= $renderer->review_attempt_summary(
\mod_quiz\output\attempt_summary_information::create_from_legacy_array($quiz_header_data),
0
Expand Down

0 comments on commit e4fc13a

Please sign in to comment.