1 |
efrain |
1 |
@mod @mod_quiz @javascript
|
|
|
2 |
Feature: Editing question numbering of the existing questions already in a quiz
|
|
|
3 |
In order to have better assessment
|
|
|
4 |
As a teacher
|
|
|
5 |
I want to be able to customided question numbering on the quiz editing page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | t1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname |
|
|
|
13 |
| Course 1 | C1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | name | intro | course | idnumber |
|
|
|
19 |
| quiz | Quiz 1 | Quiz 1 for testing | C1 | quiz1 |
|
|
|
20 |
| quiz | Quiz 2 | Quiz 2 for testing | C1 | quiz2 |
|
|
|
21 |
And the following "question categories" exist:
|
|
|
22 |
| contextlevel | reference | name |
|
|
|
23 |
| Course | C1 | Questions Category 1|
|
|
|
24 |
| Course | C1 | Questions Category 2|
|
|
|
25 |
Given the following "questions" exist:
|
|
|
26 |
| questioncategory | qtype | name | questiontext |
|
|
|
27 |
| Questions Category 1 | description | Description | This is decription ... |
|
|
|
28 |
| Questions Category 1 | truefalse | Question A | This is question 01 |
|
|
|
29 |
| Questions Category 1 | truefalse | Question B | This is question 02 |
|
|
|
30 |
| Questions Category 1 | truefalse | Question C | This is question 03 |
|
|
|
31 |
| Questions Category 1 | truefalse | Question D | This is question 04 |
|
|
|
32 |
And quiz "Quiz 1" contains the following questions:
|
|
|
33 |
| question | page | displaynumber |
|
|
|
34 |
| Description | 1 | |
|
|
|
35 |
| Question A | 1 | 1.a |
|
|
|
36 |
| Question B | 1 | 1.b |
|
|
|
37 |
| Question C | 2 | |
|
|
|
38 |
| Question D | 2 | |
|
|
|
39 |
And quiz "Quiz 1" contains the following sections:
|
|
|
40 |
| heading | firstslot | shuffle |
|
|
|
41 |
| Section 1 | 1 | 0 |
|
|
|
42 |
| Section 2 | 4 | 0 |
|
|
|
43 |
|
|
|
44 |
Scenario: Showing customised and default question numbers on quiz editing page.
|
|
|
45 |
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
|
|
|
46 |
And I should see "Section 1"
|
|
|
47 |
And I should see "i" on quiz page "1"
|
|
|
48 |
And I should see "1.a" on quiz page "1"
|
|
|
49 |
And I should see "1.b" on quiz page "1"
|
|
|
50 |
And I should see "Section 2"
|
|
|
51 |
And I should see "3" on quiz page "2"
|
|
|
52 |
And I should see "4" on quiz page "2"
|
|
|
53 |
|
|
|
54 |
Scenario: Showing customised and default question numbers on quiz view page and question navigation.
|
|
|
55 |
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher1"
|
|
|
56 |
When I press "Preview quiz"
|
|
|
57 |
Then I should see "Section 1" in the "Quiz navigation" "block"
|
|
|
58 |
And I should see question "1.a" in section "Section 1" in the quiz navigation
|
|
|
59 |
And I should see question "1.b" in section "Section 1" in the quiz navigation
|
|
|
60 |
And I should see "Section 2" in the "Quiz navigation" "block"
|
|
|
61 |
And I should see question "3" in section "Section 2" in the quiz navigation
|
|
|
62 |
And I should see question "4" in section "Section 2" in the quiz navigation
|
|
|
63 |
|
|
|
64 |
And I should see "Question 1.a"
|
|
|
65 |
And I should see "Question 1.b"
|
|
|
66 |
And I press "Next page"
|
|
|
67 |
And I should see "Question 3"
|
|
|
68 |
And I should see "Question 4"
|
|
|
69 |
|
|
|
70 |
Scenario: Customised numbers are not used in shuffled sections, even if they exist in the database
|
|
|
71 |
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
|
|
|
72 |
And I set the field "Shuffle" to "1"
|
|
|
73 |
When I am on the "Quiz 1" "mod_quiz > View" page
|
|
|
74 |
And I press "Preview quiz"
|
|
|
75 |
Then I should see "Section 1" in the "Quiz navigation" "block"
|
|
|
76 |
And I should see question "1" in section "Section 1" in the quiz navigation
|
|
|
77 |
And I should see question "2" in section "Section 1" in the quiz navigation
|
|
|
78 |
And I should see "Section 2" in the "Quiz navigation" "block"
|
|
|
79 |
And I should see question "3" in section "Section 2" in the quiz navigation
|
|
|
80 |
And I should see question "4" in section "Section 2" in the quiz navigation
|
|
|
81 |
|
|
|
82 |
And I should see "Question 1"
|
|
|
83 |
And I should see "Question 2"
|
|
|
84 |
And I press "Next page"
|
|
|
85 |
And I should see "Question 3"
|
|
|
86 |
And I should see "Question 4"
|
|
|
87 |
|
|
|
88 |
Scenario: Showing long customised question numbers on quiz editing page and parcially hidden on question info and navigation.
|
|
|
89 |
Given quiz "Quiz 2" contains the following questions:
|
|
|
90 |
| question | page | displaynumber |
|
|
|
91 |
| Question A | 1 | ABCDEFGHIJKLMNOP |
|
|
|
92 |
| Question B | 2 | abcdefghijklmnop |
|
|
|
93 |
And quiz "Quiz 2" contains the following sections:
|
|
|
94 |
| heading | firstslot | shuffle |
|
|
|
95 |
| Section 1 | 1 | 0 |
|
|
|
96 |
| Section 2 | 2 | 0 |
|
|
|
97 |
When I am on the "Quiz 2" "mod_quiz > Edit" page logged in as "teacher1"
|
|
|
98 |
And I should see "ABCDEFGHIJKLMNOP" on quiz page "1"
|
|
|
99 |
And I should see "abcdefghijklmnop" on quiz page "2"
|
|
|
100 |
|
|
|
101 |
And I am on the "Quiz 2" "mod_quiz > View" page logged in as "teacher1"
|
|
|
102 |
And I press "Preview quiz"
|
|
|
103 |
# Only "Question ABCDEFGH" is visible in the question info box.
|
|
|
104 |
And I should see "Question ABCDEFGHIJKLMNOP"
|
|
|
105 |
# Only 'ABC' is visible on the navigation button/link.
|
|
|
106 |
And I should see question "ABCDEFGHIJKLMNOP" in section "Section 1" in the quiz navigation
|
|
|
107 |
And I press "Next page"
|
|
|
108 |
# Only "Question abcdefghij" is visible in the question info box.
|
|
|
109 |
And I should see "Question abcdefghijklmnop"
|
|
|
110 |
# Only 'abc' is visible on the navigation button/link.
|
|
|
111 |
And I should see question "abcdefghijklmnop" in section "Section 2" in the quiz navigation
|
|
|
112 |
|
|
|
113 |
Scenario: Shuffling questions within a section with customised question numbers.
|
|
|
114 |
When I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
|
|
|
115 |
Then I should see "Section 1"
|
|
|
116 |
And I should see "i" on quiz page "1"
|
|
|
117 |
And I should see "1.a" on quiz page "1"
|
|
|
118 |
And I should see "1.b" on quiz page "1"
|
|
|
119 |
And I should see "Section 2"
|
|
|
120 |
And I should see "3" on quiz page "2"
|
|
|
121 |
And I should see "4" on quiz page "2"
|
|
|
122 |
|
|
|
123 |
And I set the field "Shuffle" to "1"
|
|
|
124 |
And I should see "Section 1"
|
|
|
125 |
And I should see "i" on quiz page "1"
|
|
|
126 |
And I should see "1" on quiz page "1"
|
|
|
127 |
And I should see "2" on quiz page "1"
|
|
|
128 |
And I should see "Section 2"
|
|
|
129 |
And I should see "3" on quiz page "2"
|
|
|
130 |
And I should see "4" on quiz page "2"
|
|
|
131 |
And I reload the page
|
|
|
132 |
|
|
|
133 |
And I set the field "Shuffle" to "0"
|
|
|
134 |
And I should see "Section 1"
|
|
|
135 |
And I should see "i" on quiz page "1"
|
|
|
136 |
And I should see "1.a" on quiz page "1"
|
|
|
137 |
And I should see "1.b" on quiz page "1"
|