[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @core @core_grades
   2  Feature: Gradebook calculations for natural weights normalisation before the fix 20150619
   3    In order to make sure the grades are not changed after upgrade
   4    As a teacher
   5    I need to be able to freeze gradebook calculations
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category | groupmode |
  10        | Course 1 | C1 | 0 | 1 |
  11      And gradebook calculations for the course "C1" are frozen at version "20150619"
  12      And the following "users" exist:
  13        | username | firstname | lastname | email | idnumber |
  14        | teacher1 | Teacher | 1 | teacher1@example.com | t1 |
  15        | student1 | Student | 1 | student1@example.com | s1 |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | student1 | C1 | student |
  20      And the following "grade categories" exist:
  21        | fullname | course |
  22        | Sub category 1 | 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 I log in as "teacher1"
  35      And I follow "Course 1"
  36      And I navigate to "Grades" node in "Course administration"
  37      And I set the field "Grade report" to "Gradebook setup"
  38  
  39    @javascript
  40    Scenario: Grade items weights are normalised when all grade item weights are overridden (sum exactly 100). Extra credit is set to zero (before the fix 20150619).
  41      When I set the following settings for grade item "Test assignment seven":
  42        | Extra credit | 1 |
  43      And the field "Weight of Test assignment five" matches value "66.667"
  44      And the field "Weight of Test assignment six" matches value "33.333"
  45      And the field "Weight of Test assignment seven" matches value "50.0"
  46      And I set the field "Override weight of Test assignment five" to "1"
  47      And I set the field "Override weight of Test assignment six" to "1"
  48      And I set the field "Weight of Test assignment five" to "60"
  49      And I set the field "Weight of Test assignment six" to "40"
  50      And I press "Save changes"
  51  
  52      Then I should see "Your weights have been adjusted to total 100."
  53      And the field "Weight of Test assignment five" matches value "60.000"
  54      And the field "Weight of Test assignment six" matches value "40.000"
  55      And the field "Weight of Test assignment seven" matches value "0.0"
  56      # The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
  57      And I reset weights for grade category "Sub category 1"
  58      And the field "Weight of Test assignment five" matches value "66.667"
  59      And the field "Weight of Test assignment six" matches value "33.333"
  60      And the field "Weight of Test assignment seven" matches value "50.0"
  61  
  62    @javascript
  63    Scenario: Grade items weights are normalised when all grade item weights are overridden (sum over 100). Extra credit is set to zero (before the fix 20150619).
  64      When I set the following settings for grade item "Test assignment seven":
  65        | Extra credit | 1 |
  66      And I set the field "Override weight of Test assignment five" to "1"
  67      And I set the field "Override weight of Test assignment six" to "1"
  68      And I set the field "Weight of Test assignment five" to "60"
  69      And I set the field "Weight of Test assignment six" to "50"
  70      And I press "Save changes"
  71  
  72      Then I should see "Your weights have been adjusted to total 100."
  73      And the field "Weight of Test assignment five" matches value "54.545"
  74      And the field "Weight of Test assignment six" matches value "45.455"
  75      And the field "Weight of Test assignment seven" matches value "0.0"
  76      # The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
  77      And I reset weights for grade category "Sub category 1"
  78      And the field "Weight of Test assignment five" matches value "66.667"
  79      And the field "Weight of Test assignment six" matches value "33.333"
  80      And the field "Weight of Test assignment seven" matches value "50.0"
  81  
  82    @javascript
  83    Scenario: Grade items weights are normalised when all grade item weights are overridden (sum under 100). Extra credit is set to zero (before the fix 20150619).
  84      When I set the following settings for grade item "Test assignment seven":
  85        | Extra credit | 1 |
  86      And I set the field "Override weight of Test assignment five" to "1"
  87      And I set the field "Override weight of Test assignment six" to "1"
  88      And I set the field "Weight of Test assignment five" to "40"
  89      And I set the field "Weight of Test assignment six" to "30"
  90      And I press "Save changes"
  91  
  92      Then I should see "Your weights have been adjusted to total 100."
  93      And the field "Weight of Test assignment five" matches value "57.143"
  94      And the field "Weight of Test assignment six" matches value "42.857"
  95      And the field "Weight of Test assignment seven" matches value "0.0"
  96      # The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
  97      And I reset weights for grade category "Sub category 1"
  98      And the field "Weight of Test assignment five" matches value "66.667"
  99      And the field "Weight of Test assignment six" matches value "33.333"
 100      And the field "Weight of Test assignment seven" matches value "50.0"
 101  
 102    @javascript
 103    Scenario: Grade items weights are normalised when not all grade item weights are overridden. Extra credit is set respectful to non-overridden items (before the fix 20150619).
 104      When I set the following settings for grade item "Test assignment seven":
 105        | Extra credit | 1 |
 106      And I set the field "Override weight of Test assignment five" to "1"
 107      And I set the field "Weight of Test assignment five" to "40"
 108      And I press "Save changes"
 109  
 110      Then I should see "Your weights have been adjusted to total 100."
 111      And the field "Weight of Test assignment five" matches value "40.00"
 112      And the field "Weight of Test assignment six" matches value "60.000"
 113      And the field "Weight of Test assignment seven" matches value "90.0"
 114      # The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
 115      And I reset weights for grade category "Sub category 1"
 116      And the field "Weight of Test assignment five" matches value "66.667"
 117      And the field "Weight of Test assignment six" matches value "33.333"
 118      And the field "Weight of Test assignment seven" matches value "50.0"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1