This application is used to convert a quiz specified in a specific format of text file, to MOODLE XML format.
Currently tested in python 2.7. Will not work in python3 as prints have a different syntax. You are welcome to port it . Also tested only on windows environment only.
python moodleXmlGen.py -i -o
If -o option is not used, the output will be to console.
In this repository a sample input file name called sample1.txt is provided . and a generated sample output is also provided call sample2.xml is provided. To convert the text file into an XML file (say output.xml) following would be the command line
python moodleXmlGen.py -i sample1.txt -o output.txt
A global debug flag in dPrint.py is by default set to 0, if you set it to 1, it will output debug information.
Cannot document what the debug info actually means, but you can Send it to me along with input file, it will help me fix problem
Appreciation/Cribs/CR , feel free to contact me @ firstname.lastname@example.org
Supported Question Types
- Short Answer
- Multi Choice
Also Marks/Feedback for each of these question types can be specified. By default the Marks is taken as 1.
A parser looks of the following constructs. (Plz don’t use these as a part of description of question/answer/choices. Dunno what will happen)`
- to identify questions that are short answer type. Only these constructs must be present in the line.
- f or truefalse type of questions
- type of question
- / for essay answer question
- Q>> keyword To identify question.
- C>> keyword tTo identify choice
- F>> keyword To identify feedback
- Marks>> keyword for marks (IDeally should have been M, but ....)
- D>> key work for description. The use case is suppose you want to describe a scenario, and then asks questions related to the description, this key word is used. See the attached sampleQpaper.txt for its usage.
Seem the attached "sampleQpaper.txt to understand how to write the txt file that specifies your questions/answers/choices
You can sepcify regular expression as answers. But have never been able to make it to work in Moodle server. It interprets the RE literaly. There are articles which describes how RE is supposed to work, but was unable have a success with it