1 @qtype @qtype_ddmarker @_switch_window
2 Feature: Preview a drag-drop onto image question
4 In order to check my drag-drop onto image questions will work for students
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | T1 | Teacher1 | teacher1@moodle.com |
11 And the following "courses" exist:
12 | fullname | shortname | category |
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 "questions" exist:
21 | questioncategory | qtype | name | template |
22 | Test questions | ddmarker | Drag markers | mkmap |
23 Given I log in as "teacher1"
24 And I follow "Course 1"
25 And I navigate to "Question bank" node in "Course administration"
27 @javascript @_bug_phantomjs
28 Scenario: Preview a question using the mouse.
29 When I click on "Preview" "link" in the "Drag markers" "table_row"
30 And I switch to "questionpreview" window
31 # Increase window size and wait 2 seconds to ensure elements are placed properly by js.
32 # Keep window large else drag will scroll the window to find element.
33 And I change window size to "large"
34 And I wait "2" seconds
35 # Odd, but the <br>s go to nothing, not a space.
36 And I drag "OU" to "342,230" in the drag and drop markers question
37 And I drag "Railway station" to "254,197" in the drag and drop markers question
38 And I drag "Railway station,1" to "326,319" in the drag and drop markers question
39 And I drag "Railway station,2" to "203,101" in the drag and drop markers question
40 And I press "Submit and finish"
41 Then the state of "Please place the markers on the map of Milton Keynes" question is shown as "Correct"
42 And I should see "Mark 1.00 out of 1.00"
43 And I switch to the main window
46 Scenario: Preview a question using the keyboard.
47 When I click on "Preview" "link" in the "Drag markers" "table_row"
48 And I switch to "questionpreview" window
49 # Increase window size and wait 2 seconds to ensure elements are placed properly by js.
50 # Keep window large else drag will scroll the window to find element.
51 And I change window size to "large"
52 And I wait "2" seconds
53 And I type "up" "89" times on marker "Railway station" in the drag and drop markers question
54 And I type "right" "21" times on marker "Railway station" in the drag and drop markers question
55 And I press "Submit and finish"
56 Then the state of "Please place the markers on the map of Milton Keynes" question is shown as "Partially correct"
57 And I should see "Mark 0.25 out of 1.00"
58 And I switch to the main window