Skip to content

Commit

Permalink
MDL-56646 assign: Behat test rescaling after viewing student
Browse files Browse the repository at this point in the history
  • Loading branch information
xow authored and John Okely committed Aug 28, 2017
1 parent 9eb3c17 commit 64b5209
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mod/assign/tests/behat/rescale_grades.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student10@example.com |
| student2 | Student | 2 | student10@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
Expand Down Expand Up @@ -69,3 +71,18 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
When I press "Save and display"
And I navigate to "View all submissions" in current page administration
Then "Student 1" row "Grade" column of "generaltable" table should contain "20.00"

Scenario: Rescaling should not produce negative grades
Given I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 2" "table_row"
And I wait until the page is ready
And I follow "Assignment: Test assignment name"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "Rescale existing grades" to "Yes"
And I set the field "Maximum grade" to "50"
When I press "Save and display"
And I navigate to "View all submissions" in current page administration
# Since the decimal places are always displayed (e.g. 0.00), this will catch any grade. The student should not have one.
# We can't just check for - (empty grade) because a negative grade would also have that character.
Then "Student 2" row "Grade" column of "generaltable" table should not contain "."

0 comments on commit 64b5209

Please sign in to comment.