[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @core @core_grades
   2  Feature: Gradebook calculations for calculated grade items before the fix 20150627
   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 "20150627"
  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        | student2 | Student   | 2        | student2@example.com | s2       |
  17      And the following "course enrolments" exist:
  18        | user     | course | role           |
  19        | teacher1 | C1     | editingteacher |
  20        | student1 | C1     | student        |
  21        | student2 | C1     | student        |
  22      And I log in as "admin"
  23      And I am on site homepage
  24      And I follow "Course 1"
  25      And I navigate to "Grades" node in "Course administration"
  26      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  27  
  28    @javascript
  29    Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed
  30      Given I press "Add category"
  31      And I set the following fields to these values:
  32        | Category name | Calc cat |
  33      And I press "Save changes"
  34      And I press "Add grade item"
  35      And I set the following fields to these values:
  36        | Item name | grade item 1 |
  37        | Grade category | Calc cat |
  38      And I press "Save changes"
  39      And I set "=[[gi1]]/2" calculation for grade category "Calc cat" with idnumbers:
  40        | grade item 1 | gi1 |
  41      And I set the following settings for grade item "Calc cat":
  42        | Maximum grade | 50 |
  43      And I follow "Grader report"
  44      And I turn editing mode on
  45      And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1"
  46      And I press "Save changes"
  47      And I follow "User report"
  48      And I select "Student 1" from the "Select all or one user" singleselect
  49      And the following should exist in the "user-grade" table:
  50        | Grade item                          | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
  51        | grade item 1                        | -                 | 75.00  | 0–100 | 75.00 %    | -                            |
  52        | Calc cat totalInclude empty grades. | 100.00 %          | 37.50  | 0–100 | 37.50 %    | -                            |
  53        | Course total                        | -                 | 37.50  | 0–100 | 37.50 %    | -                            |
  54  
  55    @javascript
  56    Scenario: Changing max grade for a category item with a calculation that has existing grades will display the same points with the new max grade values immediately.
  57      Given I press "Add category"
  58      And I set the following fields to these values:
  59        | Category name | Calc cat |
  60      And I press "Save changes"
  61      And I press "Add grade item"
  62      And I set the following fields to these values:
  63        | Item name | grade item 1 |
  64        | Grade category | Calc cat |
  65      And I press "Save changes"
  66      And I set "=[[gi1]]/2" calculation for grade category "Calc cat" with idnumbers:
  67        | grade item 1 | gi1 |
  68      And I set the following settings for grade item "Calc cat":
  69        | Maximum grade | 50 |
  70      And I follow "Grader report"
  71      And I turn editing mode on
  72      And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1"
  73      And I press "Save changes"
  74      And I follow "User report"
  75      And I select "Student 1" from the "Select all or one user" singleselect
  76      And the following should exist in the "user-grade" table:
  77        | Grade item                          | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
  78        | grade item 1                        | -                 | 75.00  | 0–100 | 75.00 %    | -                            |
  79        | Calc cat totalInclude empty grades. | 100.00 %          | 37.50  | 0–100 | 37.50 %    | -                            |
  80        | Course total                        | -                 | 37.50  | 0–100 | 37.50 %    | -                            |
  81      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  82      And I set the following settings for grade item "Calc cat":
  83        | Maximum grade | 40 |
  84      And I follow "Grader report"
  85      And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1"
  86      And I press "Save changes"
  87      And I follow "User report"
  88      When I select "Student 1" from the "Select all or one user" singleselect
  89      Then the following should exist in the "user-grade" table:
  90        | Grade item                          | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
  91        | grade item 1                        | -                 | 75.00  | 0–100 | 75.00 %    | -                            |
  92        | Calc cat totalInclude empty grades. | 100.00 %          | 37.50  | 0–100 | 37.50 %    | -                            |
  93        | Course total                        | -                 | 37.50  | 0–100 | 37.50 %    | -                            |
  94      And I select "Student 2" from the "Select all or one user" singleselect
  95      And the following should exist in the "user-grade" table:
  96        | Grade item                          | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
  97        | grade item 1                        | -                 | 65.00  | 0–100 | 65.00 %    | -                            |
  98        | Calc cat totalInclude empty grades. | 100.00 %          | 32.50  | 0–100 | 32.50 %    | -                            |
  99        | Course total                        | -                 | 32.50  | 0–100 | 32.50 %    | -                            |
 100      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 101      And I set the following fields to these values:
 102        | Min and max grades used in calculation | Initial min and max grades |
 103      And I press "Save changes"
 104      And I follow "User report"
 105      And I select "Student 1" from the "Select all or one user" singleselect
 106      And the following should exist in the "user-grade" table:
 107        | Grade item                          | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
 108        | grade item 1                        | -                 | 75.00  | 0–100 | 75.00 %    | -                            |
 109        | Calc cat totalInclude empty grades. | 100.00 %          | 37.50  | 0–100 | 37.50 %    | -                            |
 110        | Course total                        | -                 | 37.50  | 0–100 | 37.50 %    | -                            |
 111      And I select "Student 2" from the "Select all or one user" singleselect
 112      And the following should exist in the "user-grade" table:
 113        | Grade item                          | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
 114        | grade item 1                        | -                 | 65.00  | 0–100 | 65.00 %    | -                            |
 115        | Calc cat totalInclude empty grades. | 100.00 %          | 32.50  | 0–100 | 32.50 %    | -                            |
 116        | Course total                        | -                 | 32.50  | 0–100 | 32.50 %    | -                            |
 117  
 118    @javascript
 119    Scenario: Values in calculated grade items are not always out of one hundred
 120      Given I press "Add grade item"
 121      And I set the following fields to these values:
 122        | Item name | grade item 1 |
 123      And I press "Save changes"
 124      And I press "Add grade item"
 125      And I set the following fields to these values:
 126        | Item name | calc item |
 127      And I press "Save changes"
 128      And I set "=[[gi1]]/2" calculation for grade item "calc item" with idnumbers:
 129        | grade item 1 | gi1 |
 130      And I set the following settings for grade item "calc item":
 131        | Maximum grade | 50 |
 132      And I navigate to "Course grade settings" node in "Grade administration > Setup"
 133      And I set the following fields to these values:
 134        | Min and max grades used in calculation | Initial min and max grades |
 135      And I press "Save changes"
 136      And I follow "Grader report"
 137      And I turn editing mode on
 138      And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1"
 139      And I press "Save changes"
 140      And I follow "User report"
 141      When I select "Student 1" from the "Select all or one user" singleselect
 142      Then the following should exist in the "user-grade" table:
 143        | Grade item   | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
 144        | grade item 1 | 50.00 %           | 75.00  | 0–100 | 75.00 %    | 37.50 %                      |
 145        | calc item    | 50.00 %           | 37.50  | 0–100 | 37.50 %    | 18.75 %                      |
 146        | Course total | -                 | 112.50 | 0–200 | 56.25 %    | -                            |
 147      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
 148      And I set the following settings for grade item "calc item":
 149        | Rescale existing grades | No |
 150        | Maximum grade | 40 |
 151      And I follow "Grader report"
 152      And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1"
 153      And I press "Save changes"
 154      And I follow "User report"
 155      And I select "Student 1" from the "Select all or one user" singleselect
 156      And the following should exist in the "user-grade" table:
 157        | Grade item   | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
 158        | grade item 1 | 50.00 %           | 75.00  | 0–100 | 75.00 %    | 37.50 %                      |
 159        | calc item    | 50.00 %           | 37.50  | 0–100 | 37.50 %    | 18.75 %                      |
 160        | Course total | -                 | 112.50 | 0–200 | 56.25 %    | -                            |
 161      And I select "Student 2" from the "Select all or one user" singleselect
 162      And the following should exist in the "user-grade" table:
 163        | Grade item   | Calculated weight | Grade  | Range | Percentage | Contribution to course total |
 164        | grade item 1 | 50.00 %           | 65.00  | 0–100 | 65.00 %    | 32.50 %                      |
 165        | calc item    | 50.00 %           | 32.50  | 0–100 | 32.50 %    | 16.25 %                      |
 166        | Course total | -                 | 97.50  | 0–200 | 48.75 %    | -                            |


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