1 |
efrain |
1 |
@qtype @qtype_ddimageortext
|
|
|
2 |
Feature: Test creating a drag and drop onto image question
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to test my students
|
|
|
5 |
I need to be able to create drag and drop onto image questions
|
|
|
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 |
|
|
|
18 |
@javascript @_file_upload
|
|
|
19 |
Scenario: Create a drag and drop onto image question
|
|
|
20 |
When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
|
|
|
21 |
And I press "Create a new question ..."
|
|
|
22 |
And I set the field "Drag and drop onto image" to "1"
|
|
|
23 |
And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
|
|
|
24 |
And I set the field "Question name" to "Drag and drop onto image 001"
|
|
|
25 |
And I set the field "Question text" to "Identify the features in this cross-section."
|
|
|
26 |
And I set the field "General feedback" to "The locations are now labelled on the diagram below."
|
|
|
27 |
And I upload "question/type/ddimageortext/tests/fixtures/oceanfloorbase.jpg" file to "Background image" filemanager
|
|
|
28 |
|
|
|
29 |
# Draggable items
|
|
|
30 |
And I follow "Draggable items"
|
|
|
31 |
And I press "Blanks for 3 more draggable items"
|
|
|
32 |
|
|
|
33 |
And I set the field "id_shuffleanswers" to "1"
|
|
|
34 |
And I set the field "id_drags_0_dragitemtype" to "Draggable text"
|
|
|
35 |
And I set the field "id_draglabel_0" to "island<br/>arc"
|
|
|
36 |
|
|
|
37 |
And I set the field "id_drags_1_dragitemtype" to "Draggable text"
|
|
|
38 |
And I set the field "id_draglabel_1" to "mid-ocean<br/>ridge"
|
|
|
39 |
|
|
|
40 |
And I set the field "id_drags_2_dragitemtype" to "Draggable text"
|
|
|
41 |
And I set the field "id_draglabel_2" to "abyssal<br/>plain"
|
|
|
42 |
|
|
|
43 |
And I set the field "id_drags_3_dragitemtype" to "Draggable text"
|
|
|
44 |
And I set the field "id_draglabel_3" to "continental<br/>rise"
|
|
|
45 |
|
|
|
46 |
And I set the field "id_drags_4_dragitemtype" to "Draggable text"
|
|
|
47 |
And I set the field "id_draglabel_4" to "ocean<br/>trench"
|
|
|
48 |
|
|
|
49 |
And I set the field "id_drags_5_dragitemtype" to "Draggable text"
|
|
|
50 |
And I set the field "id_draglabel_5" to "continental<br/>slope"
|
|
|
51 |
|
|
|
52 |
And I set the field "id_drags_6_dragitemtype" to "Draggable text"
|
|
|
53 |
And I set the field "id_draglabel_6" to "mountain<br/>belt"
|
|
|
54 |
|
|
|
55 |
And I set the field "id_drags_7_dragitemtype" to "Draggable text"
|
|
|
56 |
And I set the field "id_draglabel_7" to "continental<br/>shelf"
|
|
|
57 |
|
|
|
58 |
# Drop zones
|
|
|
59 |
And I follow "Drop zones"
|
|
|
60 |
And I press "Blanks for 3 more drop zones"
|
|
|
61 |
|
|
|
62 |
And I set the field "id_drops_0_xleft" to "53"
|
|
|
63 |
And I set the field "id_drops_0_ytop" to "17"
|
|
|
64 |
And I set the field "id_drops_0_choice" to "7"
|
|
|
65 |
|
|
|
66 |
And I set the field "id_drops_1_xleft" to "172"
|
|
|
67 |
And I set the field "id_drops_1_ytop" to "2"
|
|
|
68 |
And I set the field "id_drops_1_choice" to "8"
|
|
|
69 |
|
|
|
70 |
And I set the field "id_drops_2_xleft" to "363"
|
|
|
71 |
And I set the field "id_drops_2_ytop" to "31"
|
|
|
72 |
And I set the field "id_drops_2_choice" to "5"
|
|
|
73 |
|
|
|
74 |
And I set the field "id_drops_3_xleft" to "440"
|
|
|
75 |
And I set the field "id_drops_3_ytop" to "13"
|
|
|
76 |
And I set the field "id_drops_3_choice" to "3"
|
|
|
77 |
|
|
|
78 |
And I set the field "id_drops_4_xleft" to "115"
|
|
|
79 |
And I set the field "id_drops_4_ytop" to "74"
|
|
|
80 |
And I set the field "id_drops_4_choice" to "6"
|
|
|
81 |
|
|
|
82 |
And I set the field "id_drops_5_xleft" to "210"
|
|
|
83 |
And I set the field "id_drops_5_ytop" to "94"
|
|
|
84 |
And I set the field "id_drops_5_choice" to "4"
|
|
|
85 |
|
|
|
86 |
And I set the field "id_drops_6_xleft" to "310"
|
|
|
87 |
And I set the field "id_drops_6_ytop" to "87"
|
|
|
88 |
And I set the field "id_drops_6_choice" to "1"
|
|
|
89 |
|
|
|
90 |
And I set the field "id_drops_7_xleft" to "479"
|
|
|
91 |
And I set the field "id_drops_7_ytop" to "84"
|
|
|
92 |
And I set the field "id_drops_7_choice" to "2"
|
|
|
93 |
|
|
|
94 |
And I press "id_submitbutton"
|
|
|
95 |
Then I should see "Drag and drop onto image 001"
|
|
|
96 |
# Checking that the next new question form displays user preferences settings.
|
|
|
97 |
And I press "Create a new question ..."
|
|
|
98 |
And I set the field "item_qtype_ddimageortext" to "1"
|
|
|
99 |
And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
|
|
|
100 |
And the following fields match these values:
|
|
|
101 |
| id_shuffleanswers | 1 |
|
|
|
102 |
|
|
|
103 |
@javascript @_file_upload
|
|
|
104 |
Scenario: Question must have at least one drag item and one drop zone
|
|
|
105 |
When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
|
|
|
106 |
And I press "Create a new question ..."
|
|
|
107 |
And I set the field "Drag and drop onto image" to "1"
|
|
|
108 |
And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
|
|
|
109 |
And I set the field "Question name" to "Test question"
|
|
|
110 |
And I set the field "Question text" to "Identify the features in this cross-section."
|
|
|
111 |
And I upload "question/type/ddimageortext/tests/fixtures/oceanfloorbase.jpg" file to "Background image" filemanager
|
|
|
112 |
And I press "Save changes"
|
|
|
113 |
Then I should see "You must add at least one draggable item to this question."
|
|
|
114 |
And I should see "You must define at least one drop zone for this question."
|