Information: Importing Quiz Questions - Different file formats | |||||||||||||||||||||||||||
To create a quiz in Moodle, you
Importing questions allows you to easily add questions into your course question bank from an external source, such as a text file or a quiz file created through a program like Examview. You can import from a file you upload or that is already located in the course Files area. A number of file formats are supported:
GIFT format GIFT is the most comprehensive import format available for importing Moodle quiz questions from a text file. It was designed to be an easy method for teachers writing questions as a text file. It supports Multiple-Choice, True-False, Short Answer, Matching and Numerical questions, as well as insertion of a _____ for the "missing word" format. Various question-types can be mixed in a single text file, and the format also supports line comments, question names, feedback and percentage-weight grades. Here are some quick examples:Who's buried in Grant's tomb?{~Grant ~Jefferson =no one} Basics
Question Types Multiple Choice and fill-in-the-blank ("Missing Word" format): These questions have a section that contains the answers for the question as well as the question text. The answer section is surrounded by the { } brackets. Inside this answer section, wrong answers are prefixed with a tilde (~) and the correct answer is prefixed with an equal sign (=). Multiple choice and Missing word formats are handled the same way, and which format is used is determined by where the answer section is located. If it is before the closing punctuation mark, it is treated as a Missing word question. Otherwise, it is a Multiple choice question.Multiple choice: Who's buried in Grant's tomb?{~Grant ~Jefferson =no one} The Missing Word format automatically inserts a fill-in-the-blank line (like this _____) where the answer section is located in the question text. All question types can be written in the Missing Word format. For clarity, the answers can be written on separate lines and even indented. For example: The American holiday of Thanksgiving is celebrated on the { Short Answer: Answers in Short Answer question-type are all prefixed by an equal sign (=), indicating that they are all correct answers. The answers must not contain a tilde.Who's buried in Grant's tomb?{=no one =nobody}If there is only one correct Short Answer, it may be written without the equal sign prefix, as long as it cannot be confused as True-False. True-False: In this question-type the answer indicates whether the statement is true or false. The answer should be written as {TRUE} or {FALSE}, or abbreviated to {T} or {F}.Grant is buried in Grant's tomb.{F} Matching: Matching pairs begin with an equal sign (=) and are separated by this symbol "->". There must be at least three matching pairs.Matching Question. {Matching questions do not support feedback or percentage answer weights. Numerical: The answer section for Numerical questions must start with a number sign (#). Numerical answers can include an error margin, which is written following the correct answer, separated by a colon. So for example, if the correct answer is anything between 1.5 and 2.5, then it would be written as follows {#2:0.5}. This indicates that 2 with an error margin of 0.5 is correct (i.e., the span from 1.5 to 2.5). If no error margin is specified, it will be assumed to be zero.When was Ulysses S. Grant born? {#1822}Optionally, numerical answers can be written as a span in the following format {#MinimumValue..MaximumValue}. What is the value of pi (to 3 decimal places)? {#3.141..3.142}.You can specify multple numeric answers, and this is particularly usefully when combined with percentage weight grades. There is a problem with this, however. The Moodle web interface (the web page part itself) does not support this. This means the only way to add numerical questions with multiple answers is to create them in the text file and then import the file. To sum it up: multiple numeric answers work, but you can't enter them in the web page, you have to import them. Single answer numerical questions work fine through the web page. When was Ulysses S. Grant born? {#This example will count 1822 as correct, and then give half credit to answers from 1820 to 1824 (1822 with margin of error of 2). Essay: An essay question is simply a question with an empty answer field. Nothing is permitted between the curly braces at all.Write a short biography of Ulysses S. Grant {} Description: A description "question" has no answer part at allThe next set of questions will concern arithmatic Options In addition to these basic question types, you have the following options: line comments, question name, feedback and percentage answer weight. Line Comments: Comments that will not be imported into Moodle can be included in the text file. This can be used to provide headers or more information about questions. All lines that start with a double backslash (not counting tabs or spaces) will be ignored when the file is imported.// Subheading: Numerical questions belowWhat's 2 plus 2? {#4} Question Name: A question name can be specified by placing it first and enclosing it within double colons.::Kanji Origins::Japanese characters originally came from what country? {=China}If no question name is specified, the entire question will be used as the name by default. Feedback: Feedback can be included for each answer by following the answer with a number sign (# also known as a hash mark) and the feedback.What's the answer to this multiple-choice question? {For Multiple Choice questions, feedback is displayed only for the answer the student selected. For short answer, feedback is shown only when students input the corresponding correct answer. For true-false questions, there can be one or two feedback strings. The first is shown if the student gives the wrong answer. The second if the student gives the right answer. Percentage Answer Weights: Percentage answer weights are available for both Multiple Choice and Short Answer questions. Percentage answer weights can be included by following the tilde (for Multiple Choice) or equal sign (for Short Answer) with the desired percent enclosed within percent signs (e.g., %50%). This option can be combined with feedback comments.Difficult question.{~wrong answer ~%50%half credit answer =full credit answer}Note: The last two examples are essentially the same question, first as multiple choice and then as short answer. Note: It is possible to specify percentage answer weights that are NOT available through the browser interface. The Match Grades drop-down on the import page determines how these are handled. You can either request that an error be reported or that the answer weight be adjusted to the nearest valid answer weight. Specify text-formatting for the question The question text (only) may have an optional text format specified. Currently the available formats are moodle (Moodle Auto-Format), html (HTML format), plain (Plain text format) and markdown (Markdown format). The format is specified in square brackets immediately before the question text. More information on text formats in Moodle.[markdown]The *American holiday of Thanksgiving* is celebrated on the { Multiple Answers: The Multiple Answers option is used for multiple choice questions when two or more answers must be selected in order to obtain full credit. The multiple answers option is enabled by assigning partial answer weight to multiple answers, while allowing no single answer to receive full credit.What two people are entombed in Grant's tomb? {Note: There is no equal sign (=) in any of these answers and the answers should total no more than 100%, otherwise Moodle will return an error. To avoid the problem of students automatically getting 100% by simply checking all of the answers, it is best to include negative answer weights for wrong answers. What two people are entombed in Grant's tomb? { Special Characters ~ = # { } : These symbols ~ = # { } : control the operation of how the file is imported and cannot be used as normal text within questions. Since these symbols have a special role in determining the operation of this filter, they are called "control characters." But sometimes you may want to use one of these characters, for example to show a mathematical formula in a question. The way to get around this problem is "escaping" the control characters. This means simply putting a backslash (\) before a control character so that question import will know that you want to use it as a literal character instead of as a control character. For example:Which answer equals 5? {When the question is processed, the backslash is removed and is not saved in Moodle. Specifying Categories It is possible to change the question category into which the questions are added within the GIFT file. You can change the category as many times as you wish within the file. All questions after the modifier up to the next modifier or the end of the file will be added to the specified category. Up to the first category modifier the category specified on the import screen will be used. Note that for this to work the from file: box must be ticked on the import screen.To include a category modifier include a line like this (with a blank line before and after): $CATEGORY: tom/dick/harryor simply $CATEGORY: mycategory...the first example specifies a path of nested categories. In this cae the questions will go into harry. The categories are created if they do not exist. Aiken Format The Aiken format is a very simple way of creating multiple choice questions using a clear human-readable format. Here is an example of the format: What is the correct answer to this question?Rules:
Moodle XML format This Moodle specific format imports quiz questions that have previously been exported in the same format. The format is straightforward and is best demonstrated by exporting a category in the Moodle XML format. The XML format is capabable of importing image files.Category Switching You can insert a special dummy question into the XML file to specify the category path into which the following questions will be inserted. If the category or categories do not exist they will be created. Note that the from file: option must be ticked on the option page or this code will be ignored completely. You can switch categories in the xml file as often as you wish.An example of the format is as follows: <question type="category"> Missing Word This format only supports multiple choice questions and short answer question, depending on the number of answers. One answer generates a short answer question, two or more answers generate a multiple choice question. Each answer is separated with a tilde (~), and the correct answer is prefixed with an equals sign (=). Here is an example of a multiple choice question:As soon as we begin to explore our body parts as infants we become students of {=anatomy and physiology ~reflexology ~science ~experiment}, and in a sense we remain students for life.Here is an example of a short answer question: As soon as we begin to explore our body parts as infants we become students of {=anatomy and physiology}, and in a sense we remain students for life. Blackboard This module can import questions saved in Blackboard's "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.Blackboard V6+ 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.WebCT This module can import questions saved in WebCT's text-based format. The WebCT import function is in development and does not support all of the WebCT question types. At the time of writing this, only Multiple Choice and Short answer questions are supported. Here are some examples of these questions in a text file:# Start of question: Short Answer Question Course Test Manager This module can import questions saved in a Course Test Manager test bank. It relies on different ways of accessing the test bank, which is in a Microsoft Access database, depending on whether Moodle is running on a Windows or Linux web server. Course Test Manager is an "End of Lifetime" software package from Course Technology. It is no longer being actively developed by Course Technology. It has been replaced by a new test manager called ExamView.Embedded answers (Cloze) This very flexible question type is similar to a popular format known as the Cloze format. Questions consist of a passage of text (in Moodle format) that has various sub-questions embedded within it, including:
This question consists of some text with an answer embedded right here {1:MULTICHOICE:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer} and right after that you will have to deal with this short answer {1:SHORTANSWER:Wrong answer#Feedback for this wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer} and finally we have a floating point number {2:NUMERICAL:=23.8:0.1#Feedback for correct answer 23.8~%50%23.8:2#Feedback for half credit answer in the nearby region of the correct answer}.<br /> This example will appear to students as:<br /> The multichoice question can also be shown in the vertical display of the standard moodle multiple choice.<br /> <br /> {2:MCV:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}<br /> Or in an horizontal display that is included here in a table<br /> <br /> {2:MCH:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}<br /> Note that addresses like www.moodle.org and smileys :-) all work as normal:<br /> a) How good is this? {:MULTICHOICE:=Yes#Correct~No#We have a different opinion}<br /> b) What grade would you give it? {3:NUMERICAL:=3:2}<br /> <br /> Good luck!
Learnwise format This format can import multiple choice questions saved in Learnwise's XML format.Examview format This format can import from Examview 4 XML files. Note that the older versions of Examview are not supported.Import and Export formats are a pluggable resource (added in as modules). Other optional formats may be available in the Modules and Plugins database. A note about character encodings If your file contains non-ascii characters then it must use UTF-8 encoding. You may be able to select or convert to UTF-8 using your favourite editor, or it may be an option in the exporting software. Be particularly cautious with files generated by Microsoft Office applications, as these commonly use special encoding which will not be handled correctly. XML based import formats will be handled automatically provided your Moodle server is running PHP 5. |