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

**URL:** <https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117>\
**Category:** Teaching & Outreach\
**Created:** [April 5, 2023, 2:46pm UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117 "2023-04-05T14:46:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TS-CUBED](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ts-cubed/32/25292_2.png) [@TS-CUBED](https://discourse.julialang.org/u/TS-CUBED)\
**Post date:** [April 5, 2023, 2:46pm UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117/1 "2023-04-05T14:46:21Z")

</div>

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

 ![Screenshot from 2023-04-05 15-38-55](https://global.discourse-cdn.com/julialang/original/3X/4/1/41938b9a7785372094274c33d14a8f702736a4ad.png)

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?

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [April 5, 2023, 3:01pm UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117/2 "2023-04-05T15:01:54Z")

</div>

Pluto.jl has [PlutoTeachingTools.jl](https://github.com/JuliaPluto/PlutoTeachingTools.jl), and the MIT [Intro to Computational Thinking](https://computationalthinking.mit.edu/Fall22/) course uses Pluto notebooks for assignments (with hints, result-checking, etc.).

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [April 5, 2023, 5:29pm UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117/3 "2023-04-05T17:29:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [April 5, 2023, 6:48pm UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117/4 "2023-04-05T18:48:14Z")

</div>

As recommended before, I would go for a Pluto notebook with [PlutoTest.jl](https://github.com/JuliaPluto/PlutoTest.jl).

Works fine in practice and is visually appealing.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [April 5, 2023, 6:58pm UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117/5 "2023-04-05T18:58:27Z")

</div>

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](https://github.com/mitmath/JuliaComputation) and to ask me any questions! The more you advance in the class, the better the homeworks become 😅

---

<div class="post-metadata">

**Author:** ![rgouveiamendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rgouveiamendes/32/218636_2.png) [@rgouveiamendes](https://discourse.julialang.org/u/rgouveiamendes)\
**Post date:** [April 6, 2023, 9:33am UTC](https://discourse.julialang.org/t/automated-marking-feedback-for-tasks-in-a-julia-course/97117/6 "2023-04-06T09:33:24Z")

</div>

I would definitely recommend that you switch to [Pluto.jl](https://plutojl.org/) Notebooks.  
I have developed a simple function in the context of multiple-choice questionnaires mad in Pluto Notebooks that reads as follows:

```julia
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:

```julia
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](https://github.com/JuliaPluto/PlutoTeachingTools.jl) package like this:

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