1 |
efrain |
1 |
@qtype @qtype_ddimageortext @_switch_window
|
|
|
2 |
Feature: Preview a drag-drop onto image question
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to check my drag-drop onto image questions will work for students
|
|
|
5 |
I need to preview 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 | ddimageortext | Drag onto image | xsection |
|
|
|
23 |
|
|
|
24 |
@javascript @_bug_phantomjs
|
|
|
25 |
Scenario: Preview a question using the mouse.
|
|
|
26 |
When I am on the "Drag onto image" "core_question > preview" page logged in as teacher
|
|
|
27 |
And I wait "2" seconds
|
|
|
28 |
# Odd, but the <br>s go to nothing, not a space.
|
|
|
29 |
And I drag "mountainbelt" to place "1" in the drag and drop onto image question
|
|
|
30 |
And I drag "continentalshelf" to place "2" in the drag and drop onto image question
|
|
|
31 |
And I drag "oceantrench" to place "3" in the drag and drop onto image question
|
|
|
32 |
And I drag "abyssalplain" to place "4" in the drag and drop onto image question
|
|
|
33 |
And I drag "continentalslope" to place "5" in the drag and drop onto image question
|
|
|
34 |
And I drag "continentalrise" to place "6" in the drag and drop onto image question
|
|
|
35 |
And I drag "islandarc" to place "7" in the drag and drop onto image question
|
|
|
36 |
And I drag "mid-oceanridge" to place "8" in the drag and drop onto image question
|
|
|
37 |
And I press "Submit and finish"
|
|
|
38 |
Then the state of "Identify the features" question is shown as "Correct"
|
|
|
39 |
And I should see "Mark 1.00 out of 1.00"
|
|
|
40 |
|
|
|
41 |
@javascript
|
|
|
42 |
Scenario: Preview a question using the keyboard.
|
|
|
43 |
When I am on the "Drag onto image" "core_question > preview" page logged in as teacher
|
|
|
44 |
# Increase window size and wait 2 seconds to ensure elements are placed properly by js.
|
|
|
45 |
And I type " " on place "1" in the drag and drop onto image question
|
|
|
46 |
And I type " " on place "2" in the drag and drop onto image question
|
|
|
47 |
And I type " " on place "3" in the drag and drop onto image question
|
|
|
48 |
And I type " " on place "4" in the drag and drop onto image question
|
|
|
49 |
And I type " " on place "5" in the drag and drop onto image question
|
|
|
50 |
And I type " " on place "6" in the drag and drop onto image question
|
|
|
51 |
And I type " " on place "7" in the drag and drop onto image question
|
|
|
52 |
And I type " " on place "8" in the drag and drop onto image question
|
|
|
53 |
And I press "Submit and finish"
|
|
|
54 |
Then the state of "Identify the features" question is shown as "Correct"
|
|
|
55 |
And I should see "Mark 1.00 out of 1.00"
|