NVlabs / FPSci

Aim Training Experiments
Other
70 stars 23 forks source link

Random order question key bind fix #357

Closed bboudaoud-nv closed 2 years ago

bboudaoud-nv commented 2 years ago

This branch fixes a bug when using randomOrder questions with optionKeys specified. Previously logged responses were potentially incorrect in this configuration. Now the mapping of options to optionKeys does not change when randomOrder = true is specified in config. Only the presented order of options is changed (the key binds remain the same).

Merging this PR closes #356.

bboudaoud-nv commented 2 years ago

It is worth mentioning that the current fix uses a nested for loop to find the correct index for the option key bind between the (possibly randomized) dialog options and original question options arrays. Alternatively we could use a table-based lookup for these key binds instead, improving runtime by making question configuration serialization a bit more complicated. This may be worth looking into.