1441 |
ariadna |
1 |
@mod_quiz
|
|
|
2 |
Feature: A quiz with invalid question types should not be able to be attempted
|
|
|
3 |
As a teacher
|
|
|
4 |
If my quiz has questions with invalid types
|
|
|
5 |
I want my students to be unable to attempt the quiz until it is fixed
|
|
|
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 "activities" exist:
|
|
|
18 |
| activity | name | intro | course | idnumber |
|
|
|
19 |
| qbank | Qbank 1 | Question bank 1 | C1 | qbank1 |
|
|
|
20 |
And the following "question categories" exist:
|
|
|
21 |
| contextlevel | reference | name |
|
|
|
22 |
| Activity module | qbank1 | Test questions |
|
|
|
23 |
And the following "questions" exist:
|
|
|
24 |
| questioncategory | qtype | name | user | questiontext |
|
|
|
25 |
| Test questions | essay | Question 1 | admin | A text |
|
|
|
26 |
| Test questions | essay | Question 2 | admin | B text |
|
|
|
27 |
And the following "activities" exist:
|
|
|
28 |
| activity | name | intro | course | idnumber | grade | navmethod |
|
|
|
29 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 100 | free |
|
|
|
30 |
And quiz "Quiz 1" contains the following questions:
|
|
|
31 |
| question | page | maxmark |
|
|
|
32 |
| Question 1 | 1 | |
|
|
|
33 |
| Question 2 | 1 | |
|
|
|
34 |
And question "Question 2" is changed to simulate being of an uninstalled type
|
|
|
35 |
|
|
|
36 |
@javascript
|
|
|
37 |
Scenario: Quiz with invalid questions should disable attempts
|
|
|
38 |
Given I am logged in as "student"
|
|
|
39 |
When I am on the "Quiz 1" "mod_quiz > View" page
|
|
|
40 |
Then I should see "This quiz has questions with invalid types"
|
|
|
41 |
And I should not see "Attempt quiz"
|