A package to export test questions into Moodle from python or latex
Project description
moodlexport
This Python module provides code which allows to easily generate families of questions (called categories in Moodle) that can be directly created from either Python or Latex document, and then directly exported into Moodle (through the Moodle XML import functionality), where they can be used to create a test.
Overview of the possible conversions done within moodlexport |
---|
Installing
It can be installed with a pip command : pip install moodlexport
A quick overview of what this Module can do
This module focuses on two type of questions provided by Moodle : the multichoice
question (the student chooses one or more answers among others), and the essay
question (the student is provided a space to type its answer, or upload a document).
An essay question | A multichoice question |
---|---|
Say that you want to define a multiple choice question in Moodle. This requires a lot of parameters to tune, but for now let's focus on the essential : what you basically needs is
- The body/text of your question
- A list of potential answers
- Setting which answer is the good one (see the documentation for more advanced settings like having more than one good answer)
- Exporting that to Moodle
Here is a short overview on how to do that from Pyhton with moodlexport
.
Writing a multichoice question from Python |
---|
From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code here |
You could equivalently obtain the very same result by typing the question in a Latex file, and using moodlexport to convert it:
Writing a multichoice question from Latex |
---|
A latex file defining a question, and then converted to an .xml by Python. You can find the corresponding code here |
To write an essay question, the syntax is as simple:
Writing an essay question from Python |
---|
From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code here |
The interest of writing your questions in Python is that you can easily generate random problems. Suppose for instance that we want a random question where we ask the student if a polynomial equation $aX^2 + bX +c = 0$, with integer coefficients, has a solution or no.
One way to go is to generate a bunch of those questions, and then let Moodle pick one question at random among those during a test
. Here is one way to do:
Generating random questions |
---|
From top to bottom: 1) the python code defining a category containing many variants of a same question, and producing a .xml file; 2) some of these questions appearing in a category in Moodle 3) one such question in Moodle; 4) a sample of the .pdf produced by the Python code. You can find the corresponding code here |
Motivation
The main motivation behind this module is that :
- it is more comfortable to type maths in your day-to-day Latex interface than within Moodle
- it is easier to define mathematical objects (vectors, matrix) in Python than in Moodle
- generating random problems is quite intricate in Moodle, because we quickly face issues such as solutions being too complicated for the students (e.g. non integer), or Moodle being unable to handle certain student's answers (how would could Moodle interpret that $x+x$ is the same than $2x$?). This is much simpler to handle in Python.
- it is easier to manipulate locally a Latex or Python file than doing it on the Moodle interface. It also simplifies collaborating projects.
- it is more convenient to store/read questions/answers in pdf files, than using the Moodle 'bank of questions' interface.
More advanced documentation
To read more about what this module can do, on how the parameters of your question can be set, see the complete documentation here.
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
Built Distribution
File details
Details for the file moodlexport-0.0.32.tar.gz
.
File metadata
- Download URL: moodlexport-0.0.32.tar.gz
- Upload date:
- Size: 34.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.7.1 requests/2.25.1 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e7c4b8f6591a631b143bd98ae1c85407c9a1973b63bd96affb2ad164dca1ae4 |
|
MD5 | d2bd098d05cebca6655e56e98888b8dc |
|
BLAKE2b-256 | c82114e88ffacb0a96b7563da67e61a574e3f9a96bea05a1ac642d327ee56d52 |
File details
Details for the file moodlexport-0.0.32-py3.7.egg
.
File metadata
- Download URL: moodlexport-0.0.32-py3.7.egg
- Upload date:
- Size: 57.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.7.1 requests/2.25.1 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5947ca074cc2dd255427e1739020111489f47e2adc448950fbec636cd67c2a11 |
|
MD5 | 1e2bc062d60235296d3316b0071c3767 |
|
BLAKE2b-256 | 52b36ff1699f16cdd260610bc1bb0d33d1a03156dd54dba2fef0e98b27e4a9e1 |