imi-ms / MoPat

Mobile Patient Survey (MoPat) is a Java based web application to create, distribute, complete and export medical questionnaires.
https://mopat.dev
Apache License 2.0
9 stars 1 forks source link

The order of answers is randomized when adding new answers to an existing question #87

Open ywarnecke opened 2 months ago

ywarnecke commented 2 months ago

For at least the select question type (probably also for multiple choice) this behaviour can be observed.

While the elements are saved in the database with the correct order, upon retrieval the order is changed to another one, which is the same everytime.

It is likely caused by some peculiarity of hibernate.

A fix for this could be to also store the information of the order in the list, when saving it to the database. @OrderBy could then be used to restore this order upon retrieval