1 |
efrain |
1 |
@qtype @qtype_ddwtos
|
|
|
2 |
Feature: Test editing a drag and drop into text questions
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to be able to update my drag and drop into text questions
|
|
|
5 |
I need to edit them
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username |
|
|
|
10 |
| teacher |
|
|
|
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 |
| teacher | C1 | editingteacher |
|
|
|
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 | template |
|
|
|
22 |
| Test questions | ddwtos | Drag to text | fox |
|
|
|
23 |
|
|
|
24 |
@javascript
|
|
|
25 |
Scenario: Edit a drag and drop into text question
|
|
|
26 |
When I am on the "Drag to text" "core_question > edit" page logged in as teacher
|
|
|
27 |
And I should see "Choice [[1]]"
|
|
|
28 |
And I should see "Choice [[2]]"
|
|
|
29 |
And I should see "Choice [[3]]"
|
|
|
30 |
And I set the following fields to these values:
|
|
|
31 |
| Question name | Edited question name |
|
|
|
32 |
And I press "id_submitbutton"
|
|
|
33 |
Then I should see "Edited question name"
|
|
|
34 |
|
|
|
35 |
Scenario: Cannot update a drag and drop into text question to the unsolvable questions
|
|
|
36 |
When I am on the "Drag to text" "core_question > edit" page logged in as teacher
|
|
|
37 |
And I should see "Choice [[1]]"
|
|
|
38 |
And I should see "Choice [[2]]"
|
|
|
39 |
And I should see "Choice [[3]]"
|
|
|
40 |
And I set the following fields to these values:
|
|
|
41 |
| Question name | Edited question name |
|
|
|
42 |
| Question text | Choice [[1]] Choice [[2]] Choice [[1]] |
|
|
|
43 |
And I press "id_submitbutton"
|
|
|
44 |
Then I should see "Choice [[1]] has been used more than once without being set to \"Unlimited\". Please recheck this question."
|