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
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        |
1441 ariadna 14
    And the following "activities" exist:
15
      | activity | name    | intro              | course | idnumber |
16
      | qbank    | Qbank 1 | Question bank 1    | C1     | qbank1   |
1 efrain 17
    And the following "course enrolments" exist:
18
      | user     | course | role    |
19
      | student  | C1     | student |
20
    And the following "question categories" exist:
1441 ariadna 21
      | contextlevel    | reference | name           |
22
      | Activity module | qbank1    | Test questions |
1 efrain 23
    And the following "questions" exist:
24
      | questioncategory | qtype       | name  | questiontext               |
25
      | Test questions   | truefalse   | TF1   | Text of the first question |
26
 
27
  @javascript
28
  Scenario: Start a quiz with no time limit
29
    Given the following "activities" exist:
30
      | activity   | name   | intro              | course | idnumber |
31
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
32
    And quiz "Quiz 1" contains the following questions:
33
      | question | page |
34
      | TF1      | 1    |
35
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
36
    And I press "Attempt quiz"
37
    Then I should see "Text of the first question"
38
    And I should not see "v1" in the "Question 1" "question"
39
 
40
  @javascript
41
  Scenario: Start a quiz with time limit and password
42
    Given the following "activities" exist:
43
      | activity   | name   | intro              | course | idnumber | timelimit | quizpassword |
44
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | 3600      | Frog         |
45
    And quiz "Quiz 1" contains the following questions:
46
      | question | page |
47
      | TF1      | 1    |
48
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
49
    And I press "Attempt quiz"
50
    Then I should see "To attempt this quiz you need to know the quiz password" in the "Start attempt" "dialogue"
51
    And I should see "Your attempt will have a time limit of 1 hour. When you " in the "Start attempt" "dialogue"
52
    And I set the field "Quiz password" to "Frog"
53
    And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
54
    And I should see "Text of the first question"
55
 
56
  @javascript
57
  Scenario: Cancel starting a quiz with time limit and password
58
    Given the following "activities" exist:
59
      | activity   | name   | intro              | course | idnumber | timelimit | quizpassword |
60
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | 3600      | Frog         |
61
    And quiz "Quiz 1" contains the following questions:
62
      | question | page |
63
      | TF1      | 1    |
64
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
65
    And I press "Attempt quiz"
66
    And I click on "Cancel" "button" in the "Start attempt" "dialogue"
67
    Then I should see "Quiz 1 description"
68
    And "Attempt quiz" "button" should be visible
69
 
70
  @javascript
71
  Scenario: Start a quiz with time limit and password, get the password wrong first time
72
    Given the following "activities" exist:
73
      | activity   | name   | intro              | course | idnumber | timelimit | quizpassword |
74
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | 3600      | Frog         |
75
    And quiz "Quiz 1" contains the following questions:
76
      | question | page |
77
      | TF1      | 1    |
78
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
79
    And I press "Attempt quiz"
80
    And I set the field "Quiz password" to "Toad"
81
    And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
82
    Then I should see "Quiz 1 description"
83
    And I should see "To attempt this quiz you need to know the quiz password"
84
    And I should see "Your attempt will have a time limit of 1 hour. When you "
85
    And I should see "The password entered was incorrect"
86
    And I set the field "Quiz password" to "Frog"
87
    And I press "Start attempt"
88
    And I should see "Text of the first question"
89
 
90
  @javascript
91
  Scenario: Start a quiz with time limit and password, get the password wrong first time then cancel
92
    Given the following "activities" exist:
93
      | activity   | name   | intro              | course | idnumber | timelimit | quizpassword |
94
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | 3600      | Frog         |
95
    And quiz "Quiz 1" contains the following questions:
96
      | question | page |
97
      | TF1      | 1    |
98
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
99
    And I press "Attempt quiz"
100
    And I set the field "Quiz password" to "Toad"
101
    And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
102
    And I should see "Quiz 1 description"
103
    And I should see "To attempt this quiz you need to know the quiz password"
104
    And I should see "Your attempt will have a time limit of 1 hour. When you "
105
    And I should see "The password entered was incorrect"
106
    And I set the field "Quiz password" to "Frog"
107
    And I press "Cancel"
108
    Then I should see "Quiz 1 description"
109
    And "Attempt quiz" "button" should be visible
1441 ariadna 110
 
111
  @javascript
112
  Scenario: Quiz attempt page reloads upon navigating back using the browser's back button
113
    Given the following "activities" exist:
114
      | activity   | name   | intro              | course | idnumber | timelimit |
115
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | 3600      |
116
    And quiz "Quiz 1" contains the following questions:
117
      | question | page |
118
      | TF1      | 1    |
119
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
120
    And I press "Attempt quiz"
121
    And I should see "Your attempt will have a time limit of 1 hour. When you " in the "Start attempt" "dialogue"
122
    And I start watching to see if a new page loads
123
    And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
124
    And I press the "back" button in the browser
125
    Then a new page should have loaded since I started watching
126
    And I should see "Continue your attempt"
127
 
128
  @javascript
129
  Scenario: Start a quiz with pre-created attempts
130
    Given the following config values are set as admin:
131
      | precreateperiod | 1 | quiz |
132
    Given the following "activities" exist:
133
      | activity   | name   | intro              | course | idnumber | timeopen  | timelimit | quizpassword | attempts |
134
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | ## now ## | 3600      | Frog         | 1        |
135
    And quiz "Quiz 1" contains the following questions:
136
      | question | page |
137
      | TF1      | 1    |
138
    And quiz "Quiz 1" has pre-created attempts
139
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
140
    And I press "Attempt quiz"
141
    And I set the field "Quiz password" to "Frog"
142
    And I press "Start attempt"
143
    Then I should see "Text of the first question"