Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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"
1441 ariadna 60
    And I set the field "id_dropzonevisibility" to "1"
1 efrain 61
    And I press "Blanks for 3 more drop zones"
62
 
63
    And I set the field "id_drops_0_xleft" to "53"
64
    And I set the field "id_drops_0_ytop" to "17"
65
    And I set the field "id_drops_0_choice" to "7"
66
 
67
    And I set the field "id_drops_1_xleft" to "172"
68
    And I set the field "id_drops_1_ytop" to "2"
69
    And I set the field "id_drops_1_choice" to "8"
70
 
71
    And I set the field "id_drops_2_xleft" to "363"
72
    And I set the field "id_drops_2_ytop" to "31"
73
    And I set the field "id_drops_2_choice" to "5"
74
 
75
    And I set the field "id_drops_3_xleft" to "440"
76
    And I set the field "id_drops_3_ytop" to "13"
77
    And I set the field "id_drops_3_choice" to "3"
78
 
79
    And I set the field "id_drops_4_xleft" to "115"
80
    And I set the field "id_drops_4_ytop" to "74"
81
    And I set the field "id_drops_4_choice" to "6"
82
 
83
    And I set the field "id_drops_5_xleft" to "210"
84
    And I set the field "id_drops_5_ytop" to "94"
85
    And I set the field "id_drops_5_choice" to "4"
86
 
87
    And I set the field "id_drops_6_xleft" to "310"
88
    And I set the field "id_drops_6_ytop" to "87"
89
    And I set the field "id_drops_6_choice" to "1"
90
 
91
    And I set the field "id_drops_7_xleft" to "479"
92
    And I set the field "id_drops_7_ytop" to "84"
93
    And I set the field "id_drops_7_choice" to "2"
94
 
95
    And I press "id_submitbutton"
96
    Then I should see "Drag and drop onto image 001"
97
    # Checking that the next new question form displays user preferences settings.
98
    And I press "Create a new question ..."
99
    And I set the field "item_qtype_ddimageortext" to "1"
100
    And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
101
    And the following fields match these values:
1441 ariadna 102
      | id_shuffleanswers     | 1 |
103
      | id_dropzonevisibility | 1 |
1 efrain 104
 
105
  @javascript @_file_upload
106
  Scenario: Question must have at least one drag item and one drop zone
107
    When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
108
    And I press "Create a new question ..."
109
    And I set the field "Drag and drop onto image" to "1"
110
    And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
111
    And I set the field "Question name" to "Test question"
112
    And I set the field "Question text" to "Identify the features in this cross-section."
113
    And I upload "question/type/ddimageortext/tests/fixtures/oceanfloorbase.jpg" file to "Background image" filemanager
114
    And I press "Save changes"
115
    Then I should see "You must add at least one draggable item to this question."
116
    And I should see "You must define at least one drop zone for this question."