From: jamiesensei Date: Tue, 23 Sep 2008 10:39:12 +0000 (+0000) Subject: MDL-16632 "green highlighting should not be applied to grading method in quiz respons... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=14133ad91366373c959c9545cf45febf16b184d5;p=moodle.git MDL-16632 "green highlighting should not be applied to grading method in quiz responses report form" --- diff --git a/mod/quiz/report/reportlib.php b/mod/quiz/report/reportlib.php index ba77bd674d..081b1dd475 100644 --- a/mod/quiz/report/reportlib.php +++ b/mod/quiz/report/reportlib.php @@ -287,7 +287,7 @@ function quiz_report_grade_bands($bandwidth, $bands, $quizid, $userids=array()){ unset($data[$bands]); return $data; } -function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter){ +function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter, $highlight=true){ if ($quiz->attempts == 1) {//only one attempt allowed on this quiz return "

".get_string('onlyoneattemptallowed', "quiz_overview")."

"; } else if (!$qmsubselect){ @@ -295,8 +295,11 @@ function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter) } else if ($qmfilter){ return "

".get_string('showinggraded', "quiz_overview")."

"; }else { - return "

".get_string('showinggradedandungraded', "quiz_overview", - (''.quiz_get_grading_option_name($quiz->grademethod).''))."

"; + $a = quiz_get_grading_option_name($quiz->grademethod); + if ($highlight){ + $a = ''.$a.''; + } + return "

".get_string('showinggradedandungraded', "quiz_overview", $a)."

"; } } diff --git a/mod/quiz/report/responses/report.php b/mod/quiz/report/responses/report.php index 58116ac3e0..37f5fcc4bb 100644 --- a/mod/quiz/report/responses/report.php +++ b/mod/quiz/report/responses/report.php @@ -165,7 +165,7 @@ class quiz_responses_report extends quiz_default_report { // Print information on the grading method and whether we are displaying // if (!$table->is_downloading()) { //do not print notices when downloading - if ($strattempthighlight = quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter)) { + if ($strattempthighlight = quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter, false)) { echo '
' . $strattempthighlight . '
'; } } diff --git a/mod/quiz/report/responses/responsessettings_form.php b/mod/quiz/report/responses/responsessettings_form.php index c77e129378..f915f906a3 100644 --- a/mod/quiz/report/responses/responsessettings_form.php +++ b/mod/quiz/report/responses/responsessettings_form.php @@ -28,7 +28,7 @@ class mod_quiz_report_responses_settings extends moodleform { } $mform->addElement('select', 'attemptsmode', get_string('show', 'quiz_overview'), $options); if ($this->_customdata['qmsubselect']){ - $gm = ''.quiz_get_grading_option_name($this->_customdata['quiz']->grademethod).''; + $gm = quiz_get_grading_option_name($this->_customdata['quiz']->grademethod); $mform->addElement('advcheckbox', 'qmfilter', get_string('show', 'quiz_overview'), get_string('optonlygradedattempts', 'quiz_overview', $gm), null, array(0,1)); } //-------------------------------------------------------------------------------