MDL-63185 mod_quiz: replace existing tests to use new step
[moodle.git] / mod / quiz / report / grading / tests / behat / grading.feature
blob7ea18abc61736cdc7352d4b8583668fbe3fb6f83
1 @mod @mod_quiz
2 Feature: Basic use of the Manual grading report
3   In order to easily find students attempts that need manual grading
4   As a teacher
5   I need to use the manual grading report
7   @javascript
8   Scenario: Use the Manual grading report
9     Given the following "users" exist:
10       | username | firstname | lastname | email                | idnumber |
11       | teacher1 | T1        | Teacher1 | teacher1@example.com | T1000    |
12       | student1 | S1        | Student1 | student1@example.com | S1000    |
13     And the following "courses" exist:
14       | fullname | shortname | category |
15       | Course 1 | C1        | 0        |
16     And the following "course enrolments" exist:
17       | user     | course | role           |
18       | teacher1 | C1     | editingteacher |
19       | student1 | C1     | student        |
20     And the following "question categories" exist:
21       | contextlevel | reference | name           |
22       | Course       | C1        | Test questions |
23     And the following "questions" exist:
24       | questioncategory | qtype     | name       | questiontext        | answer 1 | grade |
25       | Test questions   | shortanswer | Short answer 001 | Where is the capital city of France? | Paris | 100% |
26     And the following "activities" exist:
27       | activity   | name   | course | idnumber |
28       | quiz       | Quiz 1 | C1     | quiz1    |
29     And quiz "Quiz 1" contains the following questions:
30       | question   | page |
31       | Short answer 001 | 1    |
33     # Check report shows nothing when there are no attempts.
34     When I log in as "teacher1"
35     And I am on "Course 1" course homepage
36     And I follow "Quiz 1"
37     And I navigate to "Results > Manual grading" in current page administration
38     Then I should see "Manual grading"
39     And I should see "Quiz 1"
40     And I should see "Nothing to display"
41     And I follow "Also show questions that have been graded automatically"
42     And I should see "Nothing to display"
44     # Use the manual grading report.
45     And user "student1" has attempted "Quiz 1" with responses:
46       | slot | response |
47       |   1  | Paris    |
48     And I reload the page
49     And I should see "Short answer 001"
50     And "Short answer 001" row "To grade" column of "questionstograde" table should contain "0"
51     And "Short answer 001" row "Already graded" column of "questionstograde" table should contain "0"
53     # Adjust the mark for Student1.
54     And I click on "update grades" "link" in the "Short answer 001" "table_row"
55     And I set the field "Comment" to "I have adjusted your mark to 0.6"
56     And I set the field "Mark" to "0.6"
57     And I press "Save and go to next page"
58     And I should see "All selected attempts have been graded. Returning to the list of questions."
59     And "Short answer 001" row "To grade" column of "questionstograde" table should contain "0"
60     And "Short answer 001" row "Already graded" column of "questionstograde" table should contain "1"