Skip to content

Commit

Permalink
Merge branch 'MDL-68747-master' of https://github.com/dcai/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
abgreeve authored and snake committed May 7, 2021
2 parents c95b254 + a42df81 commit 178adf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mod/quiz/renderer.php
Expand Up @@ -1307,10 +1307,12 @@ public function quiz_override_summary_links(stdClass $quiz, stdClass $cm, $curre
*
* @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));
}

/**
Expand Down
6 changes: 4 additions & 2 deletions mod/quiz/report/overview/report.php
Expand Up @@ -225,15 +225,17 @@ public function display($quiz, $cm, $course) {
$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']);
}
}

if ($DB->record_exists('quiz_grades', array('quiz'=> $quiz->id))) {
$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;
Expand Down

0 comments on commit 178adf1

Please sign in to comment.