Save category description in Moodle XML import/export: Difference between revisions
Line 73: | Line 73: | ||
</question> | </question> | ||
</code> | </code> | ||
Block <Description/> contains description for last category in path. | |||
For export category we need export all categories with description which are parent for exported category. | |||
== Old export compatibility problem == | == Old export compatibility problem == |
Revision as of 14:05, 13 November 2014
What is not saved?
Some things are not saved at this format of import/expor:
1. description of the exported category,
2. description of parent category,
Current XML structure
<question type="category">
<category>
<text>{<Assignment>}/{<Category>}[/<Subcategory>]...</text>
</category>
</question>
Assignment:
- $course$ - сategory refers to the course,
- $system$ - Category refers to the system.
Category and Subcategory - name of category and subcategory written via '/' as path.
Proposed XML structure
Simple situation
We have category without parent.
<question type="category">
<category>
<text>{<Assignment>}/{<Category>}</text>
</category>
<description>
<text>{<Description>}</text>
</description>
</question>
Complex situation
We have category with parent.
<question type="category">
<category>
<text>{<Assignment>}/{<Category>}</text>
</category>
<description>
<text>{<Description>}</text>
</description>
</question>
<question type="category">
<category>
<text>{<Assignment>}/{<Category>}{/<Subcategory>}</text>
</category>
<description>
<text>{<Description>}</text>
</description>
</question>
...................................................................................
...................................................................................
<question type="category">
<category>
<text>{<Assignment>}/{<Category>}...{/<Subcategory>}</text>
</category>
<description>
<text>{<Description>}</text>
</description>
</question>
Block <Description/> contains description for last category in path. For export category we need export all categories with description which are parent for exported category.