Iβm looking at introducing Julia as an alternative to Matlab in our undergraduate teaching.
Matlab has this neat feature in their introduction course, where the tasks are automatically checked and the student can try again until they get it right (and can only progress after they got it right):
I helped redesign the latest edition of the MIT class mentioned above, and in particular I wrote all the homeworks as Pluto notebooks with automatic feedback. Feel free to poke around at GitHub - mitmath/JuliaComputation: Repository for Common Ground C25 and to ask me any questions! The more you advance in the class, the better the homeworks become
I would definitely recommend that you switch to Pluto.jl Notebooks.
I have developed a simple function in the context of multiple-choice questionnaires mad in Pluto Notebooks that reads as follows:
function grading(ans::Union{Nothing,String},correct::String)
if typeof(ans) == Nothing
md"""
π *Please select one option.*
"""
else
if ans == correct
md"""
!!! tip "π Correct!"
"""
else
md"""
!!! danger "π Wrong answer"
Try again. **But you should study!!!** π‘
"""
end
end
end;
The function takes two arguments: ans, which can be either Nothing (when no answer was provided yet) or a String, and correct, which is the String corresponding to the correct answer.
After each cell with the answer options (usually βa)β, βb)β, βc)β, βd)β and βe)β ) I run my previous function in another cell as:
grading(q01,"b)")
where q01 is the variable where the answer to question 1 is stored and "b)" is the correct answer. Usually, q01 is bound to a radio selector from PlutoTeachingTools.jl package like this:
@bind q01 Radio(["a)","b)","c)","d)","e)"])
But it should work also with a String not bound to any predetermined answersβ selector.
However, I did not test the function with a more elaborated correct option apart from a small string like "b)".