Generates variants of exam questions using texsurgery, keeps a question database, exports to pdf and moodle
Project description
pyexams
Generates variants of exam questions using texsurgery, keeps a question database, exports to pdf and moodle.
Much like R exams, but with the following (main) differences:
- R-
exams
requires use of R for both creating exam variants and managing R-exams
itself, whilepyexams
allows any language for exam creation and is called from a command which can be incorporated into your favorite LaTeX editor. - R-
exams
keeps each question in a separate file, then use a simple R script to compose the whole exam, whilepyexams
use a single LaTeX file for the whole exam. - Both R-
exams
andpyexams
keep a record of past exam questions, butpyexams
also keeps a database that can be queried in order to find, for instance, all questions with the tagderivative
that appeared in exams at least two years ago. The question code is also saved in plain text and managed in agit
repository, which simplifies the management of a shared question bank, whether group-private or totally open. - Last but not least, R-
exams
is a mature and feature rich project, whilepyexams
is a very young project that still has to deliver.
Other important design decisions involved in pyexams
:
- The syntax for the questions is exactly that of auto-multiple-choice
- We will use amc2moodle (or a custom version of it) to generate the moodle question bank.
pyexams
strives to feel as close to LaTeX as possible to its users, which paradoxically is better done through texsurgery than through a LaTeX package.
Warning: Alpha version
This is still an early version. Use with care.
Installation
python3 -m pip install pyexams
-
Install also a LaTeX distribution which exposes the command
pdflatex
. -
At this moment, you may also have to install auto-multiple-choice. This will not be necessary in the future. It is not required to generate the moodle questions, but part of the pyexams experience is to compile the pdf often for quick feeedback.
-
You need to install the
jupyter
kernels you plan to use. Thepython3
kernel gets installed when you pip install pyexams, but in order to run the example, you need to installsympy
too:python3 -m pip install sympy
Install the sagemath kernel (optional)
Right now the only example uses sagemath. You need to install sagemath
, and then proceed to install the sagemath
kernel into your system's jupyter. True, the sagemath
bundle comes with a jupyter server inside, but that won't do: you need to execute this command, if you installed sagemath
as root:
`sudo jupyter kernelspec install YOUR_SAGEMATH_INSTALLATION_PATH/local/share/jupyter/kernels/sagemath`
and this other command if you installed it as a regular user:
`jupyter kernelspec install --user YOUR_SAGEMATH_INSTALLATION_PATH/local/share/jupyter/kernels/sagemath`
Usage
cd examples
# generates a pdf for the first student in the list (useful for testing)
pyexams sympy_example.tex
# generates one pdf for each first student in the list (runs in parallel)
pyexams sympy_example -all
# generates two pdf files for each first student in the list (runs in parallel)
# one with the exam statement
# other with the correct answer and an explanation
pyexams sympy_example -all -both
# generates a moodle question bank
pyexams sympy_example -moodle
# generates a moodle question bank with exactly 5 variants of each question
pyexams sympy_example -moodle -n 5
How to use
Moodle short questions
- Start with a template from the
examples
folder, make a copy, edit it. - Use
pyexams your_source_file.tex
to test quickly if your code works. - When happy with the result, run
pyexams your_source_file.tex -moodle -n 5
to generate a moodle question bank with exactly 5 variants of each question. - Inspect
your_source_file.xml
for obvious errors. - If the file looks fine, try to upload to moodle.
Long written answer
- Start with a template from the
examples
folder, make a copy, edit it. - Edit
students.csv
with the real data of your students. - Use
pyexams your_source_file.tex
to test quickly if your code works. - When happy with the results, run
pyexams your_source_file.tex -all -both
to generate two pdf files for each first student in the list: - one with the exam statement. - other with the correct answer and an explanation. - Distribute the exam statements at the date and time of the exam.
- Collect the students' solutions using a moodle task or any similar tool.
- Distribute the exam solutions at the end of the exam.
We suggest two ways to distribute the exam statements:
- Through moodle:
- Prepare a moodle folder activity in advance
- Prepare mock pdf files with the same filenames as the real exam statements.
- Zip all the mock exams into a single file, which you can upload to moodle and unzip to deliver all the mock exams quickly.
- Instruct your students to download the mock exam, as a check.
- At the date and time of the exam, upload a zip with the real exam stataments, and unzip it to replace the mock exams.
- Through email:
pyexams -send emails_config.ini email_body_template
will send an email to each student with the exam statement, or the exam solution, or any other file, such as acorrection
with the teacher's comments to each exam. You can find examples in theexamples
folder.
Talk at ENSEMAT II
The motivation behind this project and its design decision was presented (in spanish) at a talk at ENSEMAT II
Thanks
To all our colleagues that gave feedback to the early versions, specially Fabricio from ETSIN.UPM and carlos from ETSIAAB.UPM
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 pyexams-0.3.3.tar.gz
.
File metadata
- Download URL: pyexams-0.3.3.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d86290149d56ffb49c0c2b42ce196fd63ea869a86dd54352849b5ac4bbedf846 |
|
MD5 | db350b2b9a2093e121b7275c6179e198 |
|
BLAKE2b-256 | a13d3fdfde822e1e88560e61d95c23de0c620edd5e1838f94b62cf1e384da290 |
File details
Details for the file pyexams-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: pyexams-0.3.3-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf97d9ac16f205fd782db64cffba9416c8cbabce0f42db8e899a0bc4a6e39ab7 |
|
MD5 | 4a374b95dbbcd412f571d3c6864dd4aa |
|
BLAKE2b-256 | 534e3364d367a71eaa52b7e7449d0404bb5ed288224e3944fecb35ca91602f50 |