Processing interact ipywidget user input with Sage

asked 2025-01-29 10:31:42 +0100

Wuffi gravatar image

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?

edit retag flag offensive close merge delete