-

Note: You are currently viewing documentation for Moodle 3.10. Up-to-date documentation for the latest stable version of Moodle may be available here: Importing/exporting glossaries.

Importing/exporting glossaries: Difference between revisions

From MoodleDocs
No edit summary
Line 5: Line 5:
There are two ways to import glossaries
There are two ways to import glossaries


1. Restoring the glossaries from a moodle course backup file containing the glossary. This method allows images within glossaries to be included and if you also select users then the authors of entries are also imported if they were originally included in the backup.
1. Restoring the glossaries from a moodle course backup file containing the glossary. This method includes categories, images and attachments within glossary entries and if you also select users then the authors of entries are also imported if they were originally included in the backup.


2. Importing a specially formatted XML file in glossary format.
2. Importing a specially formatted XML file in glossary format. This method only inports text, some HTML formatting and switches such as auto-linking, case specific and whole words linking. There is also a switch to import categories into which entries are automatically included.


====Some import issues====
====Some import issues====
Line 37: Line 37:
There are two ways to export glossaries
There are two ways to export glossaries


1. Backing up glossaries only via a moodle course backup file (untested)
1. Backing up glossaries only via a moodle course backup file. This method will also export any categories, embedded images and attached files within entries and any HTML formatting. If users are also exported authors of entries are also included.


2. Exporting a specially formatted XML file in glossary format.
2. Exporting a specially formatted XML file in glossary format. This will only export text, some HTML formatting and switches such as auto-linking, case specific and whole words linking.


====Some export Issues====
====Some export Issues====

Revision as of 14:06, 21 October 2006

Template:Glossaries

Importing a glossary

There are two ways to import glossaries

1. Restoring the glossaries from a moodle course backup file containing the glossary. This method includes categories, images and attachments within glossary entries and if you also select users then the authors of entries are also imported if they were originally included in the backup.

2. Importing a specially formatted XML file in glossary format. This method only inports text, some HTML formatting and switches such as auto-linking, case specific and whole words linking. There is also a switch to import categories into which entries are automatically included.

Some import issues

You can only import the XML file from within a glossary that already exists but you can import to a new glossary.

In experimenting with import I have found that the import will fail often. Some reasons appear to be:-

If there are mistakes in the XML file such as the <entries> tag being missing or the <info> tag being in the wrong place. May happen if you have constructed the XML file manually or with some sort of tool like mailmerge in Word and your template is wrong.

If there are top bit set characters in the text of the entities like concepts, definitions or keywords. Replace things like & with &

If there are tabs or spaces between entries. Not sure if spaces cause problems but best to remove any bewtween the end of one tag and start of the next. e.g. Search and replace > < with >< via a text editor.

In most cases the import is halted if any of these errors occur.

Duplicates in the entries which clash with entries already when merging a glossary is usually not a problem.

Warnings like

Warning: exec() has been disabled for security reasons in /moodle/lib/uploadlib.php on line 603

may not be the problem when importing but may distract one from dealing with problems with the format of the XML file.

The glossary module may eventually be replaced by the database module.

Exporting a glossary

There are two ways to export glossaries

1. Backing up glossaries only via a moodle course backup file. This method will also export any categories, embedded images and attached files within entries and any HTML formatting. If users are also exported authors of entries are also included.

2. Exporting a specially formatted XML file in glossary format. This will only export text, some HTML formatting and switches such as auto-linking, case specific and whole words linking.

Some export Issues

You can only export the XML file from within a glossary.

See also