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
@qformat @qformat_xml
2
Feature: Test importing questions from Moodle XML format.
3
  In order to reuse questions
4
  As an teacher
5
  I need to be able to import them in XML format.
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | format |
10
      | Course 1 | C1        | topics |
11
    And the following "users" exist:
12
      | username | firstname |
13
      | teacher  | Teacher   |
14
    And the following "course enrolments" exist:
15
      | user    | course | role           |
16
      | teacher | C1     | editingteacher |
1441 ariadna 17
    And the following "activities" exist:
18
      | activity   | name    | course | idnumber |
19
      | qbank      | Qbank 1 | C1     | qbank1   |
1 efrain 20
 
21
  @javascript @_file_upload
22
  Scenario: import some true/false questions from Moodle XML format
1441 ariadna 23
    When I am on the "Qbank 1" "core_question > question import" page logged in as "teacher"
1 efrain 24
    And I set the field "id_format_xml" to "1"
25
    And I upload "question/format/xml/tests/fixtures/truefalse.xml" file to "Import" filemanager
26
    And I press "id_submitbutton"
27
    Then I should see "Parsing questions from import file."
28
    And I should see "Importing 2 questions from file"
29
    And I should see "is an acronym for Modular Object-Oriented Dynamic Learning Education"
30
    And I should see "is an acronym for Modular Object-Oriented Dynamic Learning Environment"
31
    When I press "Continue"
32
    Then I should see "Moodle acronym (False)"
33
    Then I should see "Moodle acronym (True)"
34
 
35
    # Now export again.
1441 ariadna 36
    When I am on the "Qbank 1" "core_question > question export" page logged in as "teacher"
1 efrain 37
    And I set the field "id_format_xml" to "1"
38
    And I set the field "Export category" to "TrueFalse"
39
    And I press "Export questions to file"
1441 ariadna 40
    Then following "click here" should download a file that:
41
      | Has mimetype                 | text/xml               |
42
      | Contains text in xml element | Moodle acronym (True)  |
43
      | Contains text in xml element | Moodle acronym (False) |
1 efrain 44
 
45
  @javascript @_file_upload
46
  Scenario: import some multiple choice questions from Moodle XML format
1441 ariadna 47
    When I am on the "Qbank 1" "core_question > question import" page logged in as "teacher"
1 efrain 48
    And I set the field "id_format_xml" to "1"
49
    And I upload "question/format/xml/tests/fixtures/multichoice.xml" file to "Import" filemanager
50
    And I press "id_submitbutton"
51
    Then I should see "Parsing questions from import file."
52
    And I should see "Importing 1 questions from file"
53
    And I should see "What language is being spoken?"
54
    When I press "Continue"
55
    Then I should see "Greeting"
56
 
57
  @javascript @_file_upload
58
  Scenario: import some multi-answer questions from Moodle XML format
1441 ariadna 59
    When I am on the "Qbank 1" "core_question > question import" page logged in as "teacher"
1 efrain 60
    And I set the field "id_format_xml" to "1"
61
    And I upload "question/format/xml/tests/fixtures/multianswer.xml" file to "Import" filemanager
62
    And I press "id_submitbutton"
63
    Then I should see "Parsing questions from import file."
64
    And I should see "Importing 1 questions from file"
65
    And I should see "Match the following cities with the correct state,"
66
    When I press "Continue"
67
    Then I should see "cloze with images"
68
 
69
  @javascript @_file_upload
70
  Scenario: import some questions with legacy-style images from Moodle XML format
1441 ariadna 71
    When I am on the "Qbank 1" "core_question > question import" page logged in as "teacher"
1 efrain 72
    And I set the field "id_format_xml" to "1"
73
    And I upload "question/format/xml/tests/fixtures/sample_questions_with_old_image_tag.xml" file to "Import" filemanager
74
    And I press "id_submitbutton"
75
    Then I should see "Parsing questions from import file."
76
    And I should see "Importing 2 questions from file"
77
    And I should see "This is a multianswer question with an image in the old"
78
    And I should see "This is a multichoice question with an image in the old"
79
    When I press "Continue"
80
    Then I should see "cloze question with image"
81
    Then I should see "mcq with image"