Moodle test creator

This script allows incorporating to the Moodle question bank test quizzes written in any word processor. When managing a large number of questions, this script provides a quick way of bulk loading them.

This program transforms three types of test questions to the gift format: single answer, multiple answers and short answer.

In single answer mode only one alternative could be marked and there are only two possible ratings: success (100% of the score) or fail (zero points).

In multiple-choice mode questions have at least one correct answer, and multiple alternatives could be checked. The rating of each question will be proportional to the number of correct answers pointed out: if, for example, guesses are only one of two correct answers, the score will be 50%, 33.3% if they were three, etc. Any incorrect answer makes the score will be zero.

In short answer mode answer must be typed and it will be 100% credited if it matches exactly any of the correct responses, or zero otherwise.

The question formats that Moodle and gift format allow are much wider than the ones presented by this script. You can explore the possibilities offered by Moodle in this link

Instructions for creating a test in gift format

You can create the questions in any word processor, for example MS Word, with the following scheme: Each question should be expressed in a paragraph followed by the alternatives in each of the adjacent paragraphs. The next question is separated from the previous one by a carriage return (a blank line) and so on. That is to say, the question delimiter is a blank line.

The right choices in each question must be indicated by an asterisk (*) as the first character of the paragraph. Dont number questions or answers since Moodle does it automatically and numeration will be duplicated. (See this image and examples at the end of this page.)

Once you have configured the questions, copy them to the clipboard and paste them into the text area. Make sure you do not spare any blank line at the beginning or at the end of the text. Select question type and press "send". If you wish, you can put an identifier common to the questions to be translated, it is useful to classify and sort them in the Moodle Question Bank.

Save the output file to your hard drive and then import it into the Moodle Question Bank. The text generated by the program is UTF-8 coded and should not cause problems for its incorporation into Moodle. Nevertheless, if text contains some uncommon or exotic characters, is convenient to check them editing the output file and correcting them manually if necessary.

To import the questions log into Moodle--> Question Bank-->Import--> check gift format, select the file you have just saved and follow instructions. (More information about importing questions into Moodle).


Transform your questions

Paste the questions in the text area; the first paragraph should be the first question

Type of questions:

Single Answer
Wise selection [Each question shall be considered "Single Answer" type if it only has one valid answer, "Multiple-Choice" if it has two or more correct answers or "Short-Answer" if all answers are correct.]

Others [Short-Answer; Single-Answer, but correct answers>1]

[optional] Exam Identifier (This code will appear -only for teacher eyes- in the query name.
This code makes easier to identify and order queries in the Moodle Question Bank.)

[optional] Name of the file to be generated (no extension)

Do not UTF-8 encode. (If some characters are not displayed correctly, you can try to improve the result by checking this box. You will get a text file, which must be UTF-8 encoded using a suitable program. For this you can use the free text editor Notepad++: encoding -> convert to UTF-8 without BOM.)


Examples of questions as they should be pasted in the text area

Do not forget to indicate with an asterisk the correct answers
Comment is optional

What values can assume the square root of 4?-com-Remember that the square root always has two values: one positive, one negative. [general feedback]

Who is buried in Grant's tomb in New York City?
*Grant-com-OK. Grant's remains were buried in the tomb in 1897 [answer feedback]
No one-com-Was true for 12 years, but Grant's remains were buried in the tomb in 1897
Napoleon-com-He was buried in France
Churchill-com-He was buried in England
Mother Teresa-com-She was buried in India

The demand function for good X is: <br> $$Q_{x}^{d}=40-2P_x$$ <br> Mark the correct answers:
$$\frac{dQ_{x}^{d}}{dP}= -2$$ is the slope of the curve
X is an inferior good
*Demand for X is price-elastic for Px > 10
*Price-elasticity is 1 for Px = 10.


[You should check "Others" or "Wise selection" for the last question, with all alternatives right, to be a "short answer" question type]
[You could use the html tags <br> or <p> to separate lines in questions and/or answers]
[You could feedback the answers by entering at the end of each one the expression: -com-(including hyphens)
and the comment next. To make a general feedback enter -com- followed by the general comment in the same paragraph
after the question. Also you can enter the general feedback as an answer preceded by -com-.
Comments will appear after the exam qualification.]

Number of questions converted until now:

Author: Manuel Vilas. Comments and suggestions are welcome