1 |
efrain |
1 |
@mod @mod_feedback
|
|
|
2 |
Feature: Exporting and importing feedbacks
|
|
|
3 |
In order to quickly copy feedbacks across courses and sites
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to export and import feedbacks
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname |
|
|
|
10 |
| teacher | Teacher | 1 |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname |
|
|
|
13 |
| Course 1 | C1 |
|
|
|
14 |
| Course 2 | C2 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher | C1 | editingteacher |
|
|
|
18 |
| teacher | C1 | editingteacher |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | course | idnumber |
|
|
|
21 |
| feedback | Learning experience | C1 | feedback0 |
|
|
|
22 |
And I change window size to "large"
|
|
|
23 |
|
|
|
24 |
Scenario: Export sample feedback and compare with the fixture
|
|
|
25 |
When I am on the "Learning experience" "feedback activity" page logged in as teacher
|
|
|
26 |
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
|
|
|
27 |
And "Export questions" "link" should not exist in the ".tertiary-navigation" "css_element"
|
|
|
28 |
And I add a "Information" question to the feedback with:
|
|
|
29 |
| Question | this is an information question |
|
|
|
30 |
| Label | info |
|
|
|
31 |
| Information type | Course |
|
|
|
32 |
And I add a "Text and media area" question to the feedback with:
|
|
|
33 |
| Contents | label text |
|
|
|
34 |
And I add a "Longer text answer" question to the feedback with:
|
|
|
35 |
| Question | this is a longer text answer |
|
|
|
36 |
| Label | longertext |
|
|
|
37 |
| Required | 1 |
|
|
|
38 |
And I add a "Multiple choice" question to the feedback with:
|
|
|
39 |
| Question | this is a multiple choice 1 |
|
|
|
40 |
| Label | multichoice1 |
|
|
|
41 |
| Multiple choice type | Multiple choice - single answer |
|
|
|
42 |
| Multiple choice values | option a\noption b\noption c |
|
|
|
43 |
And I select "Add a page break" from the "typ" singleselect
|
|
|
44 |
And I add a "Multiple choice" question to the feedback with:
|
|
|
45 |
| Question | this is a multiple choice 2 |
|
|
|
46 |
| Label | multichoice2 |
|
|
|
47 |
| Multiple choice type | Multiple choice - multiple answers |
|
|
|
48 |
| Hide the "Not selected" option | Yes |
|
|
|
49 |
| Multiple choice values | option d\noption e\noption f |
|
|
|
50 |
| Dependence item | multichoice1 |
|
|
|
51 |
| Dependence value | option a |
|
|
|
52 |
And I add a "Multiple choice" question to the feedback with:
|
|
|
53 |
| Question | this is a multiple choice 3 |
|
|
|
54 |
| Label | multichoice3 |
|
|
|
55 |
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
|
|
|
56 |
| Multiple choice values | option g\noption h\noption i |
|
|
|
57 |
And I add a "Multiple choice (rated)" question to the feedback with:
|
|
|
58 |
| Question | this is a multiple choice rated |
|
|
|
59 |
| Label | multichoice4 |
|
|
|
60 |
| Multiple choice type | Multiple choice - single answer |
|
|
|
61 |
| Multiple choice values | 0/option k\n1/option l\n5/option m |
|
|
|
62 |
And I add a "Numeric answer" question to the feedback with:
|
|
|
63 |
| Question | this is a numeric answer |
|
|
|
64 |
| Label | numeric |
|
|
|
65 |
| Range to | 100 |
|
|
|
66 |
And I add a "Short text answer" question to the feedback with:
|
|
|
67 |
| Question | this is a short text answer |
|
|
|
68 |
| Label | shorttext |
|
|
|
69 |
| Maximum characters accepted | 200 |
|
|
|
70 |
Then following "Export questions" should export feedback identical to "mod/feedback/tests/fixtures/testexport.xml"
|
|
|
71 |
And I log out
|
|
|
72 |
|
|
|
73 |
@javascript @_file_upload
|
|
|
74 |
Scenario: Import feedback deleting old items
|
|
|
75 |
When I am on the "Learning experience" "feedback activity" page logged in as teacher
|
|
|
76 |
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
|
|
|
77 |
And I add a "Numeric answer" question to the feedback with:
|
|
|
78 |
| Question | Existing question |
|
|
|
79 |
| Label | numeric |
|
|
|
80 |
| Range to | 100 |
|
|
|
81 |
And I select "Import questions" from the "jump" singleselect
|
|
|
82 |
And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
|
|
|
83 |
And I press "Save"
|
|
|
84 |
And I select "Add question" from the "jump" singleselect
|
|
|
85 |
Then I should not see "Existing question"
|
|
|
86 |
And I should see "this is an information question"
|
|
|
87 |
And I should see "label text"
|
|
|
88 |
And I should see "this is a longer text answer"
|
|
|
89 |
And I should see "this is a multiple choice 1"
|
|
|
90 |
And I should see "this is a multiple choice 2"
|
|
|
91 |
And I should see "this is a multiple choice 3"
|
|
|
92 |
And I should see "this is a multiple choice rated"
|
|
|
93 |
And I should see "this is a numeric answer"
|
|
|
94 |
And I should see "this is a short text answer"
|
|
|
95 |
|
|
|
96 |
@javascript @_file_upload
|
|
|
97 |
Scenario: Import feedback appending new items
|
|
|
98 |
When I am on the "Learning experience" "feedback activity" page logged in as teacher
|
|
|
99 |
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
|
|
|
100 |
And I add a "Numeric answer" question to the feedback with:
|
|
|
101 |
| Question | Existing question |
|
|
|
102 |
| Label | numeric |
|
|
|
103 |
| Range to | 100 |
|
|
|
104 |
And I select "Import questions" from the "jump" singleselect
|
|
|
105 |
And I set the field "Append new items" to "1"
|
|
|
106 |
And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
|
|
|
107 |
And I press "Save"
|
|
|
108 |
And I select "Add question" from the "jump" singleselect
|
|
|
109 |
Then I should see "Existing question"
|
|
|
110 |
And "Existing question" "text" should appear before "this is an information question" "text"
|
|
|
111 |
And I should see "this is an information question"
|
|
|
112 |
And I should see "label text"
|
|
|
113 |
And I should see "this is a longer text answer"
|
|
|
114 |
And I should see "this is a multiple choice 1"
|
|
|
115 |
And I should see "this is a multiple choice 2"
|
|
|
116 |
And I should see "this is a multiple choice 3"
|
|
|
117 |
And I should see "this is a multiple choice rated"
|
|
|
118 |
And I should see "this is a numeric answer"
|
|
|
119 |
And I should see "this is a short text answer"
|