[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @core @core_grades
   2  Feature: Changing the aggregation of an item affects its weight and extra credit definition
   3    In order to switch to another aggregation method
   4    As an teacher
   5    I need to be able to edit the grade category settings
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname |
  10        | Course 1 | C1        |
  11      And the following "grade categories" exist:
  12        | fullname      | course | aggregation |
  13        | Cat mean      | C1     | 0           |
  14        | Cat median    | C1     | 2           |
  15        | Cat min       | C1     | 4           |
  16        | Cat max       | C1     | 6           |
  17        | Cat mode      | C1     | 8           |
  18        | Cat weighted  | C1     | 10          |
  19        | Cat weighted2 | C1     | 10          |
  20        | Cat simple    | C1     | 11          |
  21        | Cat ec        | C1     | 12          |
  22        | Cat natural   | C1     | 13          |
  23      And the following "grade items" exist:
  24        | itemname  | course | category    | aggregationcoef | aggregationcoef2 | weightoverride |
  25        | Item a1   | C1     | ?           | 0               | 0                | 0              |
  26        | Item a2   | C1     | ?           | 0               | 0.40             | 1              |
  27        | Item a3   | C1     | ?           | 1               | 0.10             | 1              |
  28        | Item a4   | C1     | ?           | 1               | 0                | 0              |
  29        | Item b1   | C1     | Cat natural | 0               | 0                | 0              |
  30        | Item b2   | C1     | Cat natural | 0               | 0.40             | 1              |
  31        | Item b3   | C1     | Cat natural | 1               | 0.10             | 1              |
  32        | Item b4   | C1     | Cat natural | 1               | 0                | 0              |
  33      And I log in as "admin"
  34      And I set the following administration settings values:
  35        | 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 |
  36      And I am on site homepage
  37      And I follow "Course 1"
  38      And I navigate to "Grades" node in "Course administration"
  39      And I navigate to "Grader report" node in "Grade administration"
  40      And I turn editing mode on
  41      And I follow "Edit   Cat mean"
  42      And I set the following fields to these values:
  43        | Weight adjusted     | 1  |
  44        | Weight              | 20 |
  45        | Extra credit        | 0  |
  46      And I press "Save changes"
  47      And I follow "Edit   Cat median"
  48      And I set the following fields to these values:
  49        | Weight adjusted     | 1  |
  50        | Weight              | 5  |
  51        | Extra credit        | 0  |
  52      And I press "Save changes"
  53      And I follow "Edit   Cat min"
  54      And I set the following fields to these values:
  55        | Weight adjusted     | 0  |
  56        | Weight              | 0  |
  57        | Extra credit        | 1  |
  58      And I press "Save changes"
  59      And I follow "Edit   Item a1"
  60      And the field "Weight adjusted" matches value "0"
  61      And the field "Extra credit" matches value "0"
  62      And I press "Cancel"
  63      And I follow "Edit   Item a2"
  64      And the field "Weight adjusted" matches value "1"
  65      And the field "id_aggregationcoef2" matches value "40.0"
  66      And the field "Extra credit" matches value "0"
  67      And I press "Cancel"
  68      And I follow "Edit   Item a3"
  69      And the field "Weight adjusted" matches value "1"
  70      And the field "id_aggregationcoef2" matches value "10.0"
  71      And the field "Extra credit" matches value "1"
  72      And I press "Cancel"
  73      And I follow "Edit   Item a4"
  74      And the field "Weight adjusted" matches value "0"
  75      And the field "Extra credit" matches value "1"
  76      And I press "Cancel"
  77      And I follow "Edit   Item b1"
  78      And the field "Weight adjusted" matches value "0"
  79      And the field "Extra credit" matches value "0"
  80      And I press "Cancel"
  81      And I follow "Edit   Item b2"
  82      And the field "Weight adjusted" matches value "1"
  83      And the field "id_aggregationcoef2" matches value "40.0"
  84      And the field "Extra credit" matches value "0"
  85      And I press "Cancel"
  86      And I follow "Edit   Item b3"
  87      And the field "Weight adjusted" matches value "1"
  88      And the field "id_aggregationcoef2" matches value "10.0"
  89      And the field "Extra credit" matches value "1"
  90      And I press "Cancel"
  91      And I follow "Edit   Item b4"
  92      And the field "Weight adjusted" matches value "0"
  93      And the field "Extra credit" matches value "1"
  94      And I press "Cancel"
  95  
  96    Scenario: Switching a category from Natural aggregation to Mean of grades and back
  97      Given I follow "Edit   Course 1"
  98      And I set the field "Aggregation" to "Mean of grades"
  99      When I press "Save changes"
 100      And I follow "Edit   Item a1"
 101      Then I should not see "Weight adjusted"
 102      And I should not see "Weight"
 103      And I should not see "Extra credit"
 104      And I press "Cancel"
 105      And I follow "Edit   Item a2"
 106      And I should not see "Weight adjusted"
 107      And I should not see "Weight"
 108      And I should not see "Extra credit"
 109      And I press "Cancel"
 110      And I follow "Edit   Item a3"
 111      And I should not see "Weight adjusted"
 112      And I should not see "Weight"
 113      And I should not see "Extra credit"
 114      And I press "Cancel"
 115      And I follow "Edit   Item a4"
 116      And I should not see "Weight adjusted"
 117      And I should not see "Weight"
 118      And I should not see "Extra credit"
 119      And I press "Cancel"
 120      And I follow "Edit   Cat mean"
 121      And I expand all fieldsets
 122      And I should not see "Weight adjusted"
 123      And I should not see "Weight" in the "#id_headerparent" "css_element"
 124      And I should not see "Extra credit"
 125      And I press "Cancel"
 126      And I follow "Edit   Cat median"
 127      And I expand all fieldsets
 128      And I should not see "Weight adjusted"
 129      And I should not see "Weight" in the "#id_headerparent" "css_element"
 130      And I should not see "Extra credit"
 131      And I press "Cancel"
 132      And I follow "Edit   Cat min"
 133      And I expand all fieldsets
 134      And I should not see "Weight adjusted"
 135      And I should not see "Weight" in the "#id_headerparent" "css_element"
 136      And I should not see "Extra credit"
 137      And I press "Cancel"
 138      And I follow "Edit   Cat natural"
 139      And I set the field "Aggregation" to "Mean of grades"
 140      And I press "Save changes"
 141      And I follow "Edit   Item b1"
 142      And I should not see "Weight adjusted"
 143      And I should not see "Weight"
 144      And I should not see "Extra credit"
 145      And I press "Cancel"
 146      And I follow "Edit   Item b2"
 147      And I should not see "Weight adjusted"
 148      And I should not see "Weight"
 149      And I should not see "Extra credit"
 150      And I press "Cancel"
 151      And I follow "Edit   Item b3"
 152      And I should not see "Weight adjusted"
 153      And I should not see "Weight"
 154      And I should not see "Extra credit"
 155      And I press "Cancel"
 156      And I follow "Edit   Item b4"
 157      And I should not see "Weight adjusted"
 158      And I should not see "Weight"
 159      And I should not see "Extra credit"
 160      And I press "Cancel"
 161      # Switching back.
 162      And I follow "Edit   Course 1"
 163      And I set the field "Aggregation" to "Natural"
 164      And I press "Save changes"
 165      And I follow "Edit   Item a1"
 166      And the field "Weight adjusted" matches value "0"
 167      And the field "Extra credit" matches value "0"
 168      And I press "Cancel"
 169      And I follow "Edit   Item a2"
 170      And the field "Weight adjusted" matches value "0"
 171      And the field "Extra credit" matches value "0"
 172      And I press "Cancel"
 173      And I follow "Edit   Item a3"
 174      And the field "Weight adjusted" matches value "0"
 175      And the field "Extra credit" matches value "0"
 176      And I press "Cancel"
 177      And I follow "Edit   Item a4"
 178      And the field "Weight adjusted" matches value "0"
 179      And the field "Extra credit" matches value "0"
 180      And I press "Cancel"
 181      And I follow "Edit   Cat mean"
 182      And I expand all fieldsets
 183      And the field "Weight adjusted" matches value "0"
 184      And the field "Extra credit" matches value "0"
 185      And I press "Cancel"
 186      And I follow "Edit   Cat median"
 187      And I expand all fieldsets
 188      And the field "Weight adjusted" matches value "0"
 189      And the field "Extra credit" matches value "0"
 190      And I press "Cancel"
 191      And I follow "Edit   Cat min"
 192      And I expand all fieldsets
 193      And the field "Weight adjusted" matches value "0"
 194      And the field "Extra credit" matches value "0"
 195      And I press "Cancel"
 196      And I follow "Edit   Cat natural"
 197      And I set the field "Aggregation" to "Natural"
 198      And I press "Save changes"
 199      And I follow "Edit   Item b1"
 200      And the field "Weight adjusted" matches value "0"
 201      And the field "Extra credit" matches value "0"
 202      And I press "Cancel"
 203      And I follow "Edit   Item b2"
 204      And the field "Weight adjusted" matches value "0"
 205      And the field "Extra credit" matches value "0"
 206      And I press "Cancel"
 207      And I follow "Edit   Item b3"
 208      And the field "Weight adjusted" matches value "0"
 209      And the field "Extra credit" matches value "0"
 210      And I press "Cancel"
 211      And I follow "Edit   Item b4"
 212      And the field "Weight adjusted" matches value "0"
 213      And the field "Extra credit" matches value "0"
 214      And I press "Cancel"
 215  
 216    Scenario: Switching a category from Natural aggregation to Weighted mean of grades and back
 217      Given I follow "Edit   Course 1"
 218      And I set the field "Aggregation" to "Weighted mean of grades"
 219      When I press "Save changes"
 220      And I follow "Edit   Item a1"
 221      Then I should not see "Weight adjusted"
 222      And I should not see "Extra credit"
 223      And the field "Item weight" matches value "1"
 224      And I press "Cancel"
 225      And I follow "Edit   Item a2"
 226      And I should not see "Weight adjusted"
 227      And I should not see "Extra credit"
 228      And the field "Item weight" matches value "1"
 229      And I press "Cancel"
 230      And I follow "Edit   Item a3"
 231      And I should not see "Weight adjusted"
 232      And I should not see "Extra credit"
 233      And the field "Item weight" matches value "1"
 234      And I press "Cancel"
 235      And I follow "Edit   Item a4"
 236      And I should not see "Weight adjusted"
 237      And I should not see "Extra credit"
 238      And the field "Item weight" matches value "1"
 239      And I press "Cancel"
 240      And I follow "Edit   Cat mean"
 241      And I expand all fieldsets
 242      And I should not see "Weight adjusted"
 243      And I should not see "Extra credit"
 244      And the field "Item weight" matches value "1"
 245      And I press "Cancel"
 246      And I follow "Edit   Cat median"
 247      And I expand all fieldsets
 248      And I should not see "Weight adjusted"
 249      And I should not see "Extra credit"
 250      And the field "Item weight" matches value "1"
 251      And I press "Cancel"
 252      And I follow "Edit   Cat min"
 253      And I expand all fieldsets
 254      And I should not see "Weight adjusted"
 255      And I should not see "Extra credit"
 256      And the field "Item weight" matches value "1"
 257      And I press "Cancel"
 258      And I follow "Edit   Cat natural"
 259      And I set the field "Aggregation" to "Weighted mean of grades"
 260      And I press "Save changes"
 261      And I follow "Edit   Item b1"
 262      And I should not see "Weight adjusted"
 263      And I should not see "Extra credit"
 264      And the field "Item weight" matches value "1"
 265      And I press "Cancel"
 266      And I follow "Edit   Item b2"
 267      And I should not see "Weight adjusted"
 268      And I should not see "Extra credit"
 269      And the field "Item weight" matches value "1"
 270      And I press "Cancel"
 271      And I follow "Edit   Item b3"
 272      And I should not see "Weight adjusted"
 273      And I should not see "Extra credit"
 274      And the field "Item weight" matches value "1"
 275      And I press "Cancel"
 276      And I follow "Edit   Item b4"
 277      And I should not see "Weight adjusted"
 278      And I should not see "Extra credit"
 279      And the field "Item weight" matches value "1"
 280      And I press "Cancel"
 281      # Switching back.
 282      And I follow "Edit   Course 1"
 283      And I set the field "Aggregation" to "Natural"
 284      And I press "Save changes"
 285      And I follow "Edit   Item a1"
 286      And the field "Weight adjusted" matches value "0"
 287      And the field "Extra credit" matches value "0"
 288      And I press "Cancel"
 289      And I follow "Edit   Item a2"
 290      And the field "Weight adjusted" matches value "0"
 291      And the field "Extra credit" matches value "0"
 292      And I press "Cancel"
 293      And I follow "Edit   Item a3"
 294      And the field "Weight adjusted" matches value "0"
 295      And the field "Extra credit" matches value "0"
 296      And I press "Cancel"
 297      And I follow "Edit   Item a4"
 298      And the field "Weight adjusted" matches value "0"
 299      And the field "Extra credit" matches value "0"
 300      And I press "Cancel"
 301      And I follow "Edit   Cat mean"
 302      And I expand all fieldsets
 303      And the field "Weight adjusted" matches value "0"
 304      And the field "Extra credit" matches value "0"
 305      And I press "Cancel"
 306      And I follow "Edit   Cat median"
 307      And I expand all fieldsets
 308      And the field "Weight adjusted" matches value "0"
 309      And the field "Extra credit" matches value "0"
 310      And I press "Cancel"
 311      And I follow "Edit   Cat min"
 312      And I expand all fieldsets
 313      And the field "Weight adjusted" matches value "0"
 314      And the field "Extra credit" matches value "0"
 315      And I press "Cancel"
 316      And I follow "Edit   Cat natural"
 317      And I set the field "Aggregation" to "Natural"
 318      And I press "Save changes"
 319      And I follow "Edit   Item b1"
 320      And the field "Weight adjusted" matches value "0"
 321      And the field "Extra credit" matches value "0"
 322      And I press "Cancel"
 323      And I follow "Edit   Item b2"
 324      And the field "Weight adjusted" matches value "0"
 325      And the field "Extra credit" matches value "0"
 326      And I press "Cancel"
 327      And I follow "Edit   Item b3"
 328      And the field "Weight adjusted" matches value "0"
 329      And the field "Extra credit" matches value "0"
 330      And I press "Cancel"
 331      And I follow "Edit   Item b4"
 332      And the field "Weight adjusted" matches value "0"
 333      And the field "Extra credit" matches value "0"
 334      And I press "Cancel"
 335  
 336    @javascript
 337    Scenario: Switching grade items between categories
 338      # Move to same aggregation (Natural).
 339      Given I navigate to "Gradebook setup" node in "Grade administration > Setup"
 340      And I set the field "Select Item a1" to "1"
 341      And I set the field "Select Item a2" to "1"
 342      And I set the field "Select Item a3" to "1"
 343      And I set the field "Select Item a4" to "1"
 344      When I select "Cat natural" from the "Move selected items to" singleselect
 345      And I navigate to "Grader report" node in "Grade administration"
 346      And I follow "Edit   Item a1"
 347      Then the field "Weight adjusted" matches value "0"
 348      And the field "Extra credit" matches value "0"
 349      And I press "Cancel"
 350      And I follow "Edit   Item a2"
 351      And the field "Weight adjusted" matches value "1"
 352      And the field "id_aggregationcoef2" matches value "40.0"
 353      And the field "Extra credit" matches value "0"
 354      And I press "Cancel"
 355      And I follow "Edit   Item a3"
 356      And the field "Weight adjusted" matches value "1"
 357      And the field "id_aggregationcoef2" matches value "10.0"
 358      And the field "Extra credit" matches value "1"
 359      And I press "Cancel"
 360      And I follow "Edit   Item a4"
 361      And the field "Weight adjusted" matches value "0"
 362      And the field "Extra credit" matches value "1"
 363      And I press "Cancel"
 364      # Move to Mean of grades (with extra credit).
 365      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
 366      And I set the field "Select Item a1" to "1"
 367      And I set the field "Select Item a2" to "1"
 368      And I set the field "Select Item a3" to "1"
 369      And I set the field "Select Item a4" to "1"
 370      And I select "Cat ec" from the "Move selected items to" singleselect
 371      And I navigate to "Grader report" node in "Grade administration"
 372      And I follow "Edit   Item a1"
 373      And the field "Extra credit" matches value "0"
 374      And I press "Cancel"
 375      And I follow "Edit   Item a2"
 376      And the field "Extra credit" matches value "0"
 377      And I press "Cancel"
 378      And I follow "Edit   Item a3"
 379      And the field "Extra credit" matches value "1"
 380      And I press "Cancel"
 381      And I follow "Edit   Item a4"
 382      And the field "Extra credit" matches value "1"
 383      And I press "Cancel"
 384      # Move to Simple weight mean of grades.
 385      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
 386      And I set the field "Select Item a1" to "1"
 387      And I set the field "Select Item a2" to "1"
 388      And I set the field "Select Item a3" to "1"
 389      And I set the field "Select Item a4" to "1"
 390      And I select "Cat simple" from the "Move selected items to" singleselect
 391      And I navigate to "Grader report" node in "Grade administration"
 392      And I follow "Edit   Item a1"
 393      And the field "Extra credit" matches value "0"
 394      And I press "Cancel"
 395      And I follow "Edit   Item a2"
 396      And the field "Extra credit" matches value "0"
 397      And I press "Cancel"
 398      And I follow "Edit   Item a3"
 399      And the field "Extra credit" matches value "1"
 400      And I press "Cancel"
 401      And I follow "Edit   Item a4"
 402      And the field "Extra credit" matches value "1"
 403      And I press "Cancel"
 404      # Move to Weighted mean of grades.
 405      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
 406      And I set the field "Select Item a1" to "1"
 407      And I set the field "Select Item a2" to "1"
 408      And I set the field "Select Item a3" to "1"
 409      And I set the field "Select Item a4" to "1"
 410      And I select "Cat weighted" from the "Move selected items to" singleselect
 411      And I navigate to "Grader report" node in "Grade administration"
 412      And I follow "Edit   Item a1"
 413      And the field "Item weight" matches value "1"
 414      And I set the field "Item weight" to "2"
 415      And I press "Save changes"
 416      And I follow "Edit   Item a2"
 417      And the field "Item weight" matches value "1"
 418      And I set the field "Item weight" to "5"
 419      And I press "Save changes"
 420      And I follow "Edit   Item a3"
 421      And the field "Item weight" matches value "1"
 422      And I set the field "Item weight" to "8"
 423      And I press "Save changes"
 424      And I follow "Edit   Item a4"
 425      And the field "Item weight" matches value "1"
 426      And I set the field "Item weight" to "11"
 427      And I press "Save changes"
 428      # Move to same (Weighted mean of grades).
 429      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
 430      And I set the field "Select Item a1" to "1"
 431      And I set the field "Select Item a2" to "1"
 432      And I set the field "Select Item a3" to "1"
 433      And I set the field "Select Item a4" to "1"
 434      And I select "Cat weighted2" from the "Move selected items to" singleselect
 435      And I wait "2" seconds
 436      And I navigate to "Grader report" node in "Grade administration"
 437      And I follow "Edit   Item a1"
 438      And the field "Item weight" matches value "2"
 439      And I press "Save changes"
 440      And I follow "Edit   Item a2"
 441      And the field "Item weight" matches value "5"
 442      And I press "Save changes"
 443      And I follow "Edit   Item a3"
 444      And the field "Item weight" matches value "8"
 445      And I press "Save changes"
 446      And I follow "Edit   Item a4"
 447      And the field "Item weight" matches value "11"
 448      And I press "Save changes"
 449      # Move back to Natural.
 450      And I navigate to "Gradebook setup" node in "Grade administration > Setup"
 451      And I set the field "Select Item a1" to "1"
 452      And I set the field "Select Item a2" to "1"
 453      And I set the field "Select Item a3" to "1"
 454      And I set the field "Select Item a4" to "1"
 455      And I select "Course 1" from the "Move selected items to" singleselect
 456      And I navigate to "Grader report" node in "Grade administration"
 457      And I follow "Edit   Item a1"
 458      And the field "Weight adjusted" matches value "0"
 459      And the field "Extra credit" matches value "0"
 460      And I press "Cancel"
 461      And I follow "Edit   Item a2"
 462      And the field "Weight adjusted" matches value "0"
 463      And the field "Extra credit" matches value "0"
 464      And I press "Cancel"
 465      And I follow "Edit   Item a3"
 466      And the field "Weight adjusted" matches value "0"
 467      And the field "Extra credit" matches value "0"
 468      And I press "Cancel"
 469      And I follow "Edit   Item a4"
 470      And the field "Weight adjusted" matches value "0"
 471      And the field "Extra credit" matches value "0"
 472      And I press "Cancel"


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