[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @core @core_grades
   2  Feature: We can use a minimum grade different than zero
   3    In order to use a minimum grade different than zero
   4    As an teacher
   5    I need to set up a minimum grade different than zero
   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 | teacher1@example.com | t1 |
  14        | student1 | Student | 1 | student1@example.com | s1 |
  15        | student2 | Student | 2 | student2@example.com | s2 |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | student1 | C1 | student |
  20        | student2 | C1 | student |
  21      And the following "grade categories" exist:
  22        | fullname | course |
  23        | Sub category 1 | C1 |
  24        | Sub category 2 | C1 |
  25      And I log in as "admin"
  26      And I set the following administration settings values:
  27        | 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 |
  28      And I am on site homepage
  29      And I follow "Course 1"
  30      And I navigate to "Grades" node in "Course administration"
  31      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  32      And I press "Add grade item"
  33      And I set the following fields to these values:
  34        | Item name | Manual item 1 |
  35        | Minimum grade | -100 |
  36        | Grade category | Course 1 |
  37      And I press "Save changes"
  38      And I press "Add grade item"
  39      And I set the following fields to these values:
  40        | Item name | Manual item 2 |
  41        | Minimum grade | 50 |
  42        | Grade category | Course 1 |
  43      And I press "Save changes"
  44      And I press "Add grade item"
  45      And I set the following fields to these values:
  46        | Item name | Manual item 3 |
  47        | Maximum grade | 50 |
  48        | Minimum grade | -100 |
  49        | Grade category | Sub category 1 |
  50      And I press "Save changes"
  51      And I press "Add grade item"
  52      And I set the following fields to these values:
  53        | Item name | Manual item 4 |
  54        | Minimum grade | -100 |
  55        | Grade category | Sub category 1 |
  56      And I press "Save changes"
  57      And I press "Add grade item"
  58      And I set the following fields to these values:
  59        | Item name | Manual item 5 |
  60        | Minimum grade | 50 |
  61        | Grade category | Sub category 2 |
  62      And I press "Save changes"
  63      And I press "Add grade item"
  64      And I set the following fields to these values:
  65        | Item name | Manual item 6 |
  66        | Minimum grade | 50 |
  67        | Grade category | Sub category 2 |
  68      And I press "Save changes"
  69      And I navigate to "Course grade settings" node in "Grade administration > Setup"
  70      And I set the field "Show weightings" to "Show"
  71      And I set the field "Show contribution to course total" to "Show"
  72      And I press "Save changes"
  73  
  74    @javascript
  75    Scenario: Natural aggregation with negative and positive grade
  76      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
  77      And I set the following settings for grade item "Sub category 1":
  78        | Aggregation          | Natural |
  79        | Exclude empty grades | 0       |
  80      And I set the following settings for grade item "Sub category 2":
  81        | Aggregation          | Natural |
  82        | Exclude empty grades | 0       |
  83      And I set the following settings for grade item "Course 1":
  84        | Aggregation          | Natural |
  85        | Exclude empty grades | 0       |
  86      And I log out
  87      And I log in as "teacher1"
  88      And I follow "Course 1"
  89      And I navigate to "Grades" node in "Course administration"
  90      And I turn editing mode on
  91      When I give the grade "-25.00" to the user "Student 1" for the grade item "Manual item 1"
  92      And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 2"
  93      And I give the grade "-80.00" to the user "Student 1" for the grade item "Manual item 3"
  94      And I give the grade "-10.00" to the user "Student 1" for the grade item "Manual item 4"
  95      And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 5"
  96      And I give the grade "75.00" to the user "Student 1" for the grade item "Manual item 6"
  97      And I give the grade "0.00" to the user "Student 2" for the grade item "Manual item 1"
  98      And I give the grade "0.00" to the user "Student 2" for the grade item "Manual item 2"
  99      And I give the grade "-10.00" to the user "Student 2" for the grade item "Manual item 3"
 100      And I give the grade "50.00" to the user "Student 2" for the grade item "Manual item 4"
 101      And I give the grade "0.00" to the user "Student 2" for the grade item "Manual item 5"
 102      And I give the grade "0.00" to the user "Student 2" for the grade item "Manual item 6"
 103      And I press "Save changes"
 104      And I follow "User report"
 105      And I set the field "Select all or one user" to "Student 1"
 106      Then the following should exist in the "user-grade" table:
 107        | Grade item    | Calculated weight | Grade  | Contribution to course total |
 108        | Manual item 1 | 18.18 %           | -25.00 | -4.55 %                      |
 109        | Manual item 2 | 18.18 %           | 50.00  | 9.09 %                       |
 110        | Manual item 3 | 33.33 %           | -80.00 | -14.55 %                     |
 111        | Manual item 4 | 66.67 %           | -10.00 | -1.82 %                      |
 112        | Manual item 5 | 50.00 %           | 50.00  | 9.09 %                       |
 113        | Manual item 6 | 50.00 %           | 75.00  | 13.64 %                      |
 114      And I set the field "Select all or one user" to "Student 2"
 115      And the following should exist in the "user-grade" table:
 116        | Grade item    | Calculated weight | Grade  | Contribution to course total |
 117        | Manual item 1 | 18.18 %           | 0.00   | 0.00 %                       |
 118        | Manual item 2 | 18.18 %           | 50.00  | 9.09 %                       |
 119        | Manual item 3 | 33.33 %           | -10.00 | -1.82 %                      |
 120        | Manual item 4 | 66.67 %           | 50.00  | 9.09 %                       |
 121        | Manual item 5 | 50.00 %           | 50.00  | 9.09 %                       |
 122        | Manual item 6 | 50.00 %           | 50.00  | 9.09 %                       |


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