Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: Import questions.
Moodle has a number of different formats that can be used to import questions into Question bank categories and as lesson question pages. These include some proprietary quiz software formats, as well as text files and Moodle formats.
- 1 Importing questions from an existing file
- 2 Question import formats
- 3 Importing from other programs
- 4 Character encoding
- 5 Match grades
- 6 Tips and tricks
- 7 See also
Importing questions from an existing file
It is possible to import questions from a file on your network/computer or from a file that has been saved or uploaded into your course files. The underlying character encoding of this file is important.
Question bank import process
The question bank allows you a great deal of flexibility when importing questions. To import questions into Moodle's Question bank, use the Questions link in the course administration and select the import tab. In most versions of Moodle it is also possible to get to this screen (produced by ../question/import.php) while editing an existing quiz.
- Select import tab
- Select the question type to import
- General: pick the category, determine if the context and category information that maybe contained in a GIFT or XML file should be used.
- Select what should happen if there are no grades or an error is detected in the import process.
- Determine the file to import
- Import from file upload. Use the browse function to import a file from your computer. Use the "Upload this file" button to import the questions.
- Import from file already in course files. A popup window will take you to the course files start page. Use the "Import from this file" button.
Lesson module process
The question types that can be imported into a lesson are similar to question bank.
Lesson can only import from a file located on the teachers computer.
- In edit, using the expanded view
- Select the position where questions should be inserted into the lesson
- Click on the Import question link between the pages.
- Select the file type
- Use the browse function to find the file on your computer
- Import the selected file.
Question import formats
Moodle 'proprietary' text format for import and export. Reasonably comprehensive.
The GIFT with medias optional plugin is an import format similar to Gift and uses the same syntax, but instead of a text file it imports a zip file containing the gift text file and media files (images, sounds, ...).
Moodle 'proprietary' xml format for import and export. Very comprehensive.
How do you create XML files to enable import of images?
This describes a use of a text to XML conversion process using http://vletools.com/questions/quiz
Please add any further comments here:
This format is an easy way of writing multiple-choice questions for import.
From Moodle 1.7 onwards, if you're converting from Blackboard to Moodle, you can export your course and then import the question pools into Moodle using the Blackboard "POOL" type export format. It relies on XML functions being compiled into your PHP. Note that you must first unpack the exported zip file and provide Moodle with the appropriate .dat file. Note that this version does not work with Blackboard Version 6 and newer. (Use this format for ExamView 5 or 6)
This module can import questions saved in Blackboard's export format. It provides limited support for Blackboard Version 6 and 7. It relies on XML functions being compiled into your PHP. You must upload the zip file exported from Blackboard. Note that this format only imports the main data file from the zip. Any other data (e.g. images) is ignored.
Course Test Manager
This format enables you to import questions from the Course Test Manager from Course Technology.
This format is a multiple question, multiple answer question with embedded answers. They can be a bit tricky to develop, but they are a unique way of asking questions.
ExamView 4 supported an XML export format that Moodle can import.
Follow these steps to import questions from ExamView 4.0.8
1. Create a new test using ExamView
2. After selecting the types of questions and how many of each Click on File - Export – Change Save As Type to ExamView XML
3. After creating the export of your ExamView test login to your Moodle site
4. Go to the course you wish to add the quiz to and Turn Editing On
5. Scroll down to the topic or week you wish to add a Quiz Click add an activity – highlight quiz, Enter a name and introduction for the quiz and any other applicable information.
6. Click save and display
7. Editing quiz - click Edit then Import, click the radio button next to ExamView
8. Browse to the location you saved the file highlight and click open, then click the upload this file button.
9. Review the questions imported, click continue, click on Quiz, select all and click add to quiz
10. Save Changes, click on the preview tab view the test and the quiz is ready.
If you are using a newer version of ExamView, you should export using Blackboard, extract the zip archive ExamView creates, then import in Moodle using Blackboard format (do not use 6+ format for moodle import, even though exam view calls this a Blackboard6+ file--it isn't). You can choose one of the ".dat" files from the ExamView archive to import. Note that images are not currently imported.
Any questions that included images must be edited to "re-link" those images. The image files can be found in the file folder that is in your item test bank directory of your course files. Click the edit tool next to a question in the question list. If one or more images files are included in the question, you should see a placeholder with the image file name in it embedded with text in the text edit window. Click on the placeholder and then click on the insert image tool of the text editor. Navigate to the folder containing the image files. (It will be in the folder you uploaded the zipped question bank to). Find the file with the same name as indicated in the image placeholder. Type the alternate text then click "okay" to re-link the image. Click on "okay" to return to the question list.
MoodleXMLBuilder disicussed below in See Also can also be used to convert ExamView exports to Moodle XML. Images are supported and included within the Moodle XML when using MoodleXMLBuilder. In ExamView choose one of the two Blackboard export options and select the corresponding option in MoodleXMLBuilder. Either Blackboard option will convert questions to Moodle XML, however it is recommended to choose the Blackboard 7.1+ option.
NOTE:In Moodle 2.1 (?... not sure of the server version) there exists a problem with MIME types that prevent Examview question banks from being uploaded, regardless of the export format, the extension (e.g. .txt or .xml) or the MIME information in the files themselves (?txt or ?xml).
A work-around is available for ExamView Test Generator, version 6.2.1 (perhaps also for other versions but not for 3.5.1 since it doesn't export to Blackboard).
1. Create a quiz with questions in Examview Test Generator v. 6.2.1
2. Export the quiz to Blackboard 6.0-7.0 format
3. Use the aforementioned MoodleXMLBuilder to convert from ExamView Export to Blackboard 6.0-7.0 into the XML format that Moodle 2.1 (?) accepts.
4. From the Settings tab for your course choose Question bank and then Import. Make sure you use the Moodle XML format. You may also need to set Stop on error to No.
FYI To install MoodleXMLBuilder you may need to be logged into an administrator account or select "Run as administrator" from the right-click menu. You'll also need java and you will need to run the MoodleXMLBuilder.exe application from its install directory (the installer doesn't seem to create a Start menu entry). For Windows 7 it was C:\Program Files (x86)\MoodleXMLBuilder\MoodleXMLBuilder.exe.
Updated information: With ExamView 6.2.1, export the exam using "Blackboard 6.0-7.0" format. Then with Moodle 2.3.3, select "Examview exported as Blackboard 6.0-7.0" on the Import questions screen.
A freeware program that can export questions into Moodle.
Note 1.- All types of Hot Potatoes question types can be imported into Moodle, but JCross and JMix questions will be changed to Short Answer questions.
- Can be imported into the Quiz questions bank:
- Cloze questions (JCloze);
- Match questions (JMatch);
- Multiple Choice questions (JQuiz)
- Short Answer questions (JQuiz, JCross and JMix)
- Can be imported into Moodle's Lesson module:
- Match questions (JMatch);
- Multiple Choice questions (JQuiz)
Note 2.- For Hot Potatoes' Multiple Choice question type (JQuiz), the Multiple-choice Short answer and Multi-select question-type will imported as they are. Hybrid questions will be imported as MultiChoice questions, i.e. they will not start as Short Answer questions and then change to Multiple Choice questions after several wrong responses.
Note 3.- For Moodle v2.2 and v2.3 you must install the Hot Potatoes plugin first. See https://moodle.org/mod/forum/discuss.php?d=204421
This format can import multiple choice questions saved in Learnwise's XML format.
This format is only used for multiple choice questions and short answer questions, similar to GIFT.
This format supports importing multiple choice and short answers questions from WebCT's text format.
Caution: Keep in mind that WebCT allows more than one "blank" per short answer question; whereas, Moodle will only accommodate one blank per question. Questions that used multiple short answers in a question will not convert successfully.
Importing from other programs
Diploma 6 also supports an XML export format that Moodle can import. If you are using a newer version of Diploma, here are the steps to to export from Diploma and import to Moodle. The steps are the same as those for Examview (see above).
- Export with the Blackboard LS 6.0 – 6.2 format.
- Upload the zip file to your course files and unzip the file. Do not use the unzip feature in the quiz module – it won’t work. This will create a .dat file and a folder of images (if any of your questions included images).
- Import the .dat file using the plain Blackboard (not the Blackboard 6.0 – 6.2) format. The images are not imported at the same time, but they are available in that other folder that was in the zip file.
As with Examview, any questions that include images must be edited to reestablish the links to those images.
- First, click the edit tool next to a question in the question list. If there are any images in the question, you will see a placeholder with the image file name in it.
- Click on the placeholder, and then the insert image tool of the text editor.
- Navigate to the folder containing the image.
- Find the file with the same name as the one in the placeholder, and select it. Type the alternate text, and then click “OK” to relink the image, and then “OK” again to return to the question list.
- AON -This format is the same as the missing word format, except it creates matching questions from the multiple choice questions. Please note that from Moodle 1.8 it will no longer be part of the standard Moodle.
It is important that the imported file is encoded in the UTF-8 standard.
If this is not adhered to you may get import errors and/or strange characters in the imported materials. If the file is not UTF-8, an external tool must be used to change the encoding. Note that if only basic 'latin' characters are used, then the coding issue can generally be ignored. Be particularly careful when creating questions using Microsoft Word. For reasons best known to themselves, Microsoft used their own encoding for some characters (incompatible with UTF-8) and this is likely to break the import.
- Note:If you are having problems with the first question (or category modifier) in the file being misinterpreted (this particularly applies to GIFT format) it might be your editor adding a "Byte-Order-Mark" character at the beginning of the file. This is particularly common in Windows programs (e.g. Notepad) and is another good reason to steer clear of Microsoft products for text editing (as apposed to word processing). There are plenty of free or low cost text editors available for download. The BOM is neither recommended or required as UTF8 does not have byte order issues.
Imported grades must exactly match one of the fixed list of valid grades, as follows:
100, 90, 80, 75, 70, 66.666, 60, 50, 40, 33.333, 30, 25, 20, 16.666, 14.2857, 12.5, 11.111, 10, 5, 0
negative values of the above list are also permitted.
There are two settings for this switch. They affect how the import routine treats values that do not exactly match one of the values in the above list
- Error if grade not listed - If a question contains any grades not found in the list an error is displayed and that question will not be imported.
- Nearest grade if not listed - If a grade is found that does not match a value in the list, the grade is changed to the closest matching value in the list
Note: some custom import formats write directly to the database and may bypass this check.
Tips and tricks
- TIP: It may be easier and faster to type many questions into a single text file, than to create a series of Quiz or Lesson question pages. Some teachers report that once they master creating questions in one of the formats to import, they do not have to wait for their Moodle site screen to refresh and the process of selecting the next question type to create.
- TIP: Want to use questions from your quiz in a Lesson? Export the question category in say a GIFT format, then use a text editor to delete questions, or perhaps use a search and replace function to change names or places.
- Moodle XML Converter Convert your questions online into Moodle XML format. Allows to create questions from existing textfiles that should to be preformatted in a simple way. Supports TeX formulas, HTML and image embedded questions. Also can generate *.txt file from Moodle XML in case you need to export your questions in textfile.
- MoodleXMLBuilder converts commonly-used test generator output into Moodle XML. MoodleXMLBuilder currently supports converting tests and question banks created in Blackboard, ExamView, TestGen, and EZTest. Images are fully supported within all question fields where images are allowed within the Moodle quiz module.
- The help button link next to the import file button gives a lot of detail about each format in a popup window.
- Using Moodle escaping problem in gift import? forum discussion
- Converting files to UTF-8
- Import and export FAQ
- Eoin Campbell is working on a XSLT based import/export module for Word - stay tuned!
- website for converting Moodle Questions into tables in a Microsoft Word file, and vice versa.
- Using Moodle GIFT import - default grade forum discussion