Questionnaire response order after adding responses in dropdown

Questionnaire response order after adding responses in dropdown

by Michael Schultz -
Number of replies: 2
I have a client who comes to me for inquiries as we did their initial setup, and I like helping them out. They're having an issue using the questionnaire plugin in Moodle 2.9.3. We did not set this plugin up for them, so I don't know if this was the best option for the particular task, but they're using it so I'll assume they thought it was best at the time. It seems their questionnaire, which is related to collecting agency and work information has some dropdown responses which in some cases have a large number of options, such as the "which agency do you work for question" which has nearly a hundred. Every so often they have to add additional agencies to this list as they support new groups, and this works just fine if you add the new groups to the end of the dropdown list. Given the large number of possibilities they want this alphabetized, but when adding new selections to anything but the bottom it appears to cause previous answers to be changed to the one which occupies its former position in the list. This may be something as simple as a setting in the questionnaire they've overlooked, or perhaps this is just a limitation of the dropdown menu in questionnaires. I've searched for guidance on this particular conundrum, but no specific hits. As always any guidance would be appreciated.


Average of ratings: -
In reply to Michael Schultz

Re: Questionnaire response order after adding responses in dropdown

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

This is a know issue with questionnaire. Care should always be taken when modifying the questions of questionnaires that have already been completed by some users. When it was developed, it was assumed that questions would remain mostly static, so that response reports made sense.

The problem with changing choices in a drop down (for example), is there is no easy way to determine if a change is being made to the text of an existing choice, if a choice is being removed, or if a choice is being added. The code assumes position is important, and assumes that if the text changed for an existing position, then that choice's text changed. If the list gets shorter, choices are deleted from the end of the list. If the list gets longer, choices are added to the end of the list.

What needs to happen is that there needs to be a more extensive choice editor, so that selections can be made from defined choices. It is not a small change.

mike

In reply to Mike Churchward

Re: Questionnaire response order after adding responses in dropdown

by Michael Schultz -
Thanks for the reply Mike.

They were actually able to resolve it (sort of) yesterday with the following quick fix, though it is not a comprehensive solution:

"-Embedded jquery in the HEAD using the form in moodle’s interface

-Used JQuery script in the question body to re-order the options, putting the “Choose…” option on top still.

This only works if any new entries are added to the list at the bottom.  Items can’t be removed, though if there is no better solution in the future we may want to just find a way of doing that in javascript while leaving the choice in the database for reporting purposes."

It's too soon to know if there are any long term drawbacks to this approach.