Note: You are currently viewing documentation for Moodle 3.11. Up-to-date documentation for the latest stable version of Moodle may be available here: Frank Ralf/Moodle XML1.

User:Frank Ralf/Moodle XML1: Difference between revisions

From MoodleDocs
No edit summary
(amended URL for Quedoc's Moodle XML documentation)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is only for keeping notes on some of my findings regarding Moodle XML.
This is only for keeping notes on some of my findings regarding Moodle XML.


== Minimum XML ==
== Minimum Question XML ==


Other than stated at Quedoc's Moodle XML documentation ([http://www.qedoc.org/en/index.php?title=Moodle_XML_format#Minimum_requirements Minimum requirements]) the minimum working Moodle XML file seems to be the following (short answer question). It gets imported using the default import settings.
Other than stated at Quedoc's Moodle XML documentation ([http://www.qedoc.org/index.php?title=Moodle_XML_format#Minimum_requirements Minimum requirements]) the minimum working Moodle XML file seems to be the following (short answer question). It gets imported using the default import settings.


Missing fields are populated with the default values during import which can be seen by re-exporting the question(s).
Missing fields are populated with the default values during import which can be seen by re-exporting the question(s).
Line 59: Line 59:
</quiz>
</quiz>
</code>
</code>


== OpenOffice & XML ==
== OpenOffice & XML ==
Some useful resources for using XML filters in OpenOffice for converting XML files:
Some useful resources for using XML filters in OpenOffice for converting XML files:


* [http://www.xml.com/pub/a/2005/01/26/hacking-ooo.html Hacking Open Office]
* [http://www.xml.com/pub/a/2005/01/26/hacking-ooo.html "Hacking Open Office "] by Peter Sefton
by Peter Sefton
 
* [http://www.ibm.com/developerworks/edu/x-dw-x-xsltopenoff.html "Use XSLT to expand OpenOffice's editing capabilities - Create import and output filters to edit your XML as rich text"] by Jonathan Levin (site requires free registration for full access) - [https://www6.software.ibm.com/developerworks/education/x-xsltopenoff/resources.html Resources]


* [http://www.ibm.com/developerworks/edu/x-dw-x-xsltopenoff.html Use XSLT to expand OpenOffice's editing capabilities - Create import and output filters to edit your XML as rich text] by Jonathan Levin
== Converting Moodle Glossary XML to Question XML ==
* [https://www6.software.ibm.com/developerworks/education/x-xsltopenoff/resources.html Resources] (site requires free registration)
Moved to its own page: [[User:Frank Ralf/Converting Moodle glossary XML to question XML]]. --[[User:Frank Ralf|Frank Ralf]] 20:12, 24 November 2010 (UTC)

Latest revision as of 21:29, 7 August 2014

This is only for keeping notes on some of my findings regarding Moodle XML.

Minimum Question XML

Other than stated at Quedoc's Moodle XML documentation (Minimum requirements) the minimum working Moodle XML file seems to be the following (short answer question). It gets imported using the default import settings.

Missing fields are populated with the default values during import which can be seen by re-exporting the question(s).

<?xml version="1.0" encoding="UTF-8"?> <quiz>

 <question type="shortanswer">
   <name>
     <text>Minimum question</text>
   </name>
   <questiontext>
     <text>What's the minimum XML required for import?</text>
   </questiontext>
   <answer fraction="100">
     <text>This here!</text>
   </answer>

</question> </quiz>

Moodle XML Minimum question.png


Re-export

This is how the question looks after exporting it again:

<?xml version="1.0" encoding="UTF-8"?> <quiz>

 <question type="shortanswer">
   <name>
     <text>Minimum question</text>
   </name>
   <questiontext format="moodle_auto_format">
     <text>What's the minimum XML required for import?</text>
   </questiontext>
   <image></image>
   <generalfeedback>
     <text></text>
   </generalfeedback>
   <defaultgrade>1</defaultgrade>
   <penalty>0.1</penalty>
   <hidden>0</hidden>
   <shuffleanswers>0</shuffleanswers>
   <usecase>0</usecase>
    <answer fraction="100">
     <text>This here!</text>
     <feedback>
       <text></text>
     </feedback>
   </answer>

</question> </quiz>

OpenOffice & XML

Some useful resources for using XML filters in OpenOffice for converting XML files:

Converting Moodle Glossary XML to Question XML

Moved to its own page: Frank Ralf/Converting Moodle glossary XML to question XML. --Frank Ralf 20:12, 24 November 2010 (UTC)