mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Merge branch 'MDL-47349-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
3dc7afc186
@ -113,7 +113,7 @@ class grade_edit_tree {
|
||||
|
||||
$object = $element['object'];
|
||||
$eid = $element['eid'];
|
||||
$object->name = $this->gtree->get_element_header($element, true, true, true, true);
|
||||
$object->name = $this->gtree->get_element_header($element, true, true, true, true, true);
|
||||
$object->stripped_name = $this->gtree->get_element_header($element, false, false, false);
|
||||
|
||||
$is_category_item = false;
|
||||
|
@ -1334,17 +1334,20 @@ class grade_structure {
|
||||
* @param bool $icon Whether or not to display an icon with this header
|
||||
* @param bool $spacerifnone return spacer if no icon found
|
||||
* @param bool $withdescription Show description if defined by this item.
|
||||
* @param bool $fulltotal If the item is a category total, returns $categoryname."total"
|
||||
* instead of "Category total" or "Course total"
|
||||
*
|
||||
* @return string header
|
||||
*/
|
||||
public function get_element_header(&$element, $withlink=false, $icon=true, $spacerifnone=false, $withdescription=false) {
|
||||
public function get_element_header(&$element, $withlink = false, $icon = true, $spacerifnone = false,
|
||||
$withdescription = false, $fulltotal = false) {
|
||||
$header = '';
|
||||
|
||||
if ($icon) {
|
||||
$header .= $this->get_element_icon($element, $spacerifnone);
|
||||
}
|
||||
|
||||
$header .= $element['object']->get_name();
|
||||
$header .= $element['object']->get_name($fulltotal);
|
||||
|
||||
if ($element['type'] != 'item' and $element['type'] != 'categoryitem' and
|
||||
$element['type'] != 'courseitem') {
|
||||
|
@ -816,7 +816,7 @@ class grade_report_grader extends grade_report {
|
||||
$arrow = $this->get_sort_arrow('move', $sortlink);
|
||||
}
|
||||
|
||||
$headerlink = $this->gtree->get_element_header($element, true, $showactivityicons, false);
|
||||
$headerlink = $this->gtree->get_element_header($element, true, $showactivityicons, false, false, true);
|
||||
|
||||
$itemcell = new html_table_cell();
|
||||
$itemcell->attributes['class'] = $type . ' ' . $catlevel . ' highlightable'. ' i'. $element['object']->id;
|
||||
|
@ -192,7 +192,7 @@ class user extends tablelike implements selectable_items {
|
||||
$gradetreeitem['object'] = $item;
|
||||
$gradetreeitem['userid'] = $this->item->id;
|
||||
|
||||
$itemlabel = $this->structure->get_element_header($gradetreeitem, true, false);
|
||||
$itemlabel = $this->structure->get_element_header($gradetreeitem, true, false, false, false, true);
|
||||
$grade->label = $item->get_name();
|
||||
|
||||
$line = array(
|
||||
|
@ -385,7 +385,7 @@ class grade_report_user extends grade_report {
|
||||
$grade_object = $element['object'];
|
||||
$eid = $grade_object->id;
|
||||
$element['userid'] = $this->user->id;
|
||||
$fullname = $this->gtree->get_element_header($element, true, true, true, true);
|
||||
$fullname = $this->gtree->get_element_header($element, true, true, true, true, true);
|
||||
$data = array();
|
||||
$hidden = '';
|
||||
$excluded = '';
|
||||
|
@ -225,7 +225,7 @@ Feature: We can understand the gradebook user report
|
||||
| Test assignment four | 33.33 % | 10.00 | 1.11 % |
|
||||
| Test assignment five | 33.33 % | 70.00 | 7.78 % |
|
||||
| Test assignment six | 33.33 % | 30.00 | 3.33 % |
|
||||
| Category totalWeighted mean of grades. | 33.33 % | 36.67 | - |
|
||||
| Sub category totalWeighted mean of grades. | 33.33 % | 36.67 | - |
|
||||
| Course total | - | 156.67 | - |
|
||||
|
||||
@javascript
|
||||
@ -244,5 +244,5 @@ Feature: We can understand the gradebook user report
|
||||
| Test assignment four | 33.33 % | 10.00 | 2.00 % |
|
||||
| Test assignment five | 33.33 % | 70.00 | 14.00 % |
|
||||
| Test assignment six | 33.33 % | 30.00 | 6.00 % |
|
||||
| Category total | 60.00 % | 110.00 | - |
|
||||
| Sub category total | 60.00 % | 110.00 | - |
|
||||
| Course total | - | 230.00 | - |
|
||||
|
@ -90,13 +90,13 @@ Feature: View gradebook when scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage | Contribution to course total |
|
||||
| Test assignment one | C | F–A | 50.00 % | 60.00 % |
|
||||
| Category total | 3.00 | 0–5 | 60.00 % | - |
|
||||
| Sub category 1 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 |
|
||||
| Category total | 5.00 |
|
||||
| Sub category 1 total | 5.00 |
|
||||
| Course total | 5.00 |
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
@ -105,7 +105,7 @@ Feature: View gradebook when scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage | Contribution to course total |
|
||||
| Test assignment one | B | F–A | 75.00 % | 80.00 % |
|
||||
| Category total | 4.00 | 0–5 | 80.00 % | - |
|
||||
| Sub category 1 total | 4.00 | 0–5 | 80.00 % | - |
|
||||
| Course total | 4.00 | 0–5 | 80.00 % | - |
|
||||
|
||||
@javascript
|
||||
@ -138,13 +138,13 @@ Feature: View gradebook when scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage | Contribution to course total |
|
||||
| Test assignment one | C | F–A | 50.00 % | <contrib3> |
|
||||
| Category total<aggregation>. | 3.00 | 1–5 | 50.00 % | - |
|
||||
| Sub category (<aggregation>) total<aggregation>. | 3.00 | 1–5 | 50.00 % | - |
|
||||
| Course total<aggregation>. | <coursetotal3> | 0–100 | <courseperc3> | - |
|
||||
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<aggregation>. | |
|
||||
| Sub category (<aggregation>) total<aggregation>. | |
|
||||
| Course total<aggregation>. | |
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
@ -153,7 +153,7 @@ Feature: View gradebook when scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Percentage | Contribution to course total |
|
||||
| Test assignment one | B | F–A | 75.00 % | <contrib2> |
|
||||
| Category total<aggregation>. | 4.00 | 1–5 | 75.00 % | - |
|
||||
| Sub category (<aggregation>) total<aggregation>. | 4.00 | 1–5 | 75.00 % | - |
|
||||
| Course total<aggregation>. | <coursetotal2> | 0–100 | <courseperc2> | - |
|
||||
|
||||
Examples:
|
||||
|
@ -71,19 +71,19 @@ Feature: View gradebook when single item scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Contribution to course total |
|
||||
| Test assignment one | Ace! | Ace!–Ace! | 100.00 % |
|
||||
| Category total | 1.00 | 0–1 | - |
|
||||
| Sub category 1 total | 1.00 | 0–1 | - |
|
||||
| Course total | 1.00 | 0–1 | - |
|
||||
And I set the field "Select all or one user" to "Student 2"
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Contribution to course total |
|
||||
| Test assignment one | - | Ace!–Ace! | - |
|
||||
| Category total | - | 0–1 | - |
|
||||
| Sub category 1 total | - | 0–1 | - |
|
||||
| Course total | - | 0–1 | - |
|
||||
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 | 1.00 |
|
||||
| Category total | 1.00 |
|
||||
| Sub category 1 total | 1.00 |
|
||||
| Course total | 1.00 |
|
||||
|
||||
@javascript
|
||||
@ -113,13 +113,13 @@ Feature: View gradebook when single item scales are used
|
||||
And the following should exist in the "user-grade" table:
|
||||
| Grade item | Grade | Range | Contribution to course total |
|
||||
| Test assignment one | Ace! | Ace!–Ace! | <contrib1> |
|
||||
| Category total<aggregation>. | <cattotal1> | 0–100 | - |
|
||||
| Sub category (<aggregation>) total<aggregation>. | <cattotal1> | 0–100 | - |
|
||||
| Course total<aggregation>. | <coursetotal1> | 0–100 | - |
|
||||
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 | Ace! (1) |
|
||||
| Category total<aggregation>. | 100.00 |
|
||||
| Sub category (<aggregation>) total<aggregation>. | 100.00 |
|
||||
| Course total<aggregation>. | 100.00 |
|
||||
|
||||
Examples:
|
||||
|
Loading…
x
Reference in New Issue
Block a user