aegis module

AEGIS: Academic Exam Generator for Interchange and Shuffe.

The purpose is to compose a collection of exams from a set of several versions of a number of problems. This is useful to generate several examns with a similar dificulty. It also can be used to generate alternative exams from a pool of exercises.

class aegis.aegis.Exam

Bases: object

Exam (class): tools to generate exams with random exercises.

load_template : load template

gen_examples(N_problems=1, N_versions=[[1]], dir_exams='exams/')

Generate exams example files.

N_problems: int
Numbers of the problems in the exams
N_versions: list of lists
Numbers of the versions to be used in the problems
dir_exams: str
Directory where latex files are stored
problems: list
List of the numbers of the problems
versions: list of lists
Lists with the numbers of the versions
gen_excell(output_dir='./', fname_xlsx='exams_versions.xlsx')

Generate an Excell file with the contents of the exams.

output_dir: directory where to put the excell file

None

generate(N=0, output_dir='./', shuffle=True, all_permutations=False, makepdfs=False, interactive=False)

Generate exams suffling and randomly chosing items.

N : int (optional)
The number of exams to generate. If N is greater than the number of iterations, some exams will be repeated (by the Pigeon-hole theorem.)
shuffle : boolean (optional)
If True, shuffle the versions of the exercises to generate random versions of the exams. Dafault: True
all_permutations : boolean (optional)
If True, generate the complete list of possible combinations of the versions of the exercises. If N is present, it will be ignored. Default: False.
makepdfs : boolean
If True, compile PDF files from latex files. Default: False.
interactive: boolean
If True, return a list with the version used on the exams.
ex_list : list
A list containing the versions of the exercises. Only returned if “interactive=True”.
load_items(idir, items, subitems)

Load exercises to compile exams.

idir: str
Directory where latex files are stored
items: list
List of numbers representing exercises
subitems: list
List of lists that contain the versions for each one of the exercises in “items”.
load_template(template_file)

Load a template.

template_file: str
Name of the file containing the latex template

Updates the self.template variable.

make_latex_filename(p, v)

Get the name of latex filenames from problem and version numbers.

If name_pattern was not set, the default convention is used.

name_pattern(problem_part, version_part, parts_separation='_', problem_format=2, version_format=2)

Set the convention for latex filenames.

This convention must include two parts, the “problem_part” and the “version_part”. If not set, the default is used: problem_part = ‘e’ version_part = ‘v’