New question type: drag-and-drop ordering question

Re: Tárgy: Re: New question type: drag-and-drop ordering question

by Adriane Boyd -
Number of replies: 0
The bug is that under certain conditions you only see one of the items to be ordered. I noticed it a few times over the summer, but refreshing the page fixed the problem and I didn't track it down. Someone reported it to me as a bug in November or December, so I figured out what was going on. After some more testing, I think that it only happens when you view or preview a quiz for the first time.

I think my fix here is a hack. (I think I need to fix something in the session initialization, but I can't figure out what's going wrong.) Before, I was only checking for whether the values in $responses were unset to see if I needed to initialize the item positions to a default random order. In some cases (such as the initial quiz preview) the values in $responses were initialized to 0, so the items were overwriting each other in position 0 in the displayed list and you end up only seeing the last one in the list. What's weird is that refreshing the page fixes the problem. Anyway, I added a check so that if they're < 1, it also does the position initialization.

-Adriane