[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/grade/tests/behat/ -> grade_aggregation.feature (source)

   1  @core @core_grades
   2  Feature: We can use calculated grade totals
   3    In order to calculate grade totals
   4    As an teacher
   5    I need to add aggregate columns to the gradebook
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category | groupmode |
  10        | Course 1 | C1 | 0 | 1 |
  11      And the following "users" exist:
  12        | username | firstname | lastname | email | idnumber |
  13        | teacher1 | Teacher | 1 | [email protected] | t1 |
  14        | student1 | Student | 1 | [email protected] | s1 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And the following "grade categories" exist:
  20        | fullname | course |
  21        | Sub category 1 | C1 |
  22        | Sub category 2 | C1 |
  23      And the following "activities" exist:
  24        | activity | course | idnumber | name | intro | grade |
  25        | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
  26        | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
  27        | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
  28        | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
  29      And the following "activities" exist:
  30        | activity | course | idnumber | name | intro | gradecategory | grade |
  31        | assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 20 |
  32        | assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 10 |
  33        | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 |
  34      And the following "activities" exist:
  35        | activity | course | idnumber | name | intro | gradecategory | grade |
  36        | assign | C1 | a8 | Test assignment eight | Submit something! | Sub category 2 | 20 |
  37        | assign | C1 | a9 | Test assignment nine | Submit something! | Sub category 2 | 10 |
  38        | assign | C1 | 10 | Test assignment ten | Submit nothing! | Sub category 2 | 15 |
  39      And I log in as "admin"
  40      And I set the following administration settings values:
  41        | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
  42      And I log out
  43      And I log in as "teacher1"
  44      And I follow "Course 1"
  45      And I follow "Grades"
  46      And I turn editing mode on
  47      And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one"
  48      And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two"
  49      And I give the grade "40.00" to the user "Student 1" for the grade item "Test assignment three"
  50      And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment five"
  51      And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment six"
  52      And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment eight"
  53      And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment nine"
  54      And I press "Save changes"
  55      And I set the following settings for grade item "Test assignment two":
  56        | Hidden | 1 |
  57      And I set the following settings for grade item "Test assignment five":
  58        | Hidden | 1 |
  59      And I set the following settings for grade item "Test assignment eight":
  60        | Hidden | 1 |
  61      And I navigate to "Course grade settings" node in "Grade administration > Setup"
  62      And I set the field "Grade display type" to "Real (percentage)"
  63      And I press "Save changes"
  64  
  65    @javascript
  66    Scenario: Mean of grades aggregation
  67      And I set the following settings for grade item "Course 1":
  68        | Aggregation          | Mean of grades |
  69      And I set the following settings for grade item "Sub category 1":
  70        | Aggregation          | Mean of grades |
  71      And I set the following settings for grade item "Sub category 2":
  72        | Aggregation          | Mean of grades |
  73        | Exclude empty grades | 0              |
  74      And I turn editing mode off
  75      Then I should see "30.00 (30.00 %)" in the ".course" "css_element"
  76      And I navigate to "Course grade settings" node in "Grade administration > Setup"
  77      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
  78      And I press "Save changes"
  79      And I log out
  80      And I log in as "student1"
  81      And I follow "Course 1"
  82      And I follow "Grades"
  83      And I set the field "Grade report" to "Overview report"
  84      And I should see "30.42 (30.42 %)" in the "overview-grade" "table"
  85  
  86    @javascript
  87    Scenario: Weighted mean of grades aggregation
  88      And I set the following settings for grade item "Course 1":
  89        | Aggregation          | Weighted mean of grades |
  90      And I set the following settings for grade item "Sub category 1":
  91        | Aggregation          | Weighted mean of grades |
  92        | Item weight          | 1                       |
  93      And I set the following settings for grade item "Sub category 2":
  94        | Aggregation          | Weighted mean of grades |
  95        | Item weight          | 1                       |
  96        | Exclude empty grades | 0                       |
  97      And I set the following settings for grade item "Test assignment one":
  98        | Item weight | 3 |
  99      And I turn editing mode off
 100      Then I should see "27.14 (27.14 %)" in the ".course" "css_element"
 101      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 102      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 103      And I press "Save changes"
 104      And I log out
 105      And I log in as "student1"
 106      And I follow "Course 1"
 107      And I follow "Grades"
 108      And I set the field "Grade report" to "Overview report"
 109      And I should see "26.94 (26.94 %)" in the "overview-grade" "table"
 110  
 111    @javascript
 112    Scenario: Simple weighted mean of grades aggregation
 113      And I set the following settings for grade item "Course 1":
 114        | Aggregation          | Simple weighted mean of grades |
 115      And I set the following settings for grade item "Sub category 1":
 116        | Aggregation          | Simple weighted mean of grades |
 117      And I set the following settings for grade item "Sub category 2":
 118        | Aggregation          | Simple weighted mean of grades |
 119        | Exclude empty grades | 0                              |
 120      And I set the following settings for grade item "Test assignment one":
 121        | Extra credit | 1 |
 122      And I turn editing mode off
 123      Then I should see "45.19 (45.19 %)" in the ".course" "css_element"
 124      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 125      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 126      And I press "Save changes"
 127      And I log out
 128      And I log in as "student1"
 129      And I follow "Course 1"
 130      And I follow "Grades"
 131      And I set the field "Grade report" to "Overview report"
 132      And I should see "48.57 (48.57 %)" in the "overview-grade" "table"
 133  
 134    @javascript
 135    Scenario: Mean of grades (with extra credits) aggregation
 136      And I set the following settings for grade item "Course 1":
 137        | Aggregation          | Mean of grades (with extra credits) |
 138      And I set the following settings for grade item "Sub category 1":
 139        | Aggregation          | Mean of grades (with extra credits) |
 140      And I set the following settings for grade item "Sub category 2":
 141        | Aggregation          | Mean of grades (with extra credits) |
 142        | Exclude empty grades | 0                                   |
 143      And I set the following settings for grade item "Test assignment one":
 144        | Extra credit weight  | 2 |
 145      And I turn editing mode off
 146      Then I should see "42.50 (42.50 %)" in the ".course" "css_element"
 147      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 148      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 149      And I press "Save changes"
 150      And I log out
 151      And I log in as "student1"
 152      And I follow "Course 1"
 153      And I follow "Grades"
 154      And I set the field "Grade report" to "Overview report"
 155      And I should see "47.22 (47.22 %)" in the "overview-grade" "table"
 156  
 157    @javascript
 158    Scenario: Median of grades aggregation
 159      And I set the following settings for grade item "Course 1":
 160        | Aggregation | Median of grades |
 161      And I set the following settings for grade item "Sub category 1":
 162        | Aggregation | Median of grades |
 163      And I set the following settings for grade item "Sub category 2":
 164        | Aggregation          | Median of grades |
 165        | Exclude empty grades | 0                |
 166      And I turn editing mode off
 167      Then I should see "26.67 (26.67 %)" in the ".course" "css_element"
 168      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 169      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 170      And I press "Save changes"
 171      And I log out
 172      And I log in as "student1"
 173      And I follow "Course 1"
 174      And I follow "Grades"
 175      And I set the field "Grade report" to "Overview report"
 176      And I should see "25.83 (25.83 %)" in the "overview-grade" "table"
 177  
 178    @javascript
 179    Scenario: Lowest grade aggregation
 180      And I set the following settings for grade item "Course 1":
 181        | Aggregation | Lowest grade |
 182      And I set the following settings for grade item "Sub category 1":
 183        | Aggregation | Lowest grade |
 184      And I set the following settings for grade item "Sub category 2":
 185        | Aggregation          | Lowest grade |
 186        | Exclude empty grades | 0            |
 187      And I set the following settings for grade item "Test assignment five":
 188        | Hidden | 1 |
 189      And I set the following settings for grade item "Test assignment four":
 190        | Hidden | 1 |
 191      And I turn editing mode off
 192      Then I should see "0.00 (0.00 %)" in the ".course" "css_element"
 193      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 194      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 195      And I press "Save changes"
 196      And I log out
 197      And I log in as "student1"
 198      And I follow "Course 1"
 199      And I follow "Grades"
 200      And I set the field "Grade report" to "Overview report"
 201      And I should see "0.00 (0.00 %)" in the "overview-grade" "table"
 202  
 203    @javascript
 204    Scenario: Highest grade aggregation
 205      And I set the following settings for grade item "Course 1":
 206        | Aggregation          | Highest grade |
 207      And I set the following settings for grade item "Sub category 1":
 208        | Aggregation          | Highest grade |
 209      And I set the following settings for grade item "Sub category 2":
 210        | Aggregation          | Highest grade |
 211        | Exclude empty grades | 0             |
 212      And I set the following settings for grade item "Test assignment one":
 213        | Hidden | 1 |
 214      And I turn editing mode off
 215      Then I should see "50.00 (50.00 %)" in the ".course" "css_element"
 216      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 217      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 218      And I press "Save changes"
 219      And I log out
 220      And I log in as "student1"
 221      And I follow "Course 1"
 222      And I follow "Grades"
 223      And I set the field "Grade report" to "Overview report"
 224      And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
 225  
 226    @javascript
 227    Scenario: Mode of grades aggregation
 228      And I set the following settings for grade item "Course 1":
 229        | Aggregation          | Mode of grades |
 230      And I set the following settings for grade item "Sub category 1":
 231        | Aggregation          | Mode of grades |
 232      And I set the following settings for grade item "Sub category 1":
 233        | Aggregation          | Mode of grades |
 234        | Exclude empty grades | 0              |
 235      And I set the following settings for grade item "Test assignment one":
 236        | Hidden | 1 |
 237      And I turn editing mode off
 238      Then I should see "50.00 (50.00 %)" in the ".course" "css_element"
 239      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 240      And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
 241      And I press "Save changes"
 242      And I log out
 243      And I log in as "student1"
 244      And I follow "Course 1"
 245      And I follow "Grades"
 246      And I set the field "Grade report" to "Overview report"
 247      And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
 248  
 249    @javascript
 250    Scenario: Natural aggregation on outcome items with natural weights
 251      And I log out
 252      And I log in as "admin"
 253      And I set the following administration settings values:
 254        | Enable outcomes | 1 |
 255      And the following "scales" exist:
 256        | name       | scale                                     |
 257        | Test Scale | Disappointing, Good, Very good, Excellent |
 258      And the following "grade outcomes" exist:
 259        | fullname  | shortname | course | scale      |
 260        | Outcome 1 | OT1       | C1     | Test Scale |
 261      And the following "grade items" exist:
 262        | itemname              | course | outcome | gradetype | scale      |
 263        | Test outcome item one | C1     | OT1     | Scale     | Test Scale |
 264      And I log out
 265      When I log in as "teacher1"
 266      And I follow "Course 1"
 267      And I follow "Grades"
 268      And I expand "Setup" node
 269      And I follow "Categories and items"
 270      And I set the following settings for grade item "Course 1":
 271        | Aggregation                     | Natural |
 272        | Include outcomes in aggregation | 1       |
 273        | Exclude empty grades            | 0       |
 274      And I follow "Grader report"
 275      And I turn editing mode on
 276      And I press "Save changes"
 277      And I give the grade "Excellent" to the user "Student 1" for the grade item "Test outcome item one"
 278      And I press "Save changes"
 279      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 280      And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 281      And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 282      And I press "Save changes"
 283      And I log out
 284      And I log in as "student1"
 285      And I follow "Course 1"
 286      And I follow "Grades"
 287      Then "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
 288      And I set the field "Grade report" to "Overview report"
 289      And I should see "114.82 (18.27 %)" in the "overview-grade" "table"
 290      And I log out
 291      And I log in as "teacher1"
 292      And I follow "Course 1"
 293      And I follow "Grades"
 294      And I expand "Setup" node
 295      And I follow "Categories and items"
 296      And I set the following settings for grade item "Test outcome item one":
 297       | Extra credit     | 1   |
 298      And I log out
 299      And I log in as "student1"
 300      And I follow "Course 1"
 301      And I follow "Grades"
 302      Then "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
 303      And I set the field "Grade report" to "Overview report"
 304      And I should see "114.00 (18.39 %)" in the "overview-grade" "table"
 305      And I log out
 306      And I log in as "teacher1"
 307      And I follow "Course 1"
 308      And I follow "Grades"
 309      And I expand "Setup" node
 310      And I follow "Categories and items"
 311      And I set the following settings for grade item "Course 1":
 312        | Aggregation                     | Natural |
 313        | Include outcomes in aggregation | 0       |
 314      And I log out
 315      And I log in as "student1"
 316      And I follow "Course 1"
 317      And I follow "Grades"
 318      Then "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
 319      And I set the field "Grade report" to "Overview report"
 320      And I should see "110.00 (17.74 %)" in the "overview-grade" "table"
 321  
 322    @javascript
 323    Scenario: Natural aggregation on outcome items with modified weights
 324      And I log out
 325      And I log in as "admin"
 326      And I set the following administration settings values:
 327        | Enable outcomes | 1 |
 328      And the following "scales" exist:
 329        | name       | scale                                     |
 330        | Test Scale | Disappointing, Good, Very good, Excellent |
 331      And the following "grade outcomes" exist:
 332        | fullname  | shortname | course | scale      |
 333        | Outcome 1 | OT1       | C1     | Test Scale |
 334      And the following "grade items" exist:
 335        | itemname              | course | outcome | gradetype | scale      |
 336        | Test outcome item one | C1     | OT1     | Scale     | Test Scale |
 337      And I log out
 338      When I log in as "teacher1"
 339      And I follow "Course 1"
 340      And I follow "Grades"
 341      And I expand "Setup" node
 342      And I follow "Categories and items"
 343      And I set the following settings for grade item "Course 1":
 344        | Aggregation                     | Natural |
 345        | Include outcomes in aggregation | 1       |
 346        | Exclude empty grades            | 0       |
 347      And I set the following settings for grade item "Test outcome item one":
 348       | Weight adjusted  | 1   |
 349       | aggregationcoef2 | 100 |
 350      And I follow "Grader report"
 351      And I turn editing mode on
 352      And I press "Save changes"
 353      And I give the grade "Excellent" to the user "Student 1" for the grade item "Test outcome item one"
 354      And I press "Save changes"
 355      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 356      And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 357      And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 358      And I press "Save changes"
 359      And I log out
 360      And I log in as "student1"
 361      And I follow "Course 1"
 362      And I follow "Grades"
 363      Then "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
 364      And I set the field "Grade report" to "Overview report"
 365      And I should see "4.00 (100.00 %)" in the "overview-grade" "table"
 366  
 367    @javascript
 368    Scenario: Natural aggregation
 369      And I set the following settings for grade item "Sub category 1":
 370        | Aggregation          | Natural |
 371        | Exclude empty grades | 0       |
 372      And I set the following settings for grade item "Sub category 2":
 373        | Aggregation          | Natural |
 374        | Exclude empty grades | 1       |
 375      And I set the following settings for grade item "Course 1":
 376        | Aggregation          | Natural |
 377        | Exclude empty grades | 0       |
 378      And I set the following settings for grade item "Test assignment six":
 379        | Weight adjusted  | 1   |
 380        | aggregationcoef2 | 50  |
 381      And I set the following settings for grade item "Test assignment three":
 382        | Extra credit | 1 |
 383      And I turn editing mode off
 384      Then I should see "152.68 (24.43 %)" in the ".course" "css_element"
 385      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 386      And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 387      And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 388      And I set the field "Show contribution to course total" to "Show"
 389      And I set the field "Show weightings" to "Show"
 390      And I press "Save changes"
 391      And I set the field "Grade report" to "User report"
 392      And I set the field "Select all or one user" to "Student 1"
 393      And the following should exist in the "user-grade" table:
 394        | Grade item | Calculated weight | Grade | Range | Contribution to course total |
 395        | Test assignment five | 28.57 % | 10.00 (50.00 %) | 0–20 | 1.03 % |
 396        | Test assignment six | 50.00 % | 5.00 (50.00 %) | 0–10 | 1.80 % |
 397        | Test assignment seven | 21.43 % | - | 0–15 | 0.00 % |
 398        | Test assignment eight | 66.67 % | 10.00 (50.00 %) | 0–20 | 1.60 % |
 399        | Test assignment nine | 33.33 % | 5.00 (50.00 %) | 0–10 | 0.80 % |
 400        | Test assignment ten | 0.00 %( Empty ) | - | 0–15 | 0.00 % |
 401        | Test assignment one | 48.00 % | 60.00 (20.00 %) | 0–300 | 9.60 % |
 402        | Test assignment two | 16.00 % | 20.00 (20.00 %) | 0–100 | 3.20 % |
 403        | Test assignment three | 24.00 %( Extra credit ) | 40.00 (26.67 %) | 0–150 | 6.40 % |
 404        | Test assignment four | 24.00 % | - | 0–150 | 0.00 % |
 405      And I log out
 406      And I log in as "student1"
 407      And I follow "Course 1"
 408      And I follow "Grades"
 409      And I set the field "Grade report" to "Overview report"
 410      And I should see "113.75 (23.45 %)" in the "overview-grade" "table"
 411      And I set the field "Grade report" to "User report"
 412      And the following should exist in the "user-grade" table:
 413        | Grade item | Calculated weight | Grade | Range | Contribution to course total |
 414        | Test assignment six | 70.00 % | 5.00 (50.00 %) | 0–10 | 1.80 % |
 415        | Test assignment seven | 30.00 % | - | 0–15 | 0.00 % |
 416        | Test assignment nine | 100.00 % | 5.00 (50.00 %) | 0–10 | 1.03 % |
 417        | Test assignment ten | -( Empty ) | - | 0–15 | - |
 418        | Test assignment one | 61.86 % | 60.00 (20.00 %) | 0–300 | 12.37 % |
 419        | Test assignment three | 30.93 %( Extra credit ) | 40.00 (26.67 %) | 0–150 | 8.25 % |
 420        | Test assignment four | 30.93 % | - | 0–150 | 0.00 % |
 421  
 422    @javascript
 423    Scenario: Natural aggregation with drop lowest
 424      When I log out
 425      And I log in as "admin"
 426      And I follow "Course 1"
 427      And I follow "Grades"
 428      And I turn editing mode on
 429      And I set the following settings for grade item "Sub category 1":
 430        | Aggregation          | Natural |
 431        | Exclude empty grades | 0       |
 432      And I set the following settings for grade item "Sub category 2":
 433        | Aggregation          | Natural |
 434        | Exclude empty grades | 0       |
 435      And I set the following settings for grade item "Course 1":
 436        | Aggregation          | Natural |
 437        | Exclude empty grades | 0       |
 438      And I navigate to "Categories and items" node in "Grade administration > Setup"
 439      And I press "Add category"
 440      And I click on "Show more" "link"
 441      And I set the following fields to these values:
 442        | Category name | Sub category 3 |
 443        | Aggregation | Natural |
 444        | Drop the lowest | 1 |
 445      And I press "Save changes"
 446      And I press "Add grade item"
 447      And I set the following fields to these values:
 448        | Item name | Manual item 1 |
 449        | Grade category | Sub category 3 |
 450      And I press "Save changes"
 451      And I press "Add grade item"
 452      And I set the following fields to these values:
 453        | Item name | Manual item 2 |
 454        | Grade category | Sub category 3 |
 455      And I press "Save changes"
 456      And I press "Add grade item"
 457      And I set the following fields to these values:
 458        | Item name | Manual item 3 |
 459        | Grade category | Sub category 3 |
 460      And I press "Save changes"
 461      And I follow "Grader report"
 462      And I give the grade "60.00" to the user "Student 1" for the grade item "Manual item 1"
 463      And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
 464      And I give the grade "40.00" to the user "Student 1" for the grade item "Manual item 3"
 465      And I press "Save changes"
 466      And I turn editing mode off
 467      Then I should see "250.00 (25.25 %)" in the ".course" "css_element"
 468      And I turn editing mode on
 469      And I set the following settings for grade item "Manual item 2":
 470        | Extra credit | 1 |
 471      And I turn editing mode off
 472      And I should see "270.00 (27.27 %)" in the ".course" "css_element"
 473      And I turn editing mode on
 474      And I set the following settings for grade item "Manual item 2":
 475        | Extra credit  | 0   |
 476        | Maximum grade | 200 |
 477      And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
 478      And I press "Save changes"
 479      And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
 480      And I press "Save changes"
 481      And I turn editing mode off
 482      And I should see "270.00 (22.69 %)" in the ".course" "css_element"
 483      And I turn editing mode on
 484      And I set the following settings for grade item "Manual item 2":
 485        | Extra credit  | 0   |
 486        | Maximum grade | 100 |
 487      And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
 488      And I press "Save changes"
 489      And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
 490      And I press "Save changes"
 491      And I turn editing mode off
 492      And I should see "250.00 (25.25 %)" in the ".course" "css_element"
 493      And I navigate to "Categories and items" node in "Grade administration > Setup"
 494      And I press "Add category"
 495      And I set the following fields to these values:
 496        | Category name | Sub sub category 1 |
 497        | Parent category | Sub category 3 |
 498      And I press "Save changes"
 499      And I follow "Grader report"
 500      And I should see "270.00 (24.77 %)" in the ".course" "css_element"
 501  
 502    @javascript
 503    Scenario: Natural aggregation from the setup screen
 504      And I set the field "Grade report" to "Categories and items"
 505      And I set the following settings for grade item "Course 1":
 506        | Aggregation          | Natural |
 507      And I set the following settings for grade item "Sub category 1":
 508        | Aggregation          | Natural |
 509      And I set the following settings for grade item "Sub category 2":
 510        | Aggregation          | Natural |
 511  
 512      And I set the field "Override weight of Test assignment one" to "1"
 513      And the field "Weight of Test assignment one" matches value "37.975"
 514      And I set the field "Weight of Test assignment one" to "10"
 515  
 516      And I set the field "Override weight of Test assignment two" to "1"
 517      And the field "Weight of Test assignment two" matches value "12.658"
 518      And I set the field "Override weight of Test assignment two" to "0"
 519  
 520      And I set the field "Override weight of Test assignment six" to "1"
 521      And the field "Weight of Test assignment six" matches value "22.222"
 522      And I set the field "Weight of Test assignment six" to "50"
 523      And I set the field "Override weight of Test assignment six" to "0"
 524  
 525      And I set the field "Override weight of Test assignment ten" to "1"
 526      And the field "Weight of Test assignment ten" matches value "33.333"
 527      And I set the field "Weight of Test assignment ten" to "50"
 528  
 529      And I set the field "Override weight of Sub category 1" to "1"
 530      And the field "Weight of Sub category 1" matches value "5.696"
 531      And I set the field "Weight of Sub category 1" to "15"
 532  
 533      When I press "Save changes"
 534      And I set the field "Override weight of Test assignment two" to "1"
 535      And I set the field "Override weight of Test assignment six" to "1"
 536  
 537      Then the field "Weight of Test assignment one" matches value "10.0"
 538      And the field "Weight of Test assignment two" matches value "16.854"
 539      And the field "Weight of Test assignment six" matches value "22.222"
 540      And the field "Weight of Test assignment ten" matches value "50.0"
 541      And the field "Weight of Sub category 1" matches value "15.0"
 542      And I set the field "Override weight of Test assignment one" to "0"
 543      And I set the field "Override weight of Test assignment two" to "0"
 544      And I set the field "Override weight of Test assignment six" to "0"
 545      And I set the field "Override weight of Sub category 1" to "0"
 546      And I press "Save changes"
 547      And I set the field "Override weight of Test assignment one" to "1"
 548      And I set the field "Override weight of Sub category 1" to "1"
 549      And the field "Weight of Test assignment one" matches value "37.975"
 550      And the field "Weight of Sub category 1" matches value "5.696"
 551      And I reset weights for grade category "Sub category 2"
 552      And the field "Weight of Test assignment ten" matches value "33.333"
 553  
 554    @javascript
 555    Scenario: Natural aggregation with weights of zero
 556      When I set the following settings for grade item "Course 1":
 557        | Aggregation          | Natural |
 558        | Exclude empty grades | 0       |
 559      And I set the following settings for grade item "Sub category 1":
 560        | Aggregation          | Natural |
 561        | Exclude empty grades | 0       |
 562      And I set the following settings for grade item "Sub category 2":
 563        | Aggregation          | Natural |
 564        | Exclude empty grades | 0       |
 565      And I turn editing mode off
 566      And I set the field "Grade report" to "Categories and items"
 567      And I set the field "Override weight of Test assignment one" to "1"
 568      And I set the field "Weight of Test assignment one" to "0"
 569      And I set the field "Override weight of Test assignment six" to "1"
 570      And I set the field "Weight of Test assignment six" to "0"
 571      And I set the field "Override weight of Test assignment nine" to "1"
 572      And I set the field "Weight of Test assignment nine" to "100"
 573      And I press "Save changes"
 574      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 575      And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 576      And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
 577      And I set the field "Show contribution to course total" to "Show"
 578      And I set the field "Show weightings" to "Show"
 579      And I press "Save changes"
 580      Then I should see "75.00 (16.85 %)" in the ".course" "css_element"
 581      And I set the field "Grade report" to "User report"
 582      And I set the field "Select all or one user" to "Student 1"
 583      And the following should exist in the "user-grade" table:
 584        | Grade item            | Calculated weight | Grade           | Contribution to course total |
 585        | Test assignment five  | 57.14 %           | 10.00 (50.00 %) | 2.25 %                        |
 586        | Test assignment six   | 0.00 %            | 5.00 (50.00 %)  | 0.00 %                        |
 587        | Test assignment seven | 42.86 %           | -               | 0.00 %                        |
 588        | Test assignment eight | 0.00 %            | 10.00 (50.00 %) | 0.00 %                        |
 589        | Test assignment nine  | 100.00 %          | 5.00 (50.00 %)  | 1.12 %                         |
 590        | Test assignment ten   | 0.00 %            | -               | 0.00 %                         |
 591        | Test assignment one   | 0.00 %            | 60.00 (20.00 %) | 0.00 %                         |
 592        | Test assignment two   | 22.47 %           | 20.00 (20.00 %) | 4.49 %                        |
 593        | Test assignment three | 33.71 %           | 40.00 (26.67 %) | 8.99 %                        |
 594        | Test assignment four  | 33.71 %           | -               | 0.00                         |
 595      And I log out
 596      And I log in as "student1"
 597      And I follow "Course 1"
 598      And I follow "Grades"
 599      And I set the field "Grade report" to "Overview report"
 600      And I should see "45.00 (13.85 %)" in the "overview-grade" "table"
 601      And I set the field "Grade report" to "User report"
 602      And the following should exist in the "user-grade" table:
 603        | Grade item            | Calculated weight | Grade           | Contribution to course total |
 604        | Test assignment six   | 0.00 %            | 5.00 (50.00 %)  | 0.00 %                         |
 605        | Test assignment seven | 100.00 %          | -               | 0.00 %                         |
 606        | Test assignment nine  | 100.00 %          | 5.00 (50.00 %)  | 1.54 %                         |
 607        | Test assignment ten   | 0.00              | -               | 0.00 %                         |
 608        | Test assignment one   | 0.00 %            | 60.00 (20.00 %) | 0.00 %                         |
 609        | Test assignment three | 46.15 %           | 40.00 (26.67 %) | 12.31 %                        |
 610        | Test assignment four  | 46.15 %           | -               | 0.00 %                        |


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1