Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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:
1441 ariadna 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
      | qbank      | Qbank 1 | Qbank for testing  | C1     | qbank1   |
1 efrain 22
    And the following "question categories" exist:
1441 ariadna 23
      | contextlevel    | reference | name                |
24
      | Activity module | qbank1    | Questions Category 1|
25
      | Activity module | qbank1    | Questions Category 2|
1 efrain 26
    Given the following "questions" exist:
27
      | questioncategory     | qtype       | name        | questiontext           |
28
      | Questions Category 1 | description | Description | This is decription ... |
29
      | Questions Category 1 | truefalse   | Question A  | This is question 01    |
30
      | Questions Category 1 | truefalse   | Question B  | This is question 02    |
31
      | Questions Category 1 | truefalse   | Question C  | This is question 03    |
32
      | Questions Category 1 | truefalse   | Question D  | This is question 04    |
33
    And quiz "Quiz 1" contains the following questions:
34
      | question    | page | displaynumber |
35
      | Description | 1    |               |
36
      | Question A  | 1    | 1.a           |
37
      | Question B  | 1    | 1.b           |
38
      | Question C  | 2    |               |
39
      | Question D  | 2    |               |
40
    And quiz "Quiz 1" contains the following sections:
41
      | heading   | firstslot | shuffle |
42
      | Section 1 | 1         | 0       |
43
      | Section 2 | 4         | 0       |
44
 
45
  Scenario: Showing customised and default question numbers on quiz editing page.
46
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
47
    And I should see "Section 1"
48
    And I should see "i" on quiz page "1"
49
    And I should see "1.a" on quiz page "1"
50
    And I should see "1.b" on quiz page "1"
51
    And I should see "Section 2"
52
    And I should see "3" on quiz page "2"
53
    And I should see "4" on quiz page "2"
54
 
55
  Scenario: Showing customised and default question numbers on quiz view page and question navigation.
56
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher1"
57
    When I press "Preview quiz"
58
    Then I should see "Section 1" in the "Quiz navigation" "block"
59
    And I should see question "1.a" in section "Section 1" in the quiz navigation
60
    And I should see question "1.b" in section "Section 1" in the quiz navigation
61
    And I should see "Section 2" in the "Quiz navigation" "block"
62
    And I should see question "3" in section "Section 2" in the quiz navigation
63
    And I should see question "4" in section "Section 2" in the quiz navigation
64
 
65
    And I should see "Question 1.a"
66
    And I should see "Question 1.b"
67
    And I press "Next page"
68
    And I should see "Question 3"
69
    And I should see "Question 4"
70
 
71
  Scenario: Customised numbers are not used in shuffled sections, even if they exist in the database
72
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
73
    And I set the field "Shuffle" to "1"
74
    When I am on the "Quiz 1" "mod_quiz > View" page
75
    And I press "Preview quiz"
76
    Then I should see "Section 1" in the "Quiz navigation" "block"
77
    And I should see question "1" in section "Section 1" in the quiz navigation
78
    And I should see question "2" in section "Section 1" in the quiz navigation
79
    And I should see "Section 2" in the "Quiz navigation" "block"
80
    And I should see question "3" in section "Section 2" in the quiz navigation
81
    And I should see question "4" in section "Section 2" in the quiz navigation
82
 
83
    And I should see "Question 1"
84
    And I should see "Question 2"
85
    And I press "Next page"
86
    And I should see "Question 3"
87
    And I should see "Question 4"
88
 
89
  Scenario: Showing long customised question numbers on quiz editing page and parcially hidden on question info and navigation.
90
    Given quiz "Quiz 2" contains the following questions:
91
      | question    | page | displaynumber    |
92
      | Question A  | 1    | ABCDEFGHIJKLMNOP |
93
      | Question B  | 2    | abcdefghijklmnop |
94
    And quiz "Quiz 2" contains the following sections:
95
      | heading   | firstslot | shuffle |
96
      | Section 1 | 1         | 0       |
97
      | Section 2 | 2         | 0       |
98
    When I am on the "Quiz 2" "mod_quiz > Edit" page logged in as "teacher1"
99
    And I should see "ABCDEFGHIJKLMNOP" on quiz page "1"
100
    And I should see "abcdefghijklmnop" on quiz page "2"
101
 
102
    And I am on the "Quiz 2" "mod_quiz > View" page logged in as "teacher1"
103
    And I press "Preview quiz"
104
    # Only "Question ABCDEFGH" is visible in the question info box.
105
    And I should see "Question ABCDEFGHIJKLMNOP"
106
    # Only 'ABC' is visible on the navigation button/link.
107
    And I should see question "ABCDEFGHIJKLMNOP" in section "Section 1" in the quiz navigation
108
    And I press "Next page"
109
    # Only "Question abcdefghij" is visible in the question info box.
110
    And I should see "Question abcdefghijklmnop"
111
    # Only 'abc' is visible on the navigation button/link.
112
    And I should see question "abcdefghijklmnop" in section "Section 2" in the quiz navigation
113
 
114
  Scenario: Shuffling questions within a section with customised question numbers.
115
    When I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
116
    Then I should see "Section 1"
117
    And I should see "i" on quiz page "1"
118
    And I should see "1.a" on quiz page "1"
119
    And I should see "1.b" on quiz page "1"
120
    And I should see "Section 2"
121
    And I should see "3" on quiz page "2"
122
    And I should see "4" on quiz page "2"
123
 
124
    And I set the field "Shuffle" to "1"
125
    And I should see "Section 1"
126
    And I should see "i" on quiz page "1"
127
    And I should see "1" on quiz page "1"
128
    And I should see "2" on quiz page "1"
129
    And I should see "Section 2"
130
    And I should see "3" on quiz page "2"
131
    And I should see "4" on quiz page "2"
132
    And I reload the page
133
 
134
    And I set the field "Shuffle" to "0"
135
    And I should see "Section 1"
136
    And I should see "i" on quiz page "1"
137
    And I should see "1.a" on quiz page "1"
138
    And I should see "1.b" on quiz page "1"