1 |
efrain |
1 |
@mod @mod_quiz @quiz @quiz_overview @javascript
|
|
|
2 |
Feature: Quiz regrade when not possible
|
|
|
3 |
In order avoid errors
|
|
|
4 |
As a teacher
|
|
|
5 |
I need the system to prevent impossible regrade scenarios
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname |
|
|
|
10 |
| teacher | Mark | Allwright |
|
|
|
11 |
| student | Student | One |
|
|
|
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 |
| teacher | C1 | editingteacher |
|
|
|
18 |
| student | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | course | idnumber |
|
|
|
21 |
| quiz | Quiz for testing regrading | C1 | quiz1 |
|
|
|
22 |
And the following "question categories" exist:
|
|
|
23 |
| contextlevel | reference | name |
|
|
|
24 |
| Activity module | quiz1 | Test questions |
|
|
|
25 |
And the following "questions" exist:
|
|
|
26 |
| questioncategory | qtype | template | name |
|
|
|
27 |
| Test questions | multichoice | one_of_four | MC |
|
|
|
28 |
And quiz "Quiz for testing regrading" contains the following questions:
|
|
|
29 |
| question | page | maxmark |
|
|
|
30 |
| MC | 1 | 10.0 |
|
|
|
31 |
And user "student" has attempted "Quiz for testing regrading" with responses:
|
|
|
32 |
| slot | response |
|
|
|
33 |
| 1 | B |
|
|
|
34 |
|
|
|
35 |
Scenario: Try a regrade after the question has been edited to have a different number of choices
|
|
|
36 |
# Edit the question so that V2 has the fourth choice removed.
|
|
|
37 |
Given I am on the "MC" "core_question > edit" page logged in as teacher
|
|
|
38 |
And I set the following fields to these values:
|
|
|
39 |
| Choice 4 | |
|
|
|
40 |
| id_feedback_3 | |
|
|
|
41 |
And I press "id_submitbutton"
|
|
|
42 |
|
|
|
43 |
# Try a regrade, and verify what happened is reported.
|
|
|
44 |
When I am on the "Quiz for testing regrading" "mod_quiz > grades report" page
|
|
|
45 |
And I press "Regrade all"
|
|
|
46 |
|
|
|
47 |
Then I should see "Quiz for testing regrading"
|
|
|
48 |
And I should see "The following questions could not be regraded in attempt 1 by Student One"
|
|
|
49 |
And I should see "Slot 1: The number of choices in the question has changed."
|
|
|
50 |
And I should see "Finished regrading (1/1)"
|
|
|
51 |
And I should see "Regrade completed"
|
|
|
52 |
And I press "Continue"
|
|
|
53 |
|
|
|
54 |
# These next tests just serve to check we got back to the report.
|
|
|
55 |
And I should see "Quiz for testing regrading"
|
|
|
56 |
And I should see "Overall number of students achieving grade ranges"
|