Processing interact ipywidget user input with Sage
I would like to write an interactive textbook with interactive exercises.
Automatic computer-based assessment of answer to more elaborate algebra exercises requires checking of algebraic equality/equivalence of student answers like in x^(-1) = 1/x
.
Existing solutions like preTeXt
don't allow for checking algebraic equivalence.
Other tools like the STACK
question type for Moodle or NUMBAS
are not well suited for writing textbooks.
Expanding either of them to a suitable solution would result in a architecture like using Sage within a Jupyter notebook.
This combination is actually only lacking a suitable Jupyter extension to write interactive math exercises providing automatic assessment of user input.
Therefore, I thought about using a simple text input from ipywidget's interact()
function to get user input and Sage for checking algebraic equivalence.
(I am aware that the students could in this case look at the code of the cell to get the answer to the question. That's fine, my idea is to provide possibilities to practice and correct answers anyway).
Has anyone ideas about alternatives or tried to implement something similar?