44.1: AnswerCheck tool
- Page ID
- 70566
The jupytercheck
Package is intended to provide students with immediate feedback to check answers inside of a Jupyter notebook. This was written with a Linear Algebra class in mind so it tries to do a robust comparison and take into consideration different object types as well as round off errors.
It works by providing a function called answercheck
that takes in a variable to be checked and a “hash” which is a one-way function encoding the answer. The program generates a new hash based on the input variable and compares the two hash values. An output is provided that the answer appears correct or incorrect.
The program is also designed to run without installing anything in python. However, it does require the download of the correct file.
Two use answercheck
we will need to download answercheck.py
to your current working directory. You only really need to do this once. However, if you delete this file by mistake sometime during the semester, you can come back to this notebook and download it again by running the following cell:
Verify you have answercheck
installed by running the following cell
For more information about how answercheck
works watch the following video:
Direct Link to the Youtube video.
Make sure you do not change the checkanswer
commands. The long string with numbers and letters is the secret code that encodes the true answer. This code is also called the HASH. Feel free to look at the answercheck.py
code and see if you can figure out how it works?