examgeneratorpython3


Generates .html formatted from .xml and .txt files (with settings)

Here are some instructions for using the program : First. To run it, you need to have Python (ver 3.1.1) or later. Then, start the file from command prompt/terminal/bash typing, navigate to the program folder (where you have unzipped it .. google if you don't know how) python3 start.py But read the documentation first, because there are some other important things too.

Basicly what the program do is, creating tests from text files filled with questions. Its getting questions (formatted in a specified way) form specified folder, than randomly choose questions to match the requirements (for questions cound and maximum sum of questions difficulty). To successful do that, first you'll want to check out the settings.txt file. From there, you should specify the inputFilesPath(default is inputFiles), the outputFileName. Restrictions for num questions from file are written in restrictions.txt in format : file_name:questionsCount, minDifficulyt, maxDiddiculty.

The program tries to read every file from the inputFilesPath. There are two ways to create 'readable' file : using XML formatting or plain text. If you choose plain text, you should format it like this :

<

<DIFFICULTY>

. .

and so on... >

If you want, you can add labels before lines. They are used only for commentaries, and they have no affection on the result at all. Comments are applied with <#>. So : the heading will be#What is the answer ? the answer is:#1 diffuculty#0 answer0#1 answer1#42

is completely equivalent with :

What is the answer ? 1 0 1 42

If you use XML format, the hierarchy should look like that :

<test>

<question>

<head>

Question title goes here

</head>

<difficult>

5

</difficult>

<correct>

2

</correct>

<answers>

<answer>

1

</answer>

<answer>

2

</answer>

<answer>

3

</answer>

</answers>

</question>

</test>

Please be aware, that all digits should be positive integers. Max difficult is 5, min is 1. If you set it some other value, the program will auto change it to the closest valid.

You can specify which question from which file to be included in generating. In questionToBeIncluded file, just type the name of the file, followed by semicolon and separate question numbers with comma. Like that: new_questions.txt:1,2,3,4 You can also use semicolon for numbers, where 1:10 means question from 1 to 9. Example : new_questions.txt:0,1:9,15:30,45

From the settings.txt you can set test name, date, I/O files paths(and names), something like third heading (

<type>

of the test), min and max sum of test difficulties (

<from>

and

<to>

), exact questions count (

<questionCount>

). Please be aware, that if some of the values in settings.txt are ill-formated, program will close after startings.

If you have some ill-formatted files in the input folder, they will be skipped when generating test. In some places, you can put html-tags, but its not really a good idea :).

Be aware, that <#> sign is reserved in plain-text-question files. <:> (semicolon) is reserved in settings.txt.

If something somewhere went wrong, just reinstall. Its 10kb. And check out the examples, its useful.

Behave and enjoy.

Blago, taskov@gmail.com

Project Information

Labels:
examgenerator testgenerator schooltest collegeexams