My goal is to make an online evaluation tool where you cannot cheat efficiently.
My idea is the following:
Therefore, there is no current counters of your points. You cannot check if answer A leads to a better result than answer B, unless you retry all the test.
Note: This kind of test is not pedagogical at all, as you don’t know where you were wrong.
Suppose you have \(n\) questions with each \(k\) possibles choices.
The number of possible hashes is given in the following table for different values of \(n\) and \(k\):
\(n\) | \(k\) | Outcomes |
---|---|---|
5 | 2 | 32 |
5 | 3 | 243 |
5 | 4 | 1024 |
10 | 2 | 1024 |
10 | 3 | 59049 |
10 | 4 | 1048576 |
20 | 2 | 1048576 |
20 | 3 | 3486784401 |
20 | 4 | 1099511627776 |
Assuming a hash is stored over 4 bytes (using a truncated hash, the collision probability is very low with the 4,294,967,296
possibilities), 1024 answers
requires 4k bytes
of memory.
10 questions is still manageable, requiring a few megabytes. However, this is not recommanded for large exams. In the case of 20 questions, it is recommanded to split them into \(4\) sets of \(5\) questions each.
You need to compute the hash of all possible answers, and to compute the associated score.
You can store this into a dictionary:
{ "0 pts": ["hash_01", "hash_02" , ...],
"1 pts": ["hash_10", "hash_11", ...],
...
"5 pts": ["hash_50"]
}
How to input data ?
I suggest a .json
input file, which would be a list of dictionaries, where each item in the list represents a question.
The dictionary representing a question contains:
You can also add another field which is the amount of points per question. Here, we just want to build the minimal prototype.
So, as an example:
[
{
"text": "Which animal is similar to the lion ?",
"answers": ["The dog", "The frog", "The cat"],
"good": 2
},
{
"text": "What is the result of 48 x 12 ?",
"answers": ["426", "576", "612", "512"],
"good": 1
}
]
Note: you do not need to have the same number of answers for all questions.
As I do not know how to program purely with Javascript and HTML, I created the script with bokeh.
There are three elements:
div
to display the question and final score;RadioButton
to select the answers;Button
to move to the next question.I needed to add an md5.js
script, as javascript does not have a built-in function.
When using CustomJS()
to add javascript interaction to bokeh elements, the javascript has access to all scripts that are loaded (at least) in the header.
We just added <script type="text/javascript" src="/assets/js/md5.js"></script>
to the header, and we could call within the script var my_hash = md5(my_results);
.
This is a short example with quant questions from A Collection of Quant Riddles With Answers
Not ready yet !
Coming soon :)
>> You can subscribe to my mailing list here for a monthly update. <<