Quizzicalc aims to be a convenient platform for students and tutors to make quizzes for simple algebraic problems, while keeping them engaging. Users can generate quizzes of 2 different topics and variable difficulty, and with the help of the symbolic computation library SymPy, the quizzes generated are truly random. Every quiz is reproducible, so users are able to share quizzes to compete with their friends!
Built using React and Django.
Clone this repository onto your computer.
To install the Python dependencies (including Django), in the root folder:
pip install requirements.txt
Ensure that you have Node.js (v18.16.0 was used as of development) installed. To download the relevant dependencies to build the React project, in /frontend
:
npm install
npm run build
Once the build directory has been created, we may run the Django project within the root folder:
python manage.py runserver
After which Quizzicalc should be running locally.
In the quiz generator, each question (either "Expand" or "Factorise"-type questions), their answers, along with 3 other sufficiently convincing options, are generated randomly and on-the-fly with the help of SymPy.
An simple expression like
x
/ \
+ +
/ \ / \
a 1 b 2
where the internal nodes can be any binary operator (e.g.
- More interesting expressions involving order of parentheses are generated (by nature of the tree structure)
- With each tree being complete, the height of each tree corresponds naturally to the complexity of each question, providing a method to customise difficulty
SymPy (symbolic computation library) was then used to expand/factorise each expression to obtain the correct answers. In order to generate 3 other convincing options, each constant in the expression tree would be randomly changed by some
In order to make the quizzes reproducible, while storing them in the database would be perfectly viable, we wanted to try serializing each quiz into a unique "seed" for others to use.
For every expression tree, given its preorder traversal (like
Each internal node can only either be
For example, suppose the question has a preorder traversal
All internal nodes are encoded into a 1-bit equivalent, and all leaves are encoded into a 5-bit equivalent, then we concatenate the array into a base64 string:
Since topic is Expand ("e"), number of qns is 1 (0-indexed so we represent it with a 0), and difficulty level is 1, these 3 characters are appended, resulting in the final seed "U3X0e01".
In general, a quiz with