| 1441 |
ariadna |
1 |
@qtype @qtype_multianswer
|
|
|
2 |
Feature: Exporting Multianswer (Cloze) questions
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to reuse my questions
|
|
|
5 |
I need to be able to export a Cloze question or a category containing a Cloze question.
|
|
|
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 |
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 | questiontext |
|
|
|
22 |
| Test questions | multianswer | TF1 | {1:SHORTANSWER:=Berlin} is the capital of Germany. |
|
|
|
23 |
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher"
|
|
|
24 |
|
|
|
25 |
Scenario: Edit a previously created multichoice question
|
|
|
26 |
When I choose "Edit question" action for "TF1" in the question bank
|
|
|
27 |
And I set the following fields to these values:
|
|
|
28 |
| Question name | Capital |
|
|
|
29 |
| Question text | {1:SHORTANSWER:=Berlin} is the capital of Germany. |
|
|
|
30 |
And I press "id_submitbutton"
|
|
|
31 |
Then I should see "Capital"
|
|
|
32 |
And I should not see "TF1"
|
|
|
33 |
|
|
|
34 |
@javascript
|
|
|
35 |
Scenario: Export the single multichoice question as XML
|
|
|
36 |
When I choose "Export as Moodle XML" action for "TF1" in the question bank
|
|
|
37 |
#Next step does not work as a check, however, when the download cannot be triggered, an error should appear and stop the test.
|
|
|
38 |
#Then following "Download" should download between "1" and "180000" bytes
|
|
|
39 |
|
|
|
40 |
@javascript
|
|
|
41 |
Scenario: Export the category containing the multichoice question as XML
|
|
|
42 |
When I select "Export" from the "Question bank tertiary navigation" singleselect
|
|
|
43 |
And I set the field "Moodle XML format" to "1"
|
|
|
44 |
And I click on "Export questions to file" "button"
|
|
|
45 |
Then following "click here" should download a file that:
|
|
|
46 |
| Has mimetype | text/xml |
|
|
|
47 |
| Contains text in xml element | TF1 |
|