MDL-47575 gradebook: Show weights and contribution by default.

This commit is contained in:
Zachary Durber 2014-10-10 14:55:37 +08:00
parent d3ff82257e
commit f4278326c0
2 changed files with 14 additions and 9 deletions

View File

@ -118,10 +118,10 @@ class grade_report_user extends grade_report {
public $showfeedback = true;
/**
* Show grade weighting in the report, default false
* Show grade weighting in the report, default true.
* @var bool
*/
public $showweight = false;
public $showweight = true;
/**
* Show letter grades in the report, default false
@ -133,7 +133,7 @@ class grade_report_user extends grade_report {
* Show the calculated contribution to the course total column.
* @var bool
*/
public $showcontributiontocoursetotal = false;
public $showcontributiontocoursetotal = true;
/**
* Show average grades in the report, default false.
@ -205,8 +205,13 @@ class grade_report_user extends grade_report {
$this->showgrade = grade_get_setting($this->courseid, 'report_user_showgrade', !empty($CFG->grade_report_user_showgrade));
$this->showrange = grade_get_setting($this->courseid, 'report_user_showrange', !empty($CFG->grade_report_user_showrange));
$this->showfeedback = grade_get_setting($this->courseid, 'report_user_showfeedback', !empty($CFG->grade_report_user_showfeedback));
$this->showweight = grade_get_setting($this->courseid, 'report_user_showweight', !empty($CFG->grade_report_user_showweight));
$this->showcontributiontocoursetotal = grade_get_setting($this->courseid, 'report_user_showcontributiontocoursetotal', !empty($CFG->grade_report_user_showcontributiontocoursetotal));
$this->showweight = grade_get_setting($this->courseid, 'report_user_showweight',
empty($CFG->grade_report_user_showweight));
$this->showcontributiontocoursetotal = grade_get_setting($this->courseid, 'report_user_showcontributiontocoursetotal',
empty($CFG->grade_report_user_showcontributiontocoursetotal));
$this->showlettergrade = grade_get_setting($this->courseid, 'report_user_showlettergrade', !empty($CFG->grade_report_user_showlettergrade));
$this->showaverage = grade_get_setting($this->courseid, 'report_user_showaverage', !empty($CFG->grade_report_user_showaverage));
@ -1018,9 +1023,9 @@ function grade_report_user_settings_definition(&$mform) {
$mform->addElement('select', 'report_user_showfeedback', get_string('showfeedback', 'grades'), $options);
if (empty($CFG->grade_report_user_showweight)) {
$options[-1] = get_string('defaultprev', 'grades', $options[0]);
} else {
$options[-1] = get_string('defaultprev', 'grades', $options[1]);
} else {
$options[-1] = get_string('defaultprev', 'grades', $options[0]);
}
$mform->addElement('select', 'report_user_showweight', get_string('showweight', 'grades'), $options);
@ -1042,7 +1047,7 @@ function grade_report_user_settings_definition(&$mform) {
$mform->addElement('select', 'report_user_showlettergrade', get_string('showlettergrade', 'grades'), $options);
if (empty($CFG->grade_report_user_showcontributiontocoursetotal)) {
$options[-1] = get_string('defaultprev', 'grades', $options[0]);
$options[-1] = get_string('defaultprev', 'grades', $options[1]);
} else {
$options[-1] = get_string('defaultprev', 'grades', $options[$CFG->grade_report_user_showcontributiontocoursetotal]);
}

View File

@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014051200; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2014101400; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2014050800; // Requires this Moodle version
$plugin->component = 'gradereport_user'; // Full name of the plugin (used for diagnostics)