h5p / h5p-multi-choice

10 stars 98 forks source link

Inconsistent resetTask behavior across content types #159

Open otacke opened 1 year ago

otacke commented 1 year ago

https://github.com/h5p/h5p-multi-choice/blob/5f38a906fdbda7a270d7ca535bf3099edb9bc0df/js/multichoice.js#L574

The resetTask function is what is resetting a task to its initial state (https://h5p.org/documentation/developers/contracts#guides-header-5). This implementation does this just fine.

In contrast, when the user hits the 'Retry' button, the task will be reset plus the answer options will be shuffled (https://github.com/h5p/h5p-multi-choice/blob/5f38a906fdbda7a270d7ca535bf3099edb9bc0df/js/multichoice.js#L697-L712).

I wonder what the intended behavior of resetTask here is exactly. It is handled differently across content types. For instance, Multiple Choice and Single Choice Set keep the item order, but Drag the Words shuffles the draggables on every call to resetTask. Check with the Course Presentation demo, for instance

From the perspective of a compound content types, it could make sense to randomize a subcontent on reset (if that makes sense for the content type and if the content type is configured accordingly) in order to present the user with a fresh start instead of having the same order of items again and again. There could, however, also be cases where the exact same order is expected.

I'd just like to know what the expected behavior, so I can

@fnoks Do you happen to have any insight to share here?