A package to export test questions into Moodle from python or latex
Project description
moodlexport
The Jupyter Notebook Moodle_generator
contains Python code which allows to easily generate families of questions (called categories in Moodle) that can be directly exported to Moodle and used to create a test. The main idea is that :
- it is easier to define mathematical objects in Python than Moodle
- generating random problems is simpler in Python (Moodle provides a way to generate random number but it is quite a mess)
Features of this module so far :
- Creating a question. Supported classes of questions are:
- "essay" : the student answers in a white text box. Options are :
- Possibility for the student to upload a file as an answer as well.
- "multichoice" : the question comes with at least 2 possible answers. Options are :
- Possibility to specify "multiple answers allowed" or "unique answer allowed"
- "essay" : the student answers in a white text box. Options are :
- All the options available in Moodle are available here (defining a grade, information for the grader, feedback, etc)
- Creating a category (family) of questions
- Adding a question to a given category
- Export a category of questions under the format Moodle XML, which can be imported directly into Moodle.
- Supports Unicode éà ê ...
- Supports Latex syntax : correctly supports inline latex with
$e^x$
, and equation with$$ f(x) = \sum_i x_i^2 $$, \begin{equation*}...\end{equation*}, \begin{cases}
etc
Simple examples :
category = Category("Questions for exam 2")
question = Question("essay") # new open question
question.text("What is the derivative of $f(x) = e^x + 0.5 \Vert x \Vert^2$.") # question with latex
question.grade(1.5)
question.addto(category) # adds the question to the category
category.save() # creates a "Questions for exam 2.xml" file ready to import in Moodle
question = Question("multichoice") # new multiple choice question
question.text("Is every symmetric matrix invertible?")
question.grade(2.0)
Answer("Yes", False).addto(question)
Answer("No", True).addto(question)
question.addto(category)
category.save()
Known issues/missing features :
- Extract list of questions from .txt file is doable online see https://vletools.herokuapp.com/info/help but their code is not shared...
- for multichoice we never check that the sum of the fractions is equal to 100%
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
moodlexport-0.0.1.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for moodlexport-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 431e17326f8f9060aa4d67d59869a3cc249f9ccf1d28b439f6b7972877b6dd62 |
|
MD5 | 88367d3ab3fe44d08e262f60888072df |
|
BLAKE2b-256 | 6ca97993c0a63168a959d9e035bf7888160032679b2b54722e4869b0c7ea29b1 |