Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Randomize answer options in array (not subquestions)

More
3 years 10 months ago #200790 by Gustavo_Kremer
Replied by Gustavo_Kremer on topic Randomize answer options in array (not subquestions)
Hi, I'm trying to use this solution in version 3.22.17, but it's not working. I'm attaching an example of the kind of question in which I need to randomize the order of columns.
I tried pasting the function in my theme's "custom.js", and also in the source of the very question (just as you can see in the attached example), but in neither case the columns are randomized.
Any help will be much appreciated!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200795 by Joffm
Elissa asked for randomization of answer options

I would like to randomize answer options in an array question - not subquestions but answers options

Only in arrays the colums are called answer options,
in array(text) or array(number) both scales (x-scale and y-scale) are called subquestions.

So I think this script works is an array, not an array(numbers).

Therefore I changed your question to type "array".


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The topic has been locked.
More
3 years 10 months ago #200796 by Gustavo_Kremer
Replied by Gustavo_Kremer on topic Randomize answer options in array (not subquestions)
Many thanks Joffm. Unfortunately, switching from Array (Numbers) to Array is not an option in this case, because Array won't let me choose more than one answer per row or column (basically, what I'm trying to do is to join a series of multiple choice questions in a single grid/array).
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200799 by Joffm
Hi,
I did not suggest that you change the type of question.
I pointed out that this script is the wrong tool; it has a different purpose. (As you cannot paint your house using a screwdriver)

"array" and "array(numbers)" are totally different things.
In an "array" the database provides one field for each subquestion (row) - there is only one answer per row - but in other arrays, where there is an answer in each cell, the database has to provide a field for each row and each column.

You may read this to find an example for array(number).
forums.limesurvey.org/forum/spanish-foru...triz-de-n%C3%BAmeros

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Gustavo_Kremer
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200808 by tpartner
The columns can be re-ordered via JavaScript.

Gustavo_Kremer, to avoid confusion, please start a new topic with an appropriate title and attach your sample survey there.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Gustavo_Kremer
The topic has been locked.
More
3 years 10 months ago #200827 by Gustavo_Kremer
Replied by Gustavo_Kremer on topic Randomize answer options in array (not subquestions)
Many thanks to both of you. I'll do that!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose