From 5851ef55b605a2451341e7cad959b084fd492cf7 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 6 Jul 2007 02:49:36 +0000 Subject: [PATCH] MDL-10210 2 new preferences: showgrandtotals and grandtotalsdisplaytype --- grade/report/grader/preferences_form.php | 19 ++++++++++++++++--- grade/report/grader/settings.php | 6 ++++++ lang/en_utf8/grades.php | 4 ++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/grade/report/grader/preferences_form.php b/grade/report/grader/preferences_form.php index a96bf88e9f..0ec3b1fb92 100644 --- a/grade/report/grader/preferences_form.php +++ b/grade/report/grader/preferences_form.php @@ -62,7 +62,14 @@ class grader_report_preferences_form extends moodleform { $mform->setDefault('grade_report_gradedisplaytype', $prefs->gradedisplaytype); $mform->setType('grade_report_gradedisplaytype', PARAM_INT); - $mform->addElement('select','grade_report_feedbackformat', get_string('feedbackformat', 'grades'), + $mform->addElement('select','grade_report_grandtotalsdisplaytype', get_string('grandtotalsdisplaytype', 'grades'), + array(get_string('raw', 'grades'), get_string('percentage', 'grades'))); + $mform->setHelpButton('grade_report_grandtotalsdisplaytype', array(false, get_string('grandtotalsdisplaytype', 'grades'), false, true, + false, get_string('configgrandtotalsdisplaytype', 'grades'))); + $mform->setDefault('grade_report_grandtotalsdisplaytype', $prefs->grandtotalsdisplaytype); + $mform->setType('grade_report_grandtotalsdisplaytype', PARAM_INT); + + $mform->addElement('select','grade_report_feedbackformat', get_string('feedbackformat', 'grades'), array(get_string('text', 'grades'), get_string('html', 'grades'))); $mform->setHelpButton('grade_report_feedbackformat', array(false, get_string('feedbackformat', 'grades'), false, true, false, get_string('configfeedbackformat', 'grades'))); @@ -116,8 +123,14 @@ class grader_report_preferences_form extends moodleform { $mform->setHelpButton('grade_report_showscales', array(false, get_string('showscales', 'grades'), false, true, false, get_string('configshowscales', 'grades'))); $mform->setDefault('grade_report_showscales', $prefs->showscales); - $mform->setType('grade_report_showscales', PARAM_INT); - + $mform->setType('grade_report_showscales', PARAM_INT); + + $mform->addElement('checkbox', 'grade_report_showgrandtotals', get_string('showgrandtotals', 'grades')); + $mform->setHelpButton('grade_report_showgrandtotals', array(false, get_string('showgrandtotals', 'grades'), false, true, + false, get_string('configshowgrandtotals', 'grades'))); + $mform->setDefault('grade_report_showgrandtotals', $prefs->showgrandtotals); + $mform->setType('grade_report_showgrandtotals', PARAM_INT); + $mform->addElement('hidden', 'id'); $mform->setDefault('id', $course->id); diff --git a/grade/report/grader/settings.php b/grade/report/grader/settings.php index 82a381e572..746735982b 100644 --- a/grade/report/grader/settings.php +++ b/grade/report/grader/settings.php @@ -17,10 +17,16 @@ $settings->add(new admin_setting_configselect('grade_report_gradedisplaytype', g get_string('configgradedisplaytype', 'grades'), false, array( '0' => 'raw', '1' => 'percentage'))); +$settings->add(new admin_setting_configselect('grade_report_grandtotalsdisplaytype', get_string('grandtotalsdisplaytype', 'grades'), + get_string('configgrandtotalsdisplaytype', 'grades'), false, + array( '0' => 'raw', + '1' => 'percentage'))); $settings->add(new admin_setting_configcheckbox('grade_report_showeyecons', get_string('showeyecons', 'grades'), get_string('configshoweyecons', 'grades'), 0)); $settings->add(new admin_setting_configcheckbox('grade_report_showgroups', get_string('showgroups', 'grades'), get_string('configshowgroups', 'grades'), 0)); +$settings->add(new admin_setting_configcheckbox('grade_report_showgrandtotals', get_string('showgrandtotals', 'grades'), + get_string('configshowgrandtotals', 'grades'), 0)); $settings->add(new admin_setting_configcheckbox('grade_report_showlocks', get_string('showlocks', 'grades'), get_string('configshowlocks', 'grades'), 0)); $settings->add(new admin_setting_configcheckbox('grade_report_shownotes', get_string('shownotes', 'grades'), diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index ab3198ddf9..9ab723e1f5 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -32,7 +32,9 @@ $string['configdecimalpoints'] = 'The number of decimal points to display for ea $string['configenableajax'] = 'Adds a layer of AJAX functionality to the grader report, simplifying and speeding up common operations. Depends on Javascript being switched on at the user\'s browser level.'; $string['configfeedbackformat'] = 'The format of feedback notes attached to grades. This also determines the interface element used to enter such feedback (htmleditor for HTML format).'; $string['configgradedisplaytype'] = 'Grades can be shown as raw grades or as percentages (in reference to the minimum and maximum grades).'; +$string['configgrandtotalsdisplaytype'] = 'Grand totals can be shown as raw grades or as percentages (in reference to the minimum and maximum grades).'; $string['configshoweyecons'] = 'Whether to show an eye-con near each grade (controlling its visibility to the user).'; +$string['configshowgrandtotals'] = 'Show grand totals in the grader report.'; $string['configshowgroups'] = 'Show group totals and means in the grader report.'; $string['configshowlocks'] = 'Whether to show a lock/unlock icon near each grade.'; $string['configshownotes'] = 'Whether to show a feedback icon (for adding/editing) near each grade.'; @@ -107,6 +109,7 @@ $string['gradereports'] = 'Grades report'; $string['graderreport'] = 'Grader report'; $string['gradetype'] = 'Grade type'; $string['gradeweighthelp'] = 'Grade Weight Help'; +$string['grandtotalsdisplaytype'] = 'Grand totals display type'; $string['hideadvanced'] = 'Hide Advanced Features'; $string['hidecategory'] = 'Hidden'; $string['highgradeascending'] = 'Sort by high grade ascending'; @@ -190,6 +193,7 @@ $string['settings'] = 'Settings'; $string['setweights'] = 'Set Weights'; $string['showallstudents'] = 'Show All Students'; $string['showeyecons'] = 'Show eye-cons'; +$string['showsgrandtotals'] = 'Show grand totals'; $string['showgroups'] = 'Show groups'; $string['showlocks'] = 'Show locks'; $string['shownotes'] = 'Show feedback'; -- 2.39.5