mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'wip-MDL-47543-master' of git://github.com/marinaglancy/moodle
Conflicts: theme/bootstrapbase/less/moodle/grade.less theme/bootstrapbase/style/moodle.css
This commit is contained in:
commit
66689366a0
@ -244,7 +244,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
}
|
||||
}
|
||||
|
||||
print_grade_page_head($courseid, 'settings', 'setup', get_string('setupgradeslayout', 'grades'));
|
||||
print_grade_page_head($courseid, 'settings', 'setup', get_string('categoriesanditems', 'grades'));
|
||||
|
||||
// Print Table of categories and items
|
||||
echo $OUTPUT->box_start('gradetreebox generalbox');
|
||||
|
@ -44,9 +44,6 @@ class grade_edit_tree {
|
||||
|
||||
public $uses_weight = false;
|
||||
|
||||
/** @var bool indicates if tree has categories with aggregation method other than Natural. */
|
||||
protected $uses_non_natural = false;
|
||||
|
||||
public $table;
|
||||
|
||||
public $categories = array();
|
||||
@ -73,10 +70,6 @@ class grade_edit_tree {
|
||||
|
||||
$this->columns = array(grade_edit_tree_column::factory('name', array('deepest_level' => $this->deepest_level)));
|
||||
|
||||
if ($this->uses_non_natural) {
|
||||
$this->columns[] = grade_edit_tree_column::factory('aggregation', array('flag' => true));
|
||||
}
|
||||
|
||||
if ($this->uses_weight) {
|
||||
$this->columns[] = grade_edit_tree_column::factory('weight', array('adv' => 'weight'));
|
||||
}
|
||||
@ -120,7 +113,7 @@ class grade_edit_tree {
|
||||
|
||||
$object = $element['object'];
|
||||
$eid = $element['eid'];
|
||||
$object->name = $this->gtree->get_element_header($element, true, true, false);
|
||||
$object->name = $this->gtree->get_element_header($element, true, true, true, true);
|
||||
$object->stripped_name = $this->gtree->get_element_header($element, false, false, false);
|
||||
|
||||
$is_category_item = false;
|
||||
@ -523,10 +516,6 @@ class grade_edit_tree {
|
||||
$level++;
|
||||
$coefstring = $element['object']->get_coefstring();
|
||||
if ($element['type'] == 'category') {
|
||||
if ($element['object']->aggregation != GRADE_AGGREGATE_SUM) {
|
||||
$this->uses_non_natural = true;
|
||||
}
|
||||
|
||||
if ($coefstring == 'aggregationcoefweight' || $coefstring == 'aggregationcoefextraweightsum' ||
|
||||
$coefstring == 'aggregationcoefextraweight') {
|
||||
$this->uses_weight = true;
|
||||
@ -680,47 +669,6 @@ class grade_edit_tree_column_name extends grade_edit_tree_column {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class grade_edit_tree_column_aggregation
|
||||
*
|
||||
* @package core_grades
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class grade_edit_tree_column_aggregation extends grade_edit_tree_column {
|
||||
|
||||
public function __construct($params) {
|
||||
parent::__construct('aggregation');
|
||||
}
|
||||
|
||||
public function get_header_cell() {
|
||||
global $OUTPUT;
|
||||
$headercell = clone($this->headercell);
|
||||
$headercell->text = get_string('aggregation', 'grades').$OUTPUT->help_icon('aggregation', 'grades');
|
||||
return $headercell;
|
||||
}
|
||||
|
||||
public function get_category_cell($category, $levelclass, $params) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (empty($params['id'])) {
|
||||
throw new Exception('Array key (id) missing from 3rd param of grade_edit_tree_column_aggregation::get_category_cell($category, $levelclass, $params)');
|
||||
}
|
||||
|
||||
$options = grade_helper::get_aggregation_strings();
|
||||
$aggregation = $options[$category->aggregation];
|
||||
|
||||
$categorycell = parent::get_category_cell($category, $levelclass, $params);
|
||||
$categorycell->text = $aggregation;
|
||||
return $categorycell;
|
||||
|
||||
}
|
||||
|
||||
public function get_item_cell($item, $params) {
|
||||
$itemcell = parent::get_item_cell($item, $params);
|
||||
$itemcell->text = ' - ';
|
||||
return $itemcell;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class grade_edit_tree_column_weight
|
||||
*
|
||||
|
@ -651,6 +651,10 @@ function grade_get_plugin_info($courseid, $active_type, $active_plugin) {
|
||||
$plugin_info['report'] = $reports;
|
||||
}
|
||||
|
||||
if ($settings = grade_helper::get_info_manage_settings($courseid)) {
|
||||
$plugin_info['settings'] = $settings;
|
||||
}
|
||||
|
||||
if ($scale = grade_helper::get_info_scales($courseid)) {
|
||||
$plugin_info['scale'] = array('view'=>$scale);
|
||||
}
|
||||
@ -685,16 +689,6 @@ function grade_get_plugin_info($courseid, $active_type, $active_plugin) {
|
||||
}
|
||||
}
|
||||
|
||||
// Hide course settings if we're not in a course
|
||||
if ($settings = grade_helper::get_info_manage_settings($courseid)) {
|
||||
$plugin_info['settings'] = $settings;
|
||||
}
|
||||
|
||||
// Put preferences last
|
||||
if ($preferences = grade_helper::get_plugins_report_preferences($courseid)) {
|
||||
$plugin_info['preferences'] = $preferences;
|
||||
}
|
||||
|
||||
foreach ($plugin_info as $plugin_type => $plugins) {
|
||||
if (!empty($plugins->id) && $active_plugin == $plugins->id) {
|
||||
$plugin_info['strings']['active_plugin_str'] = $plugins->string;
|
||||
@ -790,6 +784,11 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null,
|
||||
$buttons=false, $shownavigation=true, $headerhelpidentifier = null, $headerhelpcomponent = null) {
|
||||
global $CFG, $OUTPUT, $PAGE;
|
||||
|
||||
if ($active_type === 'preferences') {
|
||||
// In Moodle 2.8 report preferences were moved under 'settings'. Allow backward compatibility for 3rd party grade reports.
|
||||
$active_type = 'settings';
|
||||
}
|
||||
|
||||
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
|
||||
|
||||
// Determine the string of the active plugin
|
||||
@ -2416,6 +2415,13 @@ function grade_extend_settings($plugininfo, $courseid) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($settings = grade_helper::get_info_manage_settings($courseid)) {
|
||||
$settingsnode = $gradenode->add($strings['settings'], null, navigation_node::TYPE_CONTAINER);
|
||||
foreach ($settings as $setting) {
|
||||
$settingsnode->add($setting->string, $setting->link, navigation_node::TYPE_SETTING, null, $setting->id, new pix_icon('i/settings', ''));
|
||||
}
|
||||
}
|
||||
|
||||
if ($imports = grade_helper::get_plugins_import($courseid)) {
|
||||
$importnode = $gradenode->add($strings['import'], null, navigation_node::TYPE_CONTAINER);
|
||||
foreach ($imports as $import) {
|
||||
@ -2430,20 +2436,6 @@ function grade_extend_settings($plugininfo, $courseid) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($settings = grade_helper::get_info_manage_settings($courseid)) {
|
||||
$settingsnode = $gradenode->add($strings['settings'], null, navigation_node::TYPE_CONTAINER);
|
||||
foreach ($settings as $setting) {
|
||||
$settingsnode->add($setting->string, $setting->link, navigation_node::TYPE_SETTING, null, $setting->id, new pix_icon('i/settings', ''));
|
||||
}
|
||||
}
|
||||
|
||||
if ($preferences = grade_helper::get_plugins_report_preferences($courseid)) {
|
||||
$preferencesnode = $gradenode->add(get_string('myreportpreferences', 'grades'), null, navigation_node::TYPE_CONTAINER);
|
||||
foreach ($preferences as $preference) {
|
||||
$preferencesnode->add($preference->string, $preference->link, navigation_node::TYPE_SETTING, null, $preference->id, new pix_icon('i/settings', ''));
|
||||
}
|
||||
}
|
||||
|
||||
if ($letters = grade_helper::get_info_letters($courseid)) {
|
||||
$letters = array_shift($letters);
|
||||
$gradenode->add($strings['letter'], $letters->link, navigation_node::TYPE_SETTING, null, $letters->id, new pix_icon('i/settings', ''));
|
||||
@ -2556,8 +2548,7 @@ abstract class grade_helper {
|
||||
'letter' => get_string('letters', 'grades'),
|
||||
'export' => get_string('export', 'grades'),
|
||||
'import' => get_string('import'),
|
||||
'preferences' => get_string('mypreferences', 'grades'),
|
||||
'settings' => get_string('settings')
|
||||
'settings' => get_string('edittree', 'grades')
|
||||
);
|
||||
}
|
||||
return self::$pluginstrings;
|
||||
@ -2598,12 +2589,18 @@ abstract class grade_helper {
|
||||
$context = context_course::instance($courseid);
|
||||
self::$managesetting = array();
|
||||
if ($courseid != SITEID && has_capability('moodle/grade:manage', $context)) {
|
||||
self::$managesetting['categoriesanditems'] = new grade_plugin_info('setup',
|
||||
new moodle_url('/grade/edit/tree/index.php', array('id' => $courseid)),
|
||||
get_string('categoriesanditems', 'grades'));
|
||||
self::$managesetting['coursesettings'] = new grade_plugin_info('coursesettings',
|
||||
new moodle_url('/grade/edit/settings/index.php', array('id'=>$courseid)),
|
||||
get_string('coursegradesettings', 'grades'));
|
||||
self::$managesetting['setup'] = new grade_plugin_info('setup',
|
||||
new moodle_url('/grade/edit/tree/index.php', array('id' => $courseid)),
|
||||
get_string('setupgradeslayout', 'grades'));
|
||||
}
|
||||
if (self::$gradereportpreferences === null) {
|
||||
self::get_plugins_reports($courseid);
|
||||
}
|
||||
if (self::$gradereportpreferences) {
|
||||
self::$managesetting = array_merge(self::$managesetting, self::$gradereportpreferences);
|
||||
}
|
||||
return self::$managesetting;
|
||||
}
|
||||
@ -2640,7 +2637,8 @@ abstract class grade_helper {
|
||||
// Add link to preferences tab if such a page exists
|
||||
if (file_exists($plugindir.'/preferences.php')) {
|
||||
$url = new moodle_url('/grade/report/'.$plugin.'/preferences.php', array('id'=>$courseid));
|
||||
$gradepreferences[$plugin] = new grade_plugin_info($plugin, $url, $pluginstr);
|
||||
$gradepreferences[$plugin] = new grade_plugin_info($plugin, $url,
|
||||
get_string('mypreferences', 'grades') . ': ' . $pluginstr);
|
||||
}
|
||||
}
|
||||
if (count($gradereports) == 0) {
|
||||
@ -2657,19 +2655,7 @@ abstract class grade_helper {
|
||||
self::$gradereportpreferences = $gradepreferences;
|
||||
return self::$gradereports;
|
||||
}
|
||||
/**
|
||||
* Returns an array of grade plugin report preferences for plugin reports that
|
||||
* support preferences
|
||||
* @param int $courseid
|
||||
* @return array
|
||||
*/
|
||||
public static function get_plugins_report_preferences($courseid) {
|
||||
if (self::$gradereportpreferences !== null) {
|
||||
return self::$gradereportpreferences;
|
||||
}
|
||||
self::get_plugins_reports($courseid);
|
||||
return self::$gradereportpreferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get information on scales
|
||||
* @param int $courseid
|
||||
|
@ -69,7 +69,7 @@ if ($mform->is_cancelled()){
|
||||
redirect($CFG->wwwroot . '/grade/report/grader/index.php?id='.$courseid);
|
||||
}
|
||||
|
||||
print_grade_page_head($courseid, 'preferences', 'grader', get_string('preferences', 'gradereport_grader'));
|
||||
print_grade_page_head($courseid, 'settings', 'grader', get_string('preferences', 'gradereport_grader'));
|
||||
|
||||
// If USER has admin capability, print a link to the site config page for this report
|
||||
if (has_capability('moodle/site:config', $systemcontext)) {
|
||||
|
@ -58,7 +58,7 @@ Feature: We can use calculated grade totals
|
||||
| Hidden | 1 |
|
||||
And I set the following settings for grade item "Test assignment eight":
|
||||
| Hidden | 1 |
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Grade display type" to "Real (percentage)"
|
||||
And I press "Save changes"
|
||||
|
||||
@ -73,7 +73,7 @@ Feature: We can use calculated grade totals
|
||||
| Exclude empty grades | 0 |
|
||||
And I turn editing mode off
|
||||
Then I should see "30.00 (30.00 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -98,7 +98,7 @@ Feature: We can use calculated grade totals
|
||||
| Item weight | 3 |
|
||||
And I turn editing mode off
|
||||
Then I should see "27.14 (27.14 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -121,7 +121,7 @@ Feature: We can use calculated grade totals
|
||||
| Extra credit | 1 |
|
||||
And I turn editing mode off
|
||||
Then I should see "45.19 (45.19 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -144,7 +144,7 @@ Feature: We can use calculated grade totals
|
||||
| Extra credit weight | 2 |
|
||||
And I turn editing mode off
|
||||
Then I should see "42.50 (42.50 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -165,7 +165,7 @@ Feature: We can use calculated grade totals
|
||||
| Exclude empty grades | 0 |
|
||||
And I turn editing mode off
|
||||
Then I should see "26.67 (26.67 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -190,7 +190,7 @@ Feature: We can use calculated grade totals
|
||||
| Hidden | 1 |
|
||||
And I turn editing mode off
|
||||
Then I should see "0.00 (0.00 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -213,7 +213,7 @@ Feature: We can use calculated grade totals
|
||||
| Hidden | 1 |
|
||||
And I turn editing mode off
|
||||
Then I should see "50.00 (50.00 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -236,7 +236,7 @@ Feature: We can use calculated grade totals
|
||||
| Hidden | 1 |
|
||||
And I turn editing mode off
|
||||
Then I should see "50.00 (50.00 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
@ -264,7 +264,7 @@ Feature: We can use calculated grade totals
|
||||
| Extra credit | 1 |
|
||||
And I turn editing mode off
|
||||
Then I should see "152.68 (24.43 %)" in the ".course" "css_element"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
|
||||
And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
|
||||
And I set the field "Show contribution to course total" to "Show"
|
||||
@ -317,7 +317,7 @@ Feature: We can use calculated grade totals
|
||||
And I set the following settings for grade item "Course 1":
|
||||
| Aggregation | Natural |
|
||||
| Exclude empty grades | 0 |
|
||||
And I navigate to "Set up grades layout" node in "Grade administration > Settings"
|
||||
And I navigate to "Categories and items" node in "Grade administration > Setup"
|
||||
And I press "Add category"
|
||||
And I click on "Show more" "link"
|
||||
And I set the following fields to these values:
|
||||
@ -372,7 +372,7 @@ Feature: We can use calculated grade totals
|
||||
And I press "Save changes"
|
||||
And I turn editing mode off
|
||||
And I should see "250.00 (25.25 %)" in the ".course" "css_element"
|
||||
And I navigate to "Set up grades layout" node in "Grade administration > Settings"
|
||||
And I navigate to "Categories and items" node in "Grade administration > Setup"
|
||||
And I press "Add category"
|
||||
And I set the following fields to these values:
|
||||
| Category name | Sub sub category 1 |
|
||||
@ -383,7 +383,7 @@ Feature: We can use calculated grade totals
|
||||
|
||||
@javascript
|
||||
Scenario: Natural aggregation from the setup screen
|
||||
And I set the field "Grade report" to "Set up grades layout"
|
||||
And I set the field "Grade report" to "Categories and items"
|
||||
And I follow "Edit Course 1"
|
||||
And I set the field "Aggregation" to "Natural"
|
||||
And I press "Save changes"
|
||||
@ -448,7 +448,7 @@ Feature: We can use calculated grade totals
|
||||
| Aggregation | Natural |
|
||||
| Exclude empty grades | 0 |
|
||||
And I turn editing mode off
|
||||
And I set the field "Grade report" to "Set up grades layout"
|
||||
And I set the field "Grade report" to "Categories and items"
|
||||
And I set the field "Override weight of Test assignment one" to "1"
|
||||
And I set the field "Weight of Test assignment one" to "0"
|
||||
And I set the field "Override weight of Test assignment six" to "1"
|
||||
@ -456,7 +456,7 @@ Feature: We can use calculated grade totals
|
||||
And I set the field "Override weight of Test assignment nine" to "1"
|
||||
And I set the field "Weight of Test assignment nine" to "100"
|
||||
And I press "Save changes"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
|
||||
And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
|
||||
And I set the field "Show contribution to course total" to "Show"
|
||||
|
@ -39,11 +39,11 @@ Feature: We can understand the gradebook user report
|
||||
And I give the grade "70.00" to the user "Student 1" for the grade item "Test assignment five"
|
||||
And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment six"
|
||||
And I press "Save changes"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Show weightings" to "Show"
|
||||
And I set the field "Show contribution to course total" to "Show"
|
||||
And I press "Save changes"
|
||||
And I set the field "Grade report" to "Set up grades layout"
|
||||
And I set the field "Grade report" to "Categories and items"
|
||||
And I press "Add category"
|
||||
And I set the field "Category name" to "Sub category"
|
||||
And I press "Save changes"
|
||||
@ -226,7 +226,7 @@ Feature: We can understand the gradebook user report
|
||||
| Test assignment five | 33.33 % | 70.00 | 23.33 |
|
||||
| Test assignment six | 33.33 % | 30.00 | 10.00 |
|
||||
| Category totalWeighted mean of grades. | 33.33 % | 36.67 | - |
|
||||
| Course totalNatural. | - | 156.67 | - |
|
||||
| Course total | - | 156.67 | - |
|
||||
|
||||
@javascript
|
||||
Scenario: View user report with natural aggregation
|
||||
@ -244,5 +244,5 @@ Feature: We can understand the gradebook user report
|
||||
| Test assignment four | 33.33 % | 10.00 | 10.00 |
|
||||
| Test assignment five | 33.33 % | 70.00 | 70.00 |
|
||||
| Test assignment six | 33.33 % | 30.00 | 30.00 |
|
||||
| Category totalNatural. | 60.00 % | 110.00 | - |
|
||||
| Course totalNatural. | - | 230.00 | - |
|
||||
| Category total | 60.00 % | 110.00 | - |
|
||||
| Course total | - | 230.00 | - |
|
||||
|
@ -28,7 +28,7 @@ Feature: We can use a minimum grade different than zero
|
||||
And I am on homepage
|
||||
And I follow "Course 1"
|
||||
And I follow "Grades"
|
||||
And I navigate to "Set up grades layout" node in "Grade administration > Settings"
|
||||
And I navigate to "Categories and items" node in "Grade administration > Setup"
|
||||
And I press "Add grade item"
|
||||
And I set the following fields to these values:
|
||||
| Item name | Manual item 1 |
|
||||
@ -66,14 +66,14 @@ Feature: We can use a minimum grade different than zero
|
||||
| Minimum grade | 50 |
|
||||
| Grade category | Sub category 2 |
|
||||
And I press "Save changes"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the field "Show weightings" to "Show"
|
||||
And I set the field "Show contribution to course total" to "Show"
|
||||
And I press "Save changes"
|
||||
|
||||
@javascript
|
||||
Scenario: Natural aggregation with negative and positive grade
|
||||
And I navigate to "Set up grades layout" node in "Grade administration > Settings"
|
||||
And I navigate to "Categories and items" node in "Grade administration > Setup"
|
||||
And I set the following settings for grade item "Sub category 1":
|
||||
| Aggregation | Natural |
|
||||
| Exclude empty grades | 0 |
|
||||
|
@ -33,7 +33,7 @@ Feature: We can use natural aggregation and weights will be normalised to a tota
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Grades"
|
||||
And I set the field "Grade report" to "Set up grades layout"
|
||||
And I set the field "Grade report" to "Categories and items"
|
||||
|
||||
@javascript
|
||||
Scenario: Setting all weights in a category to exactly one hundred in total.
|
||||
|
@ -85,9 +85,9 @@ Feature: View gradebook when scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage |
|
||||
| Test assignment one | C | F–A | 50.00 % |
|
||||
| Category totalNatural. | 3.00 | 0–5 | 60.00 % |
|
||||
| Course totalNatural. | 3.00 | 0–5 | 60.00 % |
|
||||
And I set the field "jump" to "Set up grades layout"
|
||||
| Category total | 3.00 | 0–5 | 60.00 % |
|
||||
| Course total | 3.00 | 0–5 | 60.00 % |
|
||||
And I set the field "jump" to "Categories and items"
|
||||
And the following should exist in the "grade_edit_tree_table" table:
|
||||
| Name | Max grade |
|
||||
| Test assignment one | 5.00 |
|
||||
@ -100,8 +100,8 @@ Feature: View gradebook when scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage |
|
||||
| Test assignment one | B | F–A | 75.00 % |
|
||||
| Category totalNatural. | 4.00 | 0–5 | 80.00 % |
|
||||
| Course totalNatural. | 4.00 | 0–5 | 80.00 % |
|
||||
| Category total | 4.00 | 0–5 | 80.00 % |
|
||||
| Course total | 4.00 | 0–5 | 80.00 % |
|
||||
|
||||
@javascript
|
||||
Scenario Outline: Test displaying scales in gradebook in all other aggregation methods
|
||||
@ -135,12 +135,12 @@ Feature: View gradebook when scales are used
|
||||
| Test assignment one | C | F–A | 50.00 % |
|
||||
| Category total<aggregation>. | 3.00 | 1–5 | 50.00 % |
|
||||
| Course total<aggregation>. | <coursetotal3> | 0–100 | <courseperc3> |
|
||||
And I set the field "jump" to "Set up grades layout"
|
||||
And I set the field "jump" to "Categories and items"
|
||||
And the following should exist in the "grade_edit_tree_table" table:
|
||||
| Name | Max grade |
|
||||
| Test assignment one | A (5) |
|
||||
| Category total | |
|
||||
| Course total | |
|
||||
| Category total<aggregation>. | |
|
||||
| Course total<aggregation>. | |
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I follow "Course 1"
|
||||
|
@ -72,23 +72,23 @@ Feature: We can enter in grades and view reports from the gradebook
|
||||
| Grade item | Grade | Range | Percentage |
|
||||
| Test assignment name 1 | 80.00 | 0–100 | 80.00 % |
|
||||
| Test assignment name 2 | 90.00 | 0–100 | 90.00 % |
|
||||
| Course totalNatural. | 170.00 | 0–200 | 85.00 % |
|
||||
| Course total | 170.00 | 0–200 | 85.00 % |
|
||||
And the following should not exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage |
|
||||
| Course totalNatural. | 90.00 | 0–100 | 90.00 % |
|
||||
| Course total | 90.00 | 0–100 | 90.00 % |
|
||||
And I set the field "Grade report" to "Overview report"
|
||||
And "C1" row "Grade" column of "overview-grade" table should contain "170.00"
|
||||
And "C1" row "Grade" column of "overview-grade" table should not contain "90.00"
|
||||
|
||||
@javascript
|
||||
Scenario: We can add a weighting to a grade item and it is displayed properly in the user report
|
||||
When I set the field "Grade report" to "Set up grades layout"
|
||||
When I set the field "Grade report" to "Categories and items"
|
||||
And I set the following settings for grade item "Course 1":
|
||||
| Aggregation | Weighted mean of grades |
|
||||
And I set the field "Extra credit value for Test assignment name" to "0.72"
|
||||
And I press "Save changes"
|
||||
And I set the field "Grade report" to "User report"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Settings"
|
||||
And I navigate to "Course grade settings" node in "Grade administration > Setup"
|
||||
And I set the following fields to these values:
|
||||
| Show weightings | Show |
|
||||
And I press "Save changes"
|
||||
|
@ -4,8 +4,6 @@ hidden,core_portfolio
|
||||
hidden,core_question
|
||||
hidden,core_repository
|
||||
hidden,core_role
|
||||
categoriesanditems,core_grades
|
||||
simpleview,core_grades
|
||||
fullview,core_grades
|
||||
categoriesedit,core_grades
|
||||
edittree,core_grades
|
||||
|
@ -116,6 +116,7 @@ $string['calculationsaved'] = 'Calculation saved';
|
||||
$string['calculationview'] = 'View calculation';
|
||||
$string['cannotaccessgroup'] = 'Can not access grades of selected group, sorry.';
|
||||
$string['categories'] = 'Categories';
|
||||
$string['categoriesanditems'] = 'Categories and items';
|
||||
$string['category'] = 'Category';
|
||||
$string['categoryedit'] = 'Edit category';
|
||||
$string['categoryname'] = 'Category name';
|
||||
@ -173,6 +174,7 @@ $string['editgradeletters'] = 'Edit grade letters';
|
||||
$string['editoutcome'] = 'Edit outcome';
|
||||
$string['editoutcomes'] = 'Edit outcomes';
|
||||
$string['editscale'] = 'Edit scale';
|
||||
$string['edittree'] = 'Setup';
|
||||
$string['editverbose'] = 'Edit {$a->category} {$a->itemmodule} {$a->itemname}';
|
||||
$string['enableajax'] = 'Enable AJAX';
|
||||
$string['enableajax_help'] = '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.';
|
||||
@ -593,7 +595,6 @@ $string['setgradeletters'] = 'Set grade letters';
|
||||
$string['setpreferences'] = 'Set preferences';
|
||||
$string['setting'] = 'Setting';
|
||||
$string['settings'] = 'Settings';
|
||||
$string['setupgradeslayout'] = 'Set up grades layout';
|
||||
$string['setweights'] = 'Set weights';
|
||||
$string['showanalysisicon'] = 'Show grade analysis icon';
|
||||
$string['showanalysisicon_desc'] = 'Whether to show grade analysis icon by default. If the activity module supports it, the grade analysis icon links to a page with more detailed explanation of the grade and how it was obtained.';
|
||||
@ -739,8 +740,6 @@ $string['yourgrade'] = 'Your grade';
|
||||
|
||||
// Deprecated since Moodle 2.8
|
||||
|
||||
$string['categoriesanditems'] = 'Setup';
|
||||
$string['categoriesedit'] = 'Edit setup';
|
||||
$string['edittree'] = 'Setup';
|
||||
$string['fullview'] = 'Full view';
|
||||
$string['simpleview'] = 'Simple view';
|
||||
|
@ -90,7 +90,7 @@ class grade_category extends grade_object {
|
||||
* A constant pointing to one of the predefined aggregation strategies (none, mean, median, sum etc) .
|
||||
* @var int $aggregation
|
||||
*/
|
||||
public $aggregation = GRADE_AGGREGATE_MEAN;
|
||||
public $aggregation = GRADE_AGGREGATE_SUM;
|
||||
|
||||
/**
|
||||
* Keep only the X highest items.
|
||||
@ -1980,8 +1980,10 @@ class grade_category extends grade_object {
|
||||
*/
|
||||
public function get_description() {
|
||||
$allhelp = array();
|
||||
$aggrstrings = grade_helper::get_aggregation_strings();
|
||||
$allhelp[] = $aggrstrings[$this->aggregation];
|
||||
if ($this->aggregation != GRADE_AGGREGATE_SUM) {
|
||||
$aggrstrings = grade_helper::get_aggregation_strings();
|
||||
$allhelp[] = $aggrstrings[$this->aggregation];
|
||||
}
|
||||
|
||||
if ($this->droplow && $this->can_apply_limit_rules()) {
|
||||
$allhelp[] = get_string('droplowestvalues', 'grades', $this->droplow);
|
||||
@ -1995,7 +1997,10 @@ class grade_category extends grade_object {
|
||||
if ($this->aggregatesubcats) {
|
||||
$allhelp[] = get_string('aggregatesubcatsshort', 'grades');
|
||||
}
|
||||
return implode('. ', $allhelp) . '.';
|
||||
if ($allhelp) {
|
||||
return implode('. ', $allhelp) . '.';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,12 +49,12 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all
|
||||
| Feedback for the response 'False'. | So you think it is false |
|
||||
And I follow "Course 1"
|
||||
And I follow "Grades"
|
||||
And I navigate to "Set up grades layout" node in "Grade administration > Settings"
|
||||
And I navigate to "Categories and items" node in "Grade administration > Setup"
|
||||
And I follow "Edit quiz Test quiz name"
|
||||
Then I should see "Edit grade item"
|
||||
And I set the field "gradepass" to "5"
|
||||
And I press "Save changes"
|
||||
And I should see "Set up grades layout"
|
||||
And I should see "Categories and items"
|
||||
Then I log out
|
||||
|
||||
And I log in as "student1"
|
||||
|
@ -48,13 +48,13 @@ Feature: Set a quiz to be marked complete when the student passes
|
||||
| Feedback for the response 'False'. | So you think it is false |
|
||||
And I follow "Course 1"
|
||||
And I follow "Grades"
|
||||
And I set the field "jump" to "Set up grades layout"
|
||||
And I set the field "jump" to "Categories and items"
|
||||
And I press "Go"
|
||||
And I follow "Edit quiz Test quiz name"
|
||||
Then I should see "Edit grade item"
|
||||
And I set the field "gradepass" to "5"
|
||||
And I press "Save changes"
|
||||
Then I should see "Set up grades layout"
|
||||
Then I should see "Categories and items"
|
||||
And I log out
|
||||
|
||||
And I log in as "student1"
|
||||
|
@ -76,3 +76,12 @@
|
||||
.path-grade-edit-tree table.setup-grades .column-select {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.path-grade-edit-tree table.setup-grades .column-weight {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.path-grade-edit-tree table.setup-grades .gradeitemdescription {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
@ -235,6 +235,15 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.path-grade-edit-tree table.setup-grades .column-weight {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.path-grade-edit-tree table.setup-grades .gradeitemdescription {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grader report.
|
||||
*/
|
||||
@ -253,4 +262,4 @@
|
||||
background-color: @tableBackgroundAccent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user