[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/activity_results/tests/behat/ -> highscoreswithseperategroups.feature (source)

   1  @block @block_activity_results
   2  Feature: The activity results block displays student scores
   3    In order to be display student scores
   4    As a user
   5    I need to see the activity results block
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email | idnumber |
  10        | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
  11        | student1 | Student | 1 | student1@example.com | S1 |
  12        | student2 | Student | 2 | student2@example.com | S2 |
  13        | student3 | Student | 3 | student3@example.com | S3 |
  14        | student4 | Student | 4 | student4@example.com | S4 |
  15        | student5 | Student | 5 | student5@example.com | S5 |
  16        | student6 | Student | 6 | student6@example.com | S6 |
  17      And the following "courses" exist:
  18        | fullname | shortname | category |
  19        | Course 1 | C1 | 0 |
  20      And the following "groups" exist:
  21        | name | course | idnumber |
  22        | Group 1 | C1 | G1 |
  23        | Group 2 | C1 | G2 |
  24        | Group 3 | C1 | G3 |
  25        | Group 4 | C1 | G4 |
  26        | Group 5 | C1 | G5 |
  27      And the following "course enrolments" exist:
  28        | user | course | role |
  29        | teacher1 | C1 | editingteacher |
  30        | student1 | C1 | student |
  31        | student2 | C1 | student |
  32        | student3 | C1 | student |
  33        | student4 | C1 | student |
  34        | student5 | C1 | student |
  35        | student6 | C1 | student |
  36      And the following "group members" exist:
  37        | user     | group   |
  38        | student1 | G1 |
  39        | student2 | G1 |
  40        | student3 | G2 |
  41        | student4 | G2 |
  42        | student5 | G3 |
  43        | student6 | G3 |
  44      And I log in as "teacher1"
  45      And I follow "Course 1"
  46      And I turn editing mode on
  47      And I add a "Assignment" to section "1" and I fill the form with:
  48        | Assignment name | Test assignment |
  49        | Description | Offline text |
  50        | assignsubmission_file_enabled | 0 |
  51        | Group mode | Separate groups |
  52      And I follow "Course 1"
  53      And I navigate to "Grades" node in "Course administration"
  54      And I turn editing mode on
  55      And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
  56      And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
  57      And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
  58      And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
  59      And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
  60      And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
  61      And I press "Save changes"
  62      And I follow "Course 1"
  63  
  64    Scenario: Configure the block on the course page to show 1 high score
  65      Given I add the "Activity results" block
  66      When I configure the "Activity results" block
  67      And I set the following fields to these values:
  68        | id_config_showbest | 1 |
  69        | id_config_showworst | 0 |
  70        | id_config_gradeformat | Percentages |
  71        | id_config_nameformat | Display full names |
  72        | id_config_decimalpoints | 0 |
  73        | id_config_usegroups | Yes |
  74      And I press "Save changes"
  75      Then I should see "Group 1" in the "Activity results" "block"
  76      And I should see "95%" in the "Activity results" "block"
  77  
  78    Scenario: Try to configure the block on the course page to show 1 high score as a fraction
  79      Given I add the "Activity results" block
  80      When I configure the "Activity results" block
  81      And I set the following fields to these values:
  82        | id_config_showbest | 1 |
  83        | id_config_showworst | 0 |
  84        | id_config_gradeformat | Fractions |
  85        | id_config_nameformat | Display full names |
  86        | id_config_usegroups | Yes |
  87      And I press "Save changes"
  88      Then I should see "Group 1" in the "Activity results" "block"
  89      And I should see "95.00/100.00" in the "Activity results" "block"
  90      And I log out
  91      And I log in as "student1"
  92      And I follow "Course 1"
  93      And I should see "Student 1" in the "Activity results" "block"
  94      And I should see "100.00/100.00" in the "Activity results" "block"
  95  
  96    Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
  97      Given I add the "Activity results" block
  98      When I configure the "Activity results" block
  99      And I set the following fields to these values:
 100        | id_config_showbest | 1 |
 101        | id_config_showworst | 0 |
 102        | id_config_gradeformat | Absolute numbers |
 103        | id_config_nameformat | Display full names |
 104        | id_config_usegroups | Yes |
 105      And I press "Save changes"
 106      Then I should see "Group 1" in the "Activity results" "block"
 107      And I should see "95.00" in the "Activity results" "block"
 108      And I log out
 109      And I log in as "student1"
 110      And I follow "Course 1"
 111      And I should see "Student 1" in the "Activity results" "block"
 112      And I should see "100.00" in the "Activity results" "block"
 113  
 114    Scenario: Try to configure the block on the course page to show multiple high scores as percentages
 115      Given I add the "Activity results" block
 116      When I configure the "Activity results" block
 117      And I set the following fields to these values:
 118        | id_config_showbest | 3 |
 119        | id_config_showworst | 0 |
 120        | id_config_gradeformat | Percentages |
 121        | id_config_nameformat | Display full names |
 122        | id_config_decimalpoints | 0 |
 123        | id_config_usegroups | Yes |
 124      And I press "Save changes"
 125      Then I should see "Group 1" in the "Activity results" "block"
 126      And I should see "95%" in the "Activity results" "block"
 127      And I should see "Group 2" in the "Activity results" "block"
 128      And I should see "85%" in the "Activity results" "block"
 129      And I should see "Group 3" in the "Activity results" "block"
 130      And I should see "75%" in the "Activity results" "block"
 131      And I log out
 132      And I log in as "student1"
 133      And I follow "Course 1"
 134      And I should see "Student 1" in the "Activity results" "block"
 135      And I should see "100%" in the "Activity results" "block"
 136      And I should see "Student 2" in the "Activity results" "block"
 137      And I should see "90%" in the "Activity results" "block"
 138  
 139    Scenario: Try to configure the block on the course page to show multiple high scores as fractions
 140      Given I add the "Activity results" block
 141      When I configure the "Activity results" block
 142      And I set the following fields to these values:
 143        | id_config_showbest | 3 |
 144        | id_config_showworst | 0 |
 145        | id_config_gradeformat | Fractions |
 146        | id_config_nameformat | Display full names |
 147        | id_config_usegroups | Yes |
 148      And I press "Save changes"
 149      Then I should see "Group 1" in the "Activity results" "block"
 150      And I should see "95.00/100.00" in the "Activity results" "block"
 151      And I should see "Group 2" in the "Activity results" "block"
 152      And I should see "85.00/100.00" in the "Activity results" "block"
 153      And I should see "Group 3" in the "Activity results" "block"
 154      And I should see "75.00/100.00" in the "Activity results" "block"
 155      And I log out
 156      And I log in as "student3"
 157      And I follow "Course 1"
 158      And I should see "Student 3" in the "Activity results" "block"
 159      And I should see "90.00/100.00" in the "Activity results" "block"
 160      And I should see "Student 4" in the "Activity results" "block"
 161      And I should see "80.00/100.00" in the "Activity results" "block"
 162  
 163    Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
 164      Given I add the "Activity results" block
 165      When I configure the "Activity results" block
 166      And I set the following fields to these values:
 167        | id_config_showbest | 3 |
 168        | id_config_showworst | 0 |
 169        | id_config_gradeformat | Absolute numbers |
 170        | id_config_nameformat | Display full names |
 171        | id_config_usegroups | Yes |
 172      And I press "Save changes"
 173      Then I should see "Group 1" in the "Activity results" "block"
 174      And I should see "95.00" in the "Activity results" "block"
 175      And I should see "Group 2" in the "Activity results" "block"
 176      And I should see "85.00" in the "Activity results" "block"
 177      And I should see "Group 3" in the "Activity results" "block"
 178      And I should see "75.00" in the "Activity results" "block"
 179      And I log out
 180      And I log in as "student1"
 181      And I follow "Course 1"
 182      And I should see "Student 1" in the "Activity results" "block"
 183      And I should see "100.00" in the "Activity results" "block"
 184      And I should see "Student 2" in the "Activity results" "block"
 185      And I should see "90.00" in the "Activity results" "block"
 186  
 187    Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
 188      Given I add the "Activity results" block
 189      When I configure the "Activity results" block
 190      And I set the following fields to these values:
 191        | id_config_showbest | 3 |
 192        | id_config_showworst | 0 |
 193        | id_config_gradeformat | Percentages |
 194        | id_config_nameformat | Display only ID numbers |
 195        | id_config_usegroups | Yes |
 196      And I press "Save changes"
 197      Then I should see "Group" in the "Activity results" "block"
 198      And I should see "95.00%" in the "Activity results" "block"
 199      And I should see "85.00%" in the "Activity results" "block"
 200      And I should see "75.00%" in the "Activity results" "block"
 201      And I log out
 202      And I log in as "student1"
 203      And I follow "Course 1"
 204      And I should see "User S1" in the "Activity results" "block"
 205      And I should see "100.00%" in the "Activity results" "block"
 206      And I should see "User S2" in the "Activity results" "block"
 207      And I should see "90.00%" in the "Activity results" "block"
 208  
 209    Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
 210      Given I add the "Activity results" block
 211      When I configure the "Activity results" block
 212      And I set the following fields to these values:
 213        | id_config_showbest | 3 |
 214        | id_config_showworst | 0 |
 215        | id_config_gradeformat | Percentages |
 216        | id_config_nameformat | Anonymous results |
 217        | id_config_usegroups | Yes |
 218      And I press "Save changes"
 219      Then I should see "Group" in the "Activity results" "block"
 220      And I should see "95.00%" in the "Activity results" "block"
 221      And I should see "85.00%" in the "Activity results" "block"
 222      And I should see "75.00%" in the "Activity results" "block"
 223      And I log out
 224      And I log in as "student1"
 225      And I follow "Course 1"
 226      And I should see "User" in the "Activity results" "block"
 227      And I should see "100.00%" in the "Activity results" "block"
 228      And I should see "90.00%" in the "Activity results" "block"


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