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
@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
1441 ariadna 26
    And I navigate to "Questions" in current page administration
1 efrain 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  |
1441 ariadna 43
    And I add a page break to the feedback
1 efrain 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
 
72
  @javascript @_file_upload
73
  Scenario: Import feedback deleting old items
74
    When I am on the "Learning experience" "feedback activity" page logged in as teacher
1441 ariadna 75
    And I navigate to "Questions" in current page administration
1 efrain 76
    And I add a "Numeric answer" question to the feedback with:
77
      | Question               | Existing question |
78
      | Label                  | numeric           |
79
      | Range to               | 100               |
1441 ariadna 80
    And I press "Actions"
81
    And I choose "Import" in the open action menu
1 efrain 82
    And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
1441 ariadna 83
    And I press "Import"
1 efrain 84
    Then I should not see "Existing question"
85
    And I should see "this is an information question"
86
    And I should see "label text"
87
    And I should see "this is a longer text answer"
88
    And I should see "this is a multiple choice 1"
89
    And I should see "this is a multiple choice 2"
90
    And I should see "this is a multiple choice 3"
91
    And I should see "this is a multiple choice rated"
92
    And I should see "this is a numeric answer"
93
    And I should see "this is a short text answer"
94
 
95
  @javascript @_file_upload
96
  Scenario: Import feedback appending new items
97
    When I am on the "Learning experience" "feedback activity" page logged in as teacher
1441 ariadna 98
    And I navigate to "Questions" in current page administration
1 efrain 99
    And I add a "Numeric answer" question to the feedback with:
100
      | Question               | Existing question |
101
      | Label                  | numeric           |
102
      | Range to               | 100               |
1441 ariadna 103
    And I press "Actions"
104
    And I choose "Import" in the open action menu
105
    And I set the field "Keep existing questions and add new questions at the end" to "1"
1 efrain 106
    And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
1441 ariadna 107
    And I press "Import"
1 efrain 108
    Then I should see "Existing question"
109
    And "Existing question" "text" should appear before "this is an information question" "text"
110
    And I should see "this is an information question"
111
    And I should see "label text"
112
    And I should see "this is a longer text answer"
113
    And I should see "this is a multiple choice 1"
114
    And I should see "this is a multiple choice 2"
115
    And I should see "this is a multiple choice 3"
116
    And I should see "this is a multiple choice rated"
117
    And I should see "this is a numeric answer"
118
    And I should see "this is a short text answer"