Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Save category description in Moodle XML import/export: Difference between revisions

From MoodleDocs
Line 19: Line 19:


== Proposed XML structure ==
== Proposed XML structure ==
If current category has parent then
<pre>
<question type="category">
<question type="category">
   <category>
<category name="$parent category name$">
      <text>$course$/My First Category</text>
   <description>Description of category</description>
  </category>
  <category name="$current category name$">
    <description>Description of category</description>
  </category>
</category>
</question>
</question>
</pre>
else
<pre>
<question type="category">
<category name="$current category name$">
  <description>Description of category</description>
</category>
</question>
</pre>


== Old export compatibility problem ==
== Old export compatibility problem ==

Revision as of 10:56, 18 October 2014

What is not saved?

At this format of import/export in not saved:

1. description of the imported/exported category,

2. description of parental category(categories).

Current XML structure

<question type="category">
 <category>
  <text> $course$ / [ $parent category name$ / ] $current category name$ </text>
 </category>
</question>

The amount of block [ $parent category name$ / ] can be more or equally to zero.

Proposed XML structure

If current category has parent then

<question type="category">
 <category name="$parent category name$">
  <description>Description of category</description>
   <category name="$current category name$">
    <description>Description of category</description>
   </category>
 </category>
</question>

else

<question type="category">
 <category name="$current category name$">
  <description>Description of category</description>
 </category>
</question>

Old export compatibility problem