Note: You are currently viewing documentation for Moodle 3.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Moodle XML format.

Talk:Moodle XML format

From MoodleDocs

Would it be clearer to name this page "Moodle Question XML format", since it only describes the XML format for questions, not for glossaries, courses, or SCORM? (Ideally the other XML formats would have separate pages, although I don't see much documentation for those formats.)

--Clif Kussmaul (talk) 18:54, 17 July 2013 (WST)

Well, in the Moodle user interface, the format is called Moodle XML format, and has been for years. So, renaming this page will reduce some forms of confusion, but increase others.--Tim Hunt (talk) 19:37, 17 July 2013 (WST)



MoodleXMLBuilder link at "Useful Utilities" section goes to a 404 Not Found page, fyi.--Clay Burell (talk) 00:43, 10 January 2014 (WST)

Thanks - I have removed the broken link.(If you see any more, feel free to remove them yourself ) --Mary Cooch (talk) 16:30, 10 January 2014 (WST)



In the example for an essay-type question it has an <answer fraction="0"> tag. From what I can tell it looks like that tag isn't used at all within the format.

If I write a random question like this, <question type="essay"> <name> <text>Treaty of Versailles</text> </name> <answer fraction="0">

<text><![CDATA[

Write a short essay about the Treaty of Versailles and how its shortcomings helped Hitler come to power.

Requirements:

- 3 to 5 paragraphs

- Addresses at least 3 failings of the treaty

]]></text>

</answer> </question>

It doesn't work (obviously - because the text of the question is in an answer section, but that's how I interpreted the essay example.)

If I make the question in Moodle and export it, it comes out like this:

 <question type="essay">
   <name>
     <text>Treaty of Versailles</text>
   </name>
   <questiontext format="html">

<text><![CDATA[

Write a short essay about the Treaty of Versailles and how its shortcomings helped Hitler come to power.

Requirements:

- 3 to 5 paragraphs

- Addresses at least 3 failings of the treaty

]]></text>

   </questiontext>
   <generalfeedback format="html">
     <text></text>
   </generalfeedback>
   <defaultgrade>1.0000000</defaultgrade>
   <penalty>0.0000000</penalty>
   <hidden>0</hidden>
   <responseformat>editor</responseformat>
   <responserequired>1</responserequired>
   <responsefieldlines>15</responsefieldlines>
   <attachments>0</attachments>
   <attachmentsrequired>0</attachmentsrequired>
   <graderinfo format="html">
     <text></text>
   </graderinfo>
   <responsetemplate format="html">
     <text></text>
   </responsetemplate>
 </question>

The <answer> tag isn't used at all - and the question text goes in a regular question text section. Wouldn't a barebones example look more like this (as opposed to what's currently on the Moodle XML page)? <question type="essay"> <questiontext format="html"> <text></text> </questiontext> </question>

--Gene Smith-James (talk) 20:23, 5 June 2019 (UTC)