LDEV-5162 Fix Ordering answers saving to DB To reflect an order that a learner put his answers, a TreeSet was used. Its comparing function u…
Show more
LDEV-5162 Fix Ordering answers saving to DBTo reflect an order that a learner put his answers, a TreeSet was used.Its comparing function uses displayOrder.It works fine when elements are put into the set during the first save,i.e. the first autosave or a submit before the first autosave.But when another save occurs (another autosave or a submit after thefirst autosave), the set of answers is not recreated. Only displayOrderof answers is modified. But TreeSet is not aware of it and keeps oldordering. The iteration that happens during the save picks up answers inthe old order.The fix uses real displayOrder value instead of counting on correctorder in TreeSet.Another solution would be to rebuild the set after modifying answers'displayOrder.
Show less