1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-23 09:23:09 +02:00

Merge branch 'MDL-68747-master' of https://github.com/dcai/moodle

This commit is contained in:
abgreeve 2021-05-07 11:15:50 +08:00 committed by Jake Dallimore
commit 178adf1c2f
2 changed files with 8 additions and 4 deletions
mod/quiz
renderer.php
report/overview

@ -1307,10 +1307,12 @@ class mod_quiz_renderer extends plugin_renderer_base {
*
* @param \core\chart_base $chart The chart.
* @param string $title The title to display above the graph.
* @param array $attrs extra container html attributes.
* @return string HTML fragment for the graph.
*/
public function chart(\core\chart_base $chart, $title) {
return $this->heading($title, 3) . html_writer::tag('div', $this->render($chart), array('class' => 'graph'));
public function chart(\core\chart_base $chart, $title, $attrs = []) {
return $this->heading($title, 3) . html_writer::tag('div',
$this->render($chart), array_merge(['class' => 'graph'], $attrs));
}
/**

@ -225,7 +225,8 @@ class quiz_overview_report extends quiz_attempts_report {
$data = quiz_report_grade_bands($bandwidth, $bands, $quiz->id, $groupstudentsjoins);
$chart = self::get_chart($labels, $data);
$graphname = get_string('overviewreportgraphgroup', 'quiz_overview', groups_get_group_name($currentgroup));
echo $output->chart($chart, $graphname);
// Numerical range data should display in LTR even for RTL languages.
echo $output->chart($chart, $graphname, ['dir' => 'ltr']);
}
}
@ -233,7 +234,8 @@ class quiz_overview_report extends quiz_attempts_report {
$data = quiz_report_grade_bands($bandwidth, $bands, $quiz->id, new \core\dml\sql_join());
$chart = self::get_chart($labels, $data);
$graphname = get_string('overviewreportgraph', 'quiz_overview');
echo $output->chart($chart, $graphname);
// Numerical range data should display in LTR even for RTL languages.
echo $output->chart($chart, $graphname, ['dir' => 'ltr']);
}
}
return true;