LiaScript/LiaScript

Add option to randomize answers in quizzes

Closed this issue · 8 comments

It would be nice to have an option to randomize the questions in a quiz. This also has some didactical reason as students likely repeat the multiple choice questions. Rather than memorizing on which order the right answer is, a randomization option would be good handle this issue.

How would such an option look like? What do you think?
Maybe like this?

> [!randomize]
- [( )] Not selected
- [(X)] **This one has to be selected**
- [( )] ~~Do not select this one ...~~

Hi @hayribakici ... That sounds very interesting. The simplest option, I could imagine, could be to add another data-attribute, as we also use it for tables (this way it may not annoy users using other Markdown-interpreters):

<!-- data-randomize="true" -->
- [( )] Not selected
- [(X)] **This one has to be selected**
- [( )] ~~Do not select this one ...~~

From your experience, would it be better to change the options on ever visit of the slide/quiz or should one randomization be preserved. In the case of matrix-quizzes, should also the order of the columns change? If so, other attributes might be added. Do you know some example/configuration options of other LMS?

Yeah, your suggestion looks good!

From your experience, would it be better to change the options on ever visit of the slide/quiz or should one randomization be preserved.

That is a good question. I think the simplest way (from the implementation point of view, I assume) is to randomize the questions after each visit. And so far I have seen it like this (we used ILIAS as an LMS, which has exactly this behaviour). Ideally, the randomiziation should take place, once a question has been falsely answered and restarted.

I actually don't know how others do it with matrix quizzes. I would say, that only the rows should be randomized.

Ah I think I got it ... then there might be three options, right?

<!--
  data-randomize="true"
  data-clear-on-false="true"
  data-randomize-on-false="true"
-->
- [( )] Not selected
- [(X)] **This one has to be selected**
- [( )] ~~Do not select this one ...~~

the first, would only randomize the quiz on every view, the clear on false would also clear the user input after a wrong result, and the third would randomize it also after every wrong input ... does this makes sense or could this be simplified?

I mean, if you do not define a version for your course, then it is assumed to be in development mode, the data is not stored persistently within the browser. If you add a major version of larger than one

<!--
...
version: 1.0.0
-->

# Title

then also the wrong inputs will be preserved, when you come back to a quiz ...

If you add a major version of larger than one

<!--
...
version: 1.0.0
-->

# Title

then also the wrong inputs will be preserved, when you come back to a quiz ...

I think this is no problem. In fact, this is a good thing, as the user should know that there are quizzes that need to be correctly answered.


the third would randomize it also after every wrong input ... does this makes sense or could this be simplified?

I think it can be simplified: when the user restarts the quiz if it has been wrongly answered, the answers should be randomized. It means that the restart of the quiz should be treated like the quiz is displayed the first time. So this:

<!--
  data-randomize="true"
  data-clear-on-false="true"
  data-randomize-on-false="true"
-->

can be summarized into this:

  data-randomize="true"

the clear on false would also clear the user input after a wrong result

regarding the data-clear-on-false attribute, I made this state-diagram

meaning, the randomization and input clearance should happening in any way. So far, I would keep it as simple as possible, imo. Unless I forgot something.


@hayribakici Okay, that was more difficult than expected ;-) elm does not like random functions ... I think his is a pretty nice feature. clear-on-false and the other features would maybe be too much ... That is why I added it as discussed, only the data-randomize and it only performs a shuffle on lines, not columns in matrices ... I will test it and then update it in the next release ...

https://github.com/LiaScript/LiaScript/tree/feat/randomizedQuiz

I will inform you, when it is online ;-)

@andre-dietrich very cool, thank you!

@andre-dietrich thank you very much for this feature 🥇