It is not very difficult but it quickly becomes complicated.
The advantage of a user script is that you can adapt it to different cases (Adaptive mode or interactive mode with multiple tries. At the time of question selection, are students allowed
to see the questions in detail or only a summary, can they change their choice, if so how many times, etc.) The downside is that you have to know a bit of
JavaScript.
Ideally, a question type could be developed that would allow selection of the following questions. The downside is that such a question
type would not be that easy to develop. I would be interested in doing it, but I don't have the time and maybe not the knowledge.
So I used a little user script that I wrote earlier. If you don't know
JavaScript, I wouldn't recommend using
it because you won't be able to adapt it to your specific needs. Plus, it's just a workaround that isn't perfect, written by someone with no real programming background. And, as Rick mentioned, you'll have to adjust the marks in the gradebook. Anyway, here's the link:
https://moodleformulas.org/course/view.php?id=78§ion=52 ↗.