|
| 1 | +@mod @mod_questionnaire |
| 2 | +Feature: Questionnaire responses can be downloaded as a CSV, etc. |
| 3 | + |
| 4 | + Background: |
| 5 | + Given the following "users" exist: |
| 6 | + | username | firstname | lastname | email | |
| 7 | + | teacher1 | Teacher | 1 | teacher1@example.com | |
| 8 | + | student1 | Student | 1 | student1@example.com | |
| 9 | + And the following "courses" exist: |
| 10 | + | fullname | shortname | category | |
| 11 | + | Course 1 | C1 | 0 | |
| 12 | + And the following "course enrolments" exist: |
| 13 | + | user | course | role | |
| 14 | + | teacher1 | C1 | editingteacher | |
| 15 | + | student1 | C1 | student | |
| 16 | + And the following "activities" exist: |
| 17 | + | activity | name | introduction | course | idnumber | |
| 18 | + | questionnaire | Test questionnaire download | Test questionnaire description | C1 | questionnaire1 | |
| 19 | + And I log in as "teacher1" |
| 20 | + And I am on "Course 1" course homepage |
| 21 | + And I follow "Test questionnaire download" |
| 22 | + And I navigate to "Questions" in current page administration |
| 23 | + And I add a "Text Box" question and I fill the form with: |
| 24 | + | Question Name | Q1 | |
| 25 | + | No | n | |
| 26 | + | Input box length | 10 | |
| 27 | + | Max. text length | 15 | |
| 28 | + | Question Text | Enter some text | |
| 29 | + And I log out |
| 30 | + And I log in as "student1" |
| 31 | + And I am on "Course 1" course homepage |
| 32 | + And I follow "Test questionnaire download" |
| 33 | + And I navigate to "Answer the questions..." in current page administration |
| 34 | + And I set the field "Enter some text" to "Student response" |
| 35 | + And I press "Submit questionnaire" |
| 36 | + And I log out |
| 37 | + |
| 38 | + @javascript |
| 39 | + Scenario: Download responses |
| 40 | + Given I log in as "teacher1" |
| 41 | + And I am on "Course 1" course homepage |
| 42 | + And I follow "Test questionnaire download" |
| 43 | + And I navigate to "View all responses" in current page administration |
| 44 | + Then I click on "Download" "link" |
| 45 | + # Without the ability to check the downloaded file, the absence of an |
| 46 | + # exception being thrown here is considered a success. |
| 47 | + And I click on "Download" "button" |
0 commit comments