1 |
efrain |
1 |
@mod @mod_quiz
|
|
|
2 |
Feature: The various checks that may happen when an attept is started
|
|
|
3 |
As a student
|
|
|
4 |
In order to start a quiz with confidence
|
|
|
5 |
I need to be waned if there is a time limit, or various similar things
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student | Student | One | student@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| student | C1 | student |
|
|
|
17 |
And the following "question categories" exist:
|
|
|
18 |
| contextlevel | reference | name |
|
|
|
19 |
| Course | C1 | Test questions |
|
|
|
20 |
And the following "questions" exist:
|
|
|
21 |
| questioncategory | qtype | name | questiontext |
|
|
|
22 |
| Test questions | truefalse | TF1 | Text of the first question |
|
|
|
23 |
|
|
|
24 |
@javascript
|
|
|
25 |
Scenario: Start a quiz with no time limit
|
|
|
26 |
Given the following "activities" exist:
|
|
|
27 |
| activity | name | intro | course | idnumber |
|
|
|
28 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
|
|
|
29 |
And quiz "Quiz 1" contains the following questions:
|
|
|
30 |
| question | page |
|
|
|
31 |
| TF1 | 1 |
|
|
|
32 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
33 |
And I press "Attempt quiz"
|
|
|
34 |
Then I should see "Text of the first question"
|
|
|
35 |
And I should not see "v1" in the "Question 1" "question"
|
|
|
36 |
|
|
|
37 |
@javascript
|
|
|
38 |
Scenario: Start a quiz with time limit and password
|
|
|
39 |
Given the following "activities" exist:
|
|
|
40 |
| activity | name | intro | course | idnumber | timelimit | quizpassword |
|
|
|
41 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 3600 | Frog |
|
|
|
42 |
And quiz "Quiz 1" contains the following questions:
|
|
|
43 |
| question | page |
|
|
|
44 |
| TF1 | 1 |
|
|
|
45 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
46 |
And I press "Attempt quiz"
|
|
|
47 |
Then I should see "To attempt this quiz you need to know the quiz password" in the "Start attempt" "dialogue"
|
|
|
48 |
And I should see "Your attempt will have a time limit of 1 hour. When you " in the "Start attempt" "dialogue"
|
|
|
49 |
And I set the field "Quiz password" to "Frog"
|
|
|
50 |
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
|
|
|
51 |
And I should see "Text of the first question"
|
|
|
52 |
|
|
|
53 |
@javascript
|
|
|
54 |
Scenario: Cancel starting a quiz with time limit and password
|
|
|
55 |
Given the following "activities" exist:
|
|
|
56 |
| activity | name | intro | course | idnumber | timelimit | quizpassword |
|
|
|
57 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 3600 | Frog |
|
|
|
58 |
And quiz "Quiz 1" contains the following questions:
|
|
|
59 |
| question | page |
|
|
|
60 |
| TF1 | 1 |
|
|
|
61 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
62 |
And I press "Attempt quiz"
|
|
|
63 |
And I click on "Cancel" "button" in the "Start attempt" "dialogue"
|
|
|
64 |
Then I should see "Quiz 1 description"
|
|
|
65 |
And "Attempt quiz" "button" should be visible
|
|
|
66 |
|
|
|
67 |
@javascript
|
|
|
68 |
Scenario: Start a quiz with time limit and password, get the password wrong first time
|
|
|
69 |
Given the following "activities" exist:
|
|
|
70 |
| activity | name | intro | course | idnumber | timelimit | quizpassword |
|
|
|
71 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 3600 | Frog |
|
|
|
72 |
And quiz "Quiz 1" contains the following questions:
|
|
|
73 |
| question | page |
|
|
|
74 |
| TF1 | 1 |
|
|
|
75 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
76 |
And I press "Attempt quiz"
|
|
|
77 |
And I set the field "Quiz password" to "Toad"
|
|
|
78 |
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
|
|
|
79 |
Then I should see "Quiz 1 description"
|
|
|
80 |
And I should see "To attempt this quiz you need to know the quiz password"
|
|
|
81 |
And I should see "Your attempt will have a time limit of 1 hour. When you "
|
|
|
82 |
And I should see "The password entered was incorrect"
|
|
|
83 |
And I set the field "Quiz password" to "Frog"
|
|
|
84 |
And I press "Start attempt"
|
|
|
85 |
And I should see "Text of the first question"
|
|
|
86 |
|
|
|
87 |
@javascript
|
|
|
88 |
Scenario: Start a quiz with time limit and password, get the password wrong first time then cancel
|
|
|
89 |
Given the following "activities" exist:
|
|
|
90 |
| activity | name | intro | course | idnumber | timelimit | quizpassword |
|
|
|
91 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 3600 | Frog |
|
|
|
92 |
And quiz "Quiz 1" contains the following questions:
|
|
|
93 |
| question | page |
|
|
|
94 |
| TF1 | 1 |
|
|
|
95 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
96 |
And I press "Attempt quiz"
|
|
|
97 |
And I set the field "Quiz password" to "Toad"
|
|
|
98 |
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
|
|
|
99 |
And I should see "Quiz 1 description"
|
|
|
100 |
And I should see "To attempt this quiz you need to know the quiz password"
|
|
|
101 |
And I should see "Your attempt will have a time limit of 1 hour. When you "
|
|
|
102 |
And I should see "The password entered was incorrect"
|
|
|
103 |
And I set the field "Quiz password" to "Frog"
|
|
|
104 |
And I press "Cancel"
|
|
|
105 |
Then I should see "Quiz 1 description"
|
|
|
106 |
And "Attempt quiz" "button" should be visible
|