1 |
efrain |
1 |
@mod @mod_quiz
|
|
|
2 |
Feature: Teachers can override the grade for any question
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to correct errors
|
|
|
5 |
I must be able to override the grades that Moodle gives.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student0@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "question categories" exist:
|
|
|
20 |
| contextlevel | reference | name |
|
|
|
21 |
| Course | C1 | Test questions |
|
|
|
22 |
And the following "questions" exist:
|
|
|
23 |
| questioncategory | qtype | name | questiontext | defaultmark |
|
|
|
24 |
| Test questions | essay | TF1 | First question | 20 |
|
|
|
25 |
And the following "activities" exist:
|
|
|
26 |
| activity | name | intro | course | idnumber | grade |
|
|
|
27 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 20 |
|
|
|
28 |
And quiz "Quiz 1" contains the following questions:
|
|
|
29 |
| question | page |
|
|
|
30 |
| TF1 | 1 |
|
|
|
31 |
And the following "user private files" exist:
|
11 |
efrain |
32 |
| user | filepath |
|
|
|
33 |
| teacher1 | mod/quiz/tests/fixtures/moodle_logo.jpg |
|
1 |
efrain |
34 |
And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1"
|
|
|
35 |
And I press "Attempt quiz"
|
|
|
36 |
And I follow "Finish attempt ..."
|
|
|
37 |
And I press "Submit all and finish"
|
|
|
38 |
And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
|
|
|
39 |
And I log out
|
|
|
40 |
|
|
|
41 |
@javascript @_switch_window @_bug_phantomjs
|
|
|
42 |
Scenario: Validating the marking of an essay question attempt.
|
|
|
43 |
When I am on the "Quiz 1 > student1 > Attempt 1" "mod_quiz > Attempt review" page logged in as "teacher1"
|
|
|
44 |
And I follow "Make comment or override mark"
|
|
|
45 |
And I switch to "commentquestion" window
|
|
|
46 |
And I set the field "Mark" to "25"
|
|
|
47 |
And I press "Save"
|
|
|
48 |
Then I should see "This grade is outside the valid range."
|
|
|
49 |
And I set the field "Mark" to "aa"
|
|
|
50 |
And I press "Save"
|
|
|
51 |
And I should see "That is not a valid number."
|
|
|
52 |
And I set the field "Mark" to "10.0"
|
|
|
53 |
And I press "Save" and switch to main window
|
|
|
54 |
And I should see "Complete" in the "Manually graded 10 with comment: " "table_row"
|
|
|
55 |
And I follow "Make comment or override mark"
|
|
|
56 |
And I switch to "commentquestion" window
|
|
|
57 |
And I should see "Teacher 1" in the "Manually graded 10 with comment: " "table_row"
|
|
|
58 |
|
|
|
59 |
@javascript @_switch_window @_file_upload @_bug_phantomjs @editor_tiny
|
|
|
60 |
Scenario: Comment on a response to an essay question attempt.
|
|
|
61 |
When I log in as "teacher1"
|
|
|
62 |
And I am on the "Quiz 1 > student1 > Attempt 1" "mod_quiz > Attempt review" page
|
|
|
63 |
And I follow "Make comment or override mark"
|
|
|
64 |
And I switch to "commentquestion" window
|
|
|
65 |
And I set the field "Comment" to "Administrator's comment"
|
|
|
66 |
And I select the "p" element in position "0" of the "Comment" TinyMCE editor
|
|
|
67 |
And I click on the "Image" button for the "Comment" TinyMCE editor
|
|
|
68 |
And I click on "Browse repositories" "button" in the "Insert image" "dialogue"
|
|
|
69 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
70 |
And I click on "moodle_logo.jpg" "link"
|
|
|
71 |
And I click on "Select this file" "button"
|
11 |
efrain |
72 |
And I set the field "How would you describe this image to someone who can't see it?" to "It's the logo"
|
1 |
efrain |
73 |
And I click on "Save" "button" in the "Image details" "dialogue"
|
|
|
74 |
And I press "Save" and switch to main window
|
|
|
75 |
And I switch to the main window
|
|
|
76 |
Then I should see "Commented: [It's the logo]" in the ".history table" "css_element"
|
|
|
77 |
And "//img[contains(@src, 'moodle_logo.jpg')]" "xpath_element" should exist in the ".comment" "css_element"
|
|
|
78 |
# This time is same as time the window is open. So wait for it to close before proceeding.
|
|
|
79 |
And I wait "2" seconds
|