Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Can I create custom arrays?

Can I create custom arrays? 2 years 4 months ago #106528

  • christianC
  • christianC's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
hello everybody,

For a university project study I need to make an array that looks like:

Do you:
smoke? No Yes [Number]per day
Drink No Yes [Number] per day

and so on....
is a single answer per row with an added number input.


Thank you for your time.
The administrator has disabled public write access.

Can I create custom arrays? 2 years 4 months ago #106530

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5062
  • Thank you received: 748
  • Karma: 227
That is a normal array question. You can choose your scale (in this case "Yes / No". I think there is even a "Yes / No" scale already built in, but it includes "yes / no / uncertain".

But just choose the normal array question and you are totally free to create your own array header.

manual.limesurvey.org/Question_types#Array
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Can I create custom arrays? 2 years 4 months ago #106534

  • christianC
  • christianC's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Thank you for your answer. Yes it is a yes/no question but the third field should be a text field or number field. Maybe I did not explained clearly enough. I know that I can choose array I define the header and the rows but my question is if I can customize the row content to have mixed content

to be like:

Question text

Answer1 [radio button]No [radio button]Yes [number input]some text
Answer2 [radio button]No [radio button]Yes [number input]some text


the two radio buttons to be like a single answer per row and the number input mandatory if yes selected.

I presume I need some javascript for this. I have seen the topic with grouping of items but is not very doable when you have a list of 50 questions in an array to make this kind of question grouping. That's why I as if is a way to make my own custom array with NO/Yes and a input text.
The administrator has disabled public write access.

Can I create custom arrays? 2 years 4 months ago #106551

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6114
  • Thank you received: 1356
  • Karma: 532
You will need to add a multiple-short-text question after the array and use JavaScript to move the text inputs into the array.

Here is a similar solution - www.limesurvey.org/en/forum/design-issue...to-text-input#102550


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: christianC
Moderators: ITEd
Time to create page: 0.236 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form