# Automated "marking"/"feedback" for tasks in a Julia course

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):

Is such a thing possible in Julia in some form? Ideally as part of a notebook environment, or as an add-on to the VScode plugin.

How have others solved this kind of thing?

2 Likes

Pluto.jl has PlutoTeachingTools.jl, and the MIT Intro to Computational Thinking course uses Pluto notebooks for assignments (with hints, result-checking, etc.).

1 Like

There was also https://ctessum.github.io/Grader.jl/ (I am not a user, I just remember it had been posted here).

As recommended before, I would go for a Pluto notebook with PlutoTest.jl.

Works fine in practice and is visually appealing.

1 Like

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

3 Likes

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)"`.

1 Like