1441 |
ariadna |
1 |
@mod @mod_quiz
|
|
|
2 |
Feature: Testing view quiz grade feedback with recover grades setting
|
|
|
3 |
As a user
|
|
|
4 |
I want the quiz grade and completion status to reflect the recover grades setting used when re-enrolling a user
|
|
|
5 |
|
|
|
6 |
Background:
|
|
|
7 |
Given the following "users" exist:
|
|
|
8 |
| username | firstname | lastname | email |
|
|
|
9 |
| teacher | Teacher | One | teacher@example.com |
|
|
|
10 |
| student | Student | One | student@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category | enablecompletion |
|
|
|
13 |
| Course 1 | C1 | 0 | 1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher | C1 | editingteacher |
|
|
|
17 |
| student | C1 | student |
|
|
|
18 |
And the following "activities" exist:
|
|
|
19 |
| activity | name | intro | course | idnumber | completion | completionusegrade |
|
|
|
20 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 2 | 1 |
|
|
|
21 |
And the following "question categories" exist:
|
|
|
22 |
| contextlevel | reference | name |
|
|
|
23 |
| Activity module | quiz1 | Test questions |
|
|
|
24 |
And the following "questions" exist:
|
|
|
25 |
| questioncategory | qtype | name | questiontext |
|
|
|
26 |
| Test questions | truefalse | TF1 | First question |
|
|
|
27 |
And quiz "Quiz 1" contains the following questions:
|
|
|
28 |
| question | page |
|
|
|
29 |
| TF1 | 1 |
|
|
|
30 |
And user "student" has attempted "Quiz 1" with responses:
|
|
|
31 |
| slot | response |
|
|
|
32 |
| 1 | True |
|
|
|
33 |
|
|
|
34 |
Scenario Outline: Teachers can view grade feedback and score regardless of recover grades setting
|
|
|
35 |
Given the following config values are set as admin:
|
|
|
36 |
| recovergradesdefault | <recovergradesetting> |
|
|
|
37 |
And user "teacher" has attempted "Quiz 1" with responses:
|
|
|
38 |
| slot | response |
|
|
|
39 |
| 1 | True |
|
|
|
40 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
|
|
|
41 |
# Grade feedback and grade score should be the same. Recover grades setting should not affect the score
|
|
|
42 |
Then I should see "Highest grade: 100.00 / 100.00"
|
|
|
43 |
And I should see "100.00 out of 100.00" in the "Grade" "table_row"
|
|
|
44 |
|
|
|
45 |
Examples:
|
|
|
46 |
| recovergradesetting |
|
|
|
47 |
| 0 |
|
|
|
48 |
| 1 |
|
|
|
49 |
|
|
|
50 |
Scenario Outline: View quiz grade feedback and score with recover grades settings
|
|
|
51 |
Given the following config values are set as admin:
|
|
|
52 |
| recovergradesdefault | <recovergradesetting> |
|
|
|
53 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
54 |
# Grade feedback and grade score should be the same. Recover grades setting should not affect users who are not unenrolled
|
|
|
55 |
Then I should see "Highest grade: 100.00 / 100.00"
|
|
|
56 |
And I should see "100.00 out of 100.00" in the "Grade" "table_row"
|
|
|
57 |
And I should see "Done: Receive a grade" in the "[data-region='completion-info']" "css_element"
|
|
|
58 |
|
|
|
59 |
Examples:
|
|
|
60 |
| recovergradesetting |
|
|
|
61 |
| 0 |
|
|
|
62 |
| 1 |
|
|
|
63 |
|
|
|
64 |
@javascript
|
|
|
65 |
Scenario Outline: View quiz after unenrolling and re-enrolling user
|
|
|
66 |
Given the following config values are set as admin:
|
|
|
67 |
| recovergradesdefault | <recovergradesetting> |
|
|
|
68 |
And I log in as "teacher"
|
|
|
69 |
And I am on "Course 1" course homepage
|
|
|
70 |
And I navigate to course participants
|
|
|
71 |
And I click on "Unenrol" "icon" in the "Student One" "table_row"
|
|
|
72 |
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
|
|
|
73 |
And the following "course enrolments" exist:
|
|
|
74 |
| user | course | role |
|
|
|
75 |
| student | C1 | student |
|
|
|
76 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
77 |
Then I should see "<overallgradefeedback>" in the "[id='feedback']" "css_element"
|
|
|
78 |
And I should see "100.00 out of 100.00" in the "Grade" "table_row"
|
|
|
79 |
And I should see "<mycompletionstatus>" in the "[data-region='completion-info']" "css_element"
|
|
|
80 |
# Re-attempt the quiz
|
|
|
81 |
And I press "Re-attempt quiz"
|
|
|
82 |
And I should see "First question"
|
|
|
83 |
And I click on "True" "radio" in the "First question" "question"
|
|
|
84 |
And I click on "Finish attempt ..." "button" in the "region-main" "region"
|
|
|
85 |
And I press "Submit all and finish"
|
|
|
86 |
And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
|
|
|
87 |
And I follow "Finish review"
|
|
|
88 |
And I should see "Highest grade: 100.00 / 100.00" in the "[id='feedback']" "css_element"
|
|
|
89 |
|
|
|
90 |
Examples:
|
|
|
91 |
| recovergradesetting | overallgradefeedback | mycompletionstatus |
|
|
|
92 |
| 0 | Highest grade: Not yet graded / 100.00 | To do: Receive a grade |
|
|
|
93 |
| 1 | Highest grade: 100.00 / 100.00 | Done: Receive a grade |
|