Note:

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

Exporting/importing several question categories at once: Difference between revisions

From MoodleDocs
 
(9 intermediate revisions by the same user not shown)
Line 3: Line 3:
The new interface, which lets you export several question categories at once.  
The new interface, which lets you export several question categories at once.  


To activate the export / import multiple categories question, click "Write a several".
To activate the export / import multiple categories question, click "Write several".


[[File:activate_mode.jpg]]
[[File:activate_mod.jpg]]


After clicking "Write a several" combobox list elements is replaced by a tree of categories as it shown on the picture.
After clicking "Write several" combobox list elements is replaced by a tree of categories as it shown on the picture.


[[File:tree_categories.jpg]]
[[File:tree_categories.jpg]]
Line 15: Line 15:
1. Category you want to export, are chosen as you can watch at the image.  
1. Category you want to export, are chosen as you can watch at the image.  


[[{{ns:file}}:choose_categories_.jpg]]
[[{{ns:file}}:Capture.png]]


2. To select a diapason of categories, select a category which is the first one in the diapason, hold down the Shift key and select the last category in diapason.
To achieve the desired result, I have to use it.


[[{{ns:file}}:diapason_categories_.jpg]]
==Change export/import function and file structure==
 
3. Select categories with subcategories. When you click on the category for the first time, only this category is selected. When you click on the category for the second time, the categories that are one level below, are selected too.
 
[[{{ns:file}}:categories_with_subcategories_.jpg]]
 
When you click on the category for the third time, all selections are canceled.
 
[[{{ns:file}}:selections_are_canceled_.jpg]]


To select a category with all its subcategories, press the Ctrl key and click on the category.
Import function does not need to be changed. Importing several question categories works correctly.  


[[{{ns:file}}:all_subcategories_.jpg]]
Export function needs to be corrected. Now only one question category exported.  


4. Select the diapason of categories with subcategories. To select a diapason of categories with all their subcategories, select a category which is the first one in diapason , hold down the Shift + Ctrl keys and select the last category in the diapason.
Now Moodle has the structure of the file described below.


[[{{ns:file}}:diapason_with_all_subcategories_.jpg]]
In the file category describes then questions describes which belong to the category then next category describes etc. This structure of the file is suitable for export of several question categories. A structure can be represented visually as


5. Select all categories. Select the top line in the drop-down box.
[Description category1]


[[{{ns:file}}:all_categories_.jpg]]
[Description first question of category1]


To achieve the desired result, I have to use it.
[Description second question of category1]


==Change export/import function and file structure==
[Description third question of category1]


As described in the first paragraph, the file structure is described as follows: a description of the category, followed by this categories questions. An example is described in "Current save in XML file".
[Description category2]


If this method is used in Moodle now, then I can also use it.
[Description first question of category2]


But if you want to save the connection question and category, I can add a property "parent" to the tag "question". For example, "<question type="cloze" parent="По умолчанию для Главная страница/My first category">".
[Description second question of category2] .


What variant is better? And in that and in other case, support the existing file format is preserved.
So to achieve the goal I will not have to change the structure of the file.

Latest revision as of 13:33, 10 January 2015

Interface

The new interface, which lets you export several question categories at once.

To activate the export / import multiple categories question, click "Write several".

activate mod.jpg

After clicking "Write several" combobox list elements is replaced by a tree of categories as it shown on the picture.

tree categories.jpg

How to change the interface is described below .

1. Category you want to export, are chosen as you can watch at the image.

Capture.png

To achieve the desired result, I have to use it.

Change export/import function and file structure

Import function does not need to be changed. Importing several question categories works correctly.

Export function needs to be corrected. Now only one question category exported.

Now Moodle has the structure of the file described below.

In the file category describes then questions describes which belong to the category then next category describes etc. This structure of the file is suitable for export of several question categories. A structure can be represented visually as

[Description category1]

[Description first question of category1]

[Description second question of category1]

[Description third question of category1]

[Description category2]

[Description first question of category2]

[Description second question of category2] .

So to achieve the goal I will not have to change the structure of the file.