/practice

converts LaTeX problems into interactive HTML quiz

Primary LanguagePythonApache License 2.0Apache-2.0

Practice

A lightweight utility that converts markdown problems into interactive HTML quiz

by Derek Wan, with contributions from Alvin Wan

All files containing questions are placed under source/ and must following the following format.

Question: <question goes here>
Option: <Answer choice goes here>
Option: <Answer choice goes here>
...
Correct: <Correct answer choice goes here>

You can add as many options as you need and as many questions as you need. Here is a sample questions file that you may have.

Question: What is 2+3?
Option: 3
Option: 4
Option: 6
Correct: 5

This file is accepted as input and then rewritten as HTML, using the following command, for a source file source/question.md

python practice.py source/question.md

We can also read from source directories. In which case, practice.py will simply run the generation script for all files in the directory. Consider a directory source/source1 for the following command.

python practice.py source/source1

This produces output in outputs/source/source1/, where each file resembles the following.

screen shot 2016-12-23 at 9 23 49 pm

Selecting an answer and clicking an answer then provides immediate feedback.

screen shot 2016-12-23 at 9 24 01 pm