Hello.
I use a lot Pluto.jl and PlutoUI.jl for teaching.
Now, I am trying to have a dynamic element in the title.
However, I am having trouble with the update of the TableOfContents
I have defined the function:
function answered(ans::String)
if ans == "NR"
md"""## 🔴
---
"""
else
md"""## 🟢
---
"""
end
end;
where ans
is the resulting object of:
@bind ans Radio(["a)","b)","c)","d)","e)","NR"], default = "NR")
This should give a sense of progress in the Table of Contents when answering a multiple-choice questionnaire.
Each question is preceded by a cell containing:
answered(ans)
This prints the title perfectly well, according to the answer provided.
But the TableOfContents does not update unless I open “the eye” of a cell.
It seems that the JavaScript event observer does not detect a change in the title produced by a function.
Any ideas for a workaround?
Thank you!