Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_lesson
2
Feature: In a lesson activity, students can not re-attempt a question more than the allowed amount
3
  In order to check a lesson question can not be attempted more than the allowed amount
4
  As a student I need to check I cannot reattempt a question more than I should be allowed
5
 
6
  Background:
7
    Given the following "users" exist:
8
      | username | firstname | lastname | email |
9
      | teacher1 | Teacher | 1 | teacher1@example.com |
10
      | student1 | Student | 1 | student1@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
      | teacher1 | C1 | editingteacher |
17
      | student1 | C1 | student |
18
    And the following "activity" exists:
19
      | activity                 | lesson                  |
20
      | course                   | C1                      |
21
      | idnumber                 | 0001                    |
22
      | name                     | Test lesson name        |
23
      | retake                   | 1                       |
24
      | minquestions             | 3                       |
25
    And the following "mod_lesson > pages" exist:
26
      | lesson           | qtype     | title                 | content                   |
27
      | Test lesson name | content   | First page name       | First page contents       |
28
      | Test lesson name | truefalse | True/false question 1 | The earth is round.       |
29
      | Test lesson name | truefalse | True/false question 2 | Kermit is a frog          |
30
      | Test lesson name | content   | Second page name      | Second page contents      |
31
      | Test lesson name | truefalse | True/false question 3 | Paper is made from trees. |
32
      | Test lesson name | content   | Third page name       | Third page contents       |
33
    And the following "mod_lesson > answers" exist:
34
      | page                  | answer        | response | jumpto        | score |
35
      | First page name       | Next page     |          | Next page     | 0     |
36
      | Second page name      | Previous page |          | Previous page | 0     |
37
      | Second page name      | Next page     |          | Next page     | 0     |
38
      | True/false question 1 | True          | Correct  | Next page     | 1     |
39
      | True/false question 1 | False         | Wrong    | This page     | 0     |
40
      | True/false question 2 | True          | Correct  | Next page     | 1     |
41
      | True/false question 2 | False         | Wrong    | This page     | 0     |
42
      | True/false question 3 | True          | Correct  | Next page     | 1     |
43
      | True/false question 3 | False         | Wrong    | This page     | 0     |
44
      | Third page name       | Previous page |          | Previous page | 0     |
45
      | Third page name       | Next page     |          | Next page     | 0     |
46
 
47
  Scenario: Check that we can leave a quiz and when we re-enter we can not re-attempt the question again
48
    Given I am on the "Test lesson name" "lesson activity" page logged in as student1
49
    And I should see "First page contents"
50
    And I press "Next page"
51
    And I should see "The earth is round"
52
    And I set the following fields to these values:
53
      | False| 1 |
54
    And I press "Submit"
55
    And I should see "Wrong"
56
    And I am on the "Test lesson name" "lesson activity" page
57
    And I should see "Do you want to start at the last page you saw?"
58
    And I click on "No" "link" in the "#page-content" "css_element"
59
    And I should see "First page contents"
60
    And I press "Next page"
61
    And I should see "The earth is round"
62
    And I set the following fields to these values:
63
      | False| 1 |
64
    When I press "Submit"
65
    Then I should see "Maximum number of attempts reached - Moving to next page"
66
 
67
  @javascript @_bug_phantomjs
68
  Scenario: Check that we can not click back on the browser at the last quiz result page and re-attempt the last question to get full marks
69
    Given I am on the "Test lesson name" "lesson activity" page logged in as student1
70
    And I should see "First page contents"
71
    And I press "Next page"
72
    And I should see "The earth is round"
73
    And I set the following fields to these values:
74
      | True| 1 |
75
    And I press "Submit"
76
    And I should see "Correct"
77
    And I press "Continue"
78
    And I should see "Kermit is a frog"
79
    And I set the following fields to these values:
80
      | True| 1 |
81
    And I press "Submit"
82
    And I should see "Correct"
83
    And I press "Continue"
84
    And I should see "Second page contents"
85
    And I press "Next page"
86
    And I should see "Paper is made from trees"
87
    And I set the following fields to these values:
88
      | False | 1 |
89
    And I press "Submit"
90
    And I should see "Wrong"
91
    And I press "Continue"
92
    And I should see "Third page contents"
93
    And I press "Next page"
94
    And I should see "Congratulations - end of lesson reached"
95
    And I should see "Your score is 2 (out of 3)"
96
    And I press the "back" button in the browser
97
    And I press the "back" button in the browser
98
    And I press the "back" button in the browser
99
    And I should see "Paper is made from trees"
100
    And I set the following fields to these values:
101
      | True | 1 |
102
    And I press "Submit"
103
    And I should see "Correct"
104
    And I press "Continue"
105
    And I should see "Third page contents"
106
    When I press "Next page"
107
    Then I should see "Number of questions answered: 1 (You should answer at least 3)"
108
 
109
  @javascript
110
  Scenario: Check that we can not click back on the browser and re-attempt a question
111
    Given I am on the "Test lesson name" "lesson activity" page logged in as student1
112
    And I should see "First page contents"
113
    And I press "Next page"
114
    And I should see "The earth is round"
115
    And I set the following fields to these values:
116
      | False | 1 |
117
    And I press "Submit"
118
    And I should see "Wrong"
119
    And I press the "back" button in the browser
120
    And I set the following fields to these values:
121
      | True | 1 |
122
    When I press "Submit"
123
    Then I should see "Maximum number of attempts reached - Moving to next page"
124
    And I press "Continue"
125
    And I should see "Kermit is a frog"
126
    And I set the following fields to these values:
127
      | False | 1 |
128
    And I press "Submit"
129
    And I should see "Wrong"
130
    And I press the "back" button in the browser
131
    And I set the following fields to these values:
132
      | True | 1 |
133
    And I press "Submit"
134
    And I should see "Maximum number of attempts reached - Moving to next page"
135
    And I press "Continue"
136
    And I should see "Second page contents"
137
    And I press "Next page"
138
    And I should see "Paper is made from trees"
139
    And I set the following fields to these values:
140
      | True | 1 |
141
    And I press "Submit"
142
    And I should see "Correct"
143
    And I press the "back" button in the browser
144
    And I set the following fields to these values:
145
      | False | 1 |
146
    And I press "Submit"
147
    And I should see "Maximum number of attempts reached - Moving to next page"
148
    And I press "Continue"
149
    And I should see "Third page contents"
150
    And I press "Next page"
151
    And I should see "Congratulations - end of lesson reached"
152
    And I should see "Your score is 1 (out of 3)"