From 6d54b0f77fee89b46e8fc978b8b25e53af944087 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 13 Dec 2011 16:50:19 +0000 Subject: [PATCH] MDL-30683 don't show overall feedback in the quiz grades report. The grades are small, while the feedback can be big, which breaks the table layout. --- mod/quiz/report/attemptsreport.php | 5 +++-- mod/quiz/report/overview/report.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/quiz/report/attemptsreport.php b/mod/quiz/report/attemptsreport.php index edc4ea4fc33..c0b4f654e7d 100644 --- a/mod/quiz/report/attemptsreport.php +++ b/mod/quiz/report/attemptsreport.php @@ -300,15 +300,16 @@ abstract class quiz_attempt_report extends quiz_default_report { * @param object $quiz the quiz settings. * @param array $columns the list of columns. Added to. * @param array $headers the columns headings. Added to. + * @param bool $includefeedback whether to include the feedbacktext columns */ - protected function add_grade_columns($quiz, &$columns, &$headers) { + protected function add_grade_columns($quiz, &$columns, &$headers, $includefeedback = true) { if ($this->should_show_grades($quiz)) { $columns[] = 'sumgrades'; $headers[] = get_string('grade', 'quiz') . '/' . quiz_format_grade($quiz, $quiz->grade); } - if (quiz_has_feedback($quiz)) { + if ($includefeedback && quiz_has_feedback($quiz)) { $columns[] = 'feedbacktext'; $headers[] = get_string('feedback', 'quiz'); } diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php index e863e45fa5e..671b398e1d4 100644 --- a/mod/quiz/report/overview/report.php +++ b/mod/quiz/report/overview/report.php @@ -321,7 +321,7 @@ class quiz_overview_report extends quiz_attempt_report { $headers[] = get_string('regrade', 'quiz_overview'); } - $this->add_grade_columns($quiz, $columns, $headers); + $this->add_grade_columns($quiz, $columns, $headers, false); $this->set_up_table_columns( $table, $columns, $headers, $reporturl, $displayoptions, false);