Moodle XML format: Difference between revisions
- Managing questions
- Question behaviours
- Question permissions
- Question types
- Calculated
- Simple Calculated
- Drag and drop into text
- Drag and drop markers
- Drag and drop onto image
- Calculated Multichoice
- Description
- Essay
- Matching
- Embedded Answers (Cloze)
- Multiple Choice
- Ordering
- Random Short Answer Matching
- Select missing words
- Short-Answer
- Numerical
- True/False
- Third-party question types
- Questions FAQ
No edit summary |
|||
Line 176: | Line 176: | ||
Moodle has a question type which consists of taking short answer questions in the same quiz and displaying them as a pair matching exercise. However Moodle is neither able to export nor import this question type. | Moodle has a question type which consists of taking short answer questions in the same quiz and displaying them as a pair matching exercise. However Moodle is neither able to export nor import this question type. | ||
[[Category:Teacher]] | |||
[[Category:Question]] | |||
[[Category:Quiz]] | |||
[[Category:Lesson]] | |||
{{stub}} | {{stub}} |
Revision as of 16:12, 13 February 2007
Overall structure of XML file
The file is enclosed by tags as follows.
<?xml version=1.0?> <quiz> . . . </quiz>
Within the <quiz> tags are any number of <question> tags. One of these <question> tags can be a dummy question with a category type to specify a category for the import/export.
The file must be encoded in UTF8
Tags common to all question types
A question is written as follows.
<question type="multichoice|truefalse|shortanswer|match|cloze|essay|numerical|description" <questiontext format="html"> <text>What is the answer to this question?</text> </questiontext> . . . </question>
Note that the format attribute can have other values, but for Qedoc purposes the value "html" is preferred.
Further tags, which usually include at least one <answer> tag, follow in the space marked with dots as child nodes to the <question> tag. The response-related tags are listed further down on this page. Various (optional?) tags are possible.
- penalty
- generalfeedback
- defaultgrade
- hidden
An interesting tag is the <image> tag which allows a base64-encoded image to be included.
Points for clarification:
- Exactly how does the <image> tag work?
- Is there an <image_base64> tag? How does this relate?
Multiple choice
MC questions have one <answer> tag for each choice. Each choice can carry feedback and score weighting (presumably by using the fraction attribute). In addition, an MC question has the following tags:
- single (values: true/false)
- shuffleanswers (values: 1/0)
- correctfeedback
- partiallycorrectfeedback
- incorrectfeedback
The <single> tag is used to distinguish single response (radio button) and multiple response (checkbox) variants.
<question type=multichoice> <answer fraction=100> <text>The correct answer</text> <feedback><text>Correct!</text></feedback> </answer> <answer fraction=0> <text>A distractor</text> <feedback><text>Ooops!</text></feedback> </answer> <answer fraction=0> <text>Another distractor</text> <feedback><text>Ooops!</text></feedback> </answer> <shuffleanswers>1</shuffleanswers> <single>true</single>
See also: GIFT Multiple Choice Format
True/false
Two answer tags are given, one which is true, and one which is false. The fraction attribute of the answer tag presumably identifies which option is correct (100) and which is false (0). Feedback is supported. The following example shows the format when true is the correct answer and false is wrong.
<question type=truefalse> <answer fraction=100> <text>true</text> <feedback><text>Correct!</text></feedback> </answer> <answer fraction=0> <text>false</text> <feedback><text>Ooops!</text></feedback> </answer>
See also: GIFT True/False Format
Short answer / typed response
The short answer question type supports alternative correct responses, each with its own weighting and feedback. Weighting and feedback will be ignored when imported into Qedoc, but alternative responses are understood. The Moodle XML format uses one <answer> tag for each of the alternative correct answers.
The <usecase> tag toggles case-sensitivity with the values 1/0.
<question type=shortanswer> <answer fraction=100> <text>The correct answer</text> <feedback><text>Correct!</text></feedback> </answer>
<question type=shortanswer> <answer fraction=100> <text>The correct answer</text> <feedback><text>Correct!</text></feedback> </answer> <answer fraction=100> <text>An alternative answer</text> <feedback><text>Correct!</text></feedback> </answer>
See also: GIFT Typed Response Format
Numerical response
The following is a simplified version of the Moodle XML format for numerical responses.
<question type=numerical> <answer> A number <fraction>100</fraction> <feedback><text>Feedback</text></feedback> </answer>
Moodle also supports a <tolerance> tag (how accurate must the number be?) and one or more <unit> tags. Unit tags have names and multipliers. E.g. if the main answer is in kilometres, an additional answer could be the equivalent in metres with a multiplier of 1000. These features are not yet supported by Qedoc.
See also: GIFT Numerical Response Format
Pair matching
Pair matching responses use the <shuffleanswers> tag to determine whether the order of the items should be randomized. Each pair is contained inside a <subquestion> tag. The first item of each pair is contained with a <text> tag, while the second has an <answer> tag around it as well. Feedback and score weighting is not supported by Moodle for this response type.
<question type=match> <subquestion> <text>This is the 1st item in the 1st pair.</text> <answer> <text>This is the 2nd item in the 1st pair.</text> </answer> <subquestion> <subquestion> <text>This is the 1st item in the 2nd pair.</text> <answer> <text>This is the 2nd item in the 2nd pair.</text> </answer> <subquestion> <shuffleanswers>true</shuffleanswers>
See also: GIFT Pair Matching Format
Other question types
Cloze/Gapfill
It is supported, and depends on a special format for the <questiontext> tag.
Essay response type
Not currently supported by Qedoc.
Regular expression response type
The format appears to be identical to short answers / typed responses. Clarification about the differences is needed. Not currently supported by Qedoc.
Description response type
This response type appears to have no further tags other than those contained in the question header (such as <questiontext>). Not currently supported by Qedoc.
Random matching
Moodle has a question type which consists of taking short answer questions in the same quiz and displaying them as a pair matching exercise. However Moodle is neither able to export nor import this question type.