1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: Questions in the question bank have versions
|
|
|
3 |
In order to see modified questions
|
|
|
4 |
As a teacher
|
|
|
5 |
I want to view them as different versions
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "question categories" exist:
|
|
|
18 |
| contextlevel | reference | name |
|
|
|
19 |
| Course | C1 | Test questions |
|
|
|
20 |
And the following "activities" exist:
|
|
|
21 |
| activity | name | course | idnumber |
|
|
|
22 |
| quiz | Quiz 1 | C1 | quiz1 |
|
|
|
23 |
And the following "questions" exist:
|
|
|
24 |
| questioncategory | qtype | name | questiontext | answer 1 |
|
|
|
25 |
| Test questions | truefalse | First question | Answer the first question | True |
|
|
|
26 |
And quiz "Quiz 1" contains the following questions:
|
|
|
27 |
| question | page |
|
|
|
28 |
| First question | 1 |
|
|
|
29 |
|
|
|
30 |
@javascript
|
|
|
31 |
Scenario: Question version is displayed
|
|
|
32 |
Given I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
|
|
33 |
When I choose "Edit question" action for "First question" in the question bank
|
|
|
34 |
Then I should see "Version 1"
|
|
|
35 |
|
|
|
36 |
@javascript
|
|
|
37 |
Scenario: Question version change when question is altered
|
|
|
38 |
Given I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
|
|
39 |
When I choose "Edit question" action for "First question" in the question bank
|
|
|
40 |
And I should see "Version 1"
|
|
|
41 |
When I set the field "id_name" to "Renamed question v2"
|
|
|
42 |
And I set the field "id_questiontext" to "edited question"
|
|
|
43 |
And I press "id_submitbutton"
|
|
|
44 |
Then I should not see "First question"
|
|
|
45 |
And I should see "Renamed question v2"
|
|
|
46 |
When I choose "Edit question" action for "Renamed question v2" in the question bank
|
|
|
47 |
Then I should see "Version 2"
|
|
|
48 |
And I should not see "Version 1"
|