excel2moodle.extra package
This extra subpackage conains standalone scripts
The modules inside extra can be run standalone, but are planned to be available from the main Window as well
To run a script execute the following: python -m excel2moodle.extra.SCRIPT
Note that there is no .py
at the end!!
Submodules
excel2moodle.extra.equationVerification module
Script for verifying the equations written into the result
field of NFM-type Question
This script does two things.
It calculates all the answers obtained from the series of variables.
It compares the calculation of the first answer to the
firstResult
field.
Usage
From the main UI
Start this tool from the top bar in the main Window under the Tools section
A new window will open inside you:
Enter the Number of the Category
Enter the Number of the Question
Click on
Run check now
and Inspect the resultsRinse and repeat
As Script
Start this script with
py -m excel2moodle.extra.equationVerification
inside the top-level DirectoryEnter the Number of the Category
Enter the Number of the Question
Inspect the results
Rinse and repeat
- excel2moodle.extra.equationVerification.checkResult(checkerValue, calculation, tolerance=0.01)[source]
Checks if the two Arguments are within the tolerance the same value
- Parameters:
checkerValue (fleat) – the value the calculation is compared against
calculation (float) – the value to be compared against checker Value
tolerance (float, optional) – the standart tolerance is 0.01 -> 1%
- Returns:
True if checkerValue == calculation False if checkerValue != calculation
- Return type:
bool
- excel2moodle.extra.equationVerification.equationChecker(categoryName, qNumber, spreadsheetFile)[source]
This Function calculates all Results an invokes the checkResult function
- Parameters:
categoryName (str) – The category in which the question to be tested is This must match a sheet name of the spreadsheet
qNumber (int) – The number of the question which results are tested
spreadsheetFile (Path) – The Filepath to the spreadsheet
- Return type:
tuple
[list
[str
],list
[float
],float
]- Returns:
bulletPointsString (list[str]) – The string list with the bullet points, with numeric values instead of variables
results (list[str]) – The list with the calculated results
checkerValue (float) – The value taken from the
firstResult
field