Welcome to the LimeSurvey Community Forum

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

Array question

  • coral.sanchez
  • coral.sanchez's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago #244636 by coral.sanchez
Array question was created by coral.sanchez
Please help us help you and fill where relevant:
Your LimeSurvey version:  Version 5.6.27
Own server or LimeSurvey hosting:
Survey theme/template: Fruity Theme ( fruity)
==================
I created an array (text) type question. (Image attached)
 
 1- I want each subquestion to have a different limited answer: subquestion 1 would have an answer between 0 and 99, subquestion 2 between 0 and 12, and subquestion 3 between 0 and 7.

2- Talking mandatory, the ideal would be for the person to be demanded to answer at least one subquestion.

3- For subquestion 4, is there a possibility to include a 'time' type question?

I really hope you can help me!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago - 1 year 4 months ago #244641 by Joffm
Replied by Joffm on topic Array question
Hi,
quick answer
1. The best is to insert dropdowns in the first three columns. Many examples in the forum. You may search for "with-select"
3. It is possible to insert a timepicker. But I do not recommend it. The look&feel is not the best. In my opinion better to insert an input mask
2.This you have to validate.

Here an image with a datepicker and some drop-downs.
 
As usual the best is to create a small sample survey and send the lss export.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 4 months ago by Joffm.

Please Log in to join the conversation.

  • coral.sanchez
  • coral.sanchez's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago #244653 by coral.sanchez
Replied by coral.sanchez on topic Array question
Here is my .lss export. I managed to insert dropdowns in the second and third columns. I believe that for the first column, a dropdown from 1 to 99 would be too much, therefore how could I limit the text answer, so that only numbers between 1-99 are valid? 
As for the last column, I really don't know what you mean with input mask.

Thanks for the help.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago #244656 by Joffm
Replied by Joffm on topic Array question
Please, we always ask for a lss export, neither lsq nor lsg.

Reason: lsq and lsg exports are language sensitive.
You can't import into a survey with different base language.
So we have to guess your base language, create a survey, create a group to be able to import your lsq file.

Furthermore the surveywide settings are missing which may be important in some cases.

Please, ease the life of us volunteers.
Copy the survey, remove everything not related to your problem, and send this as lss export.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • coral.sanchez
  • coral.sanchez's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago - 1 year 4 months ago #244667 by coral.sanchez
Replied by coral.sanchez on topic Array question
Sorry, I reattached the file in the correct extension.
I think this is the  surveywide settings:
Please help us help you and fill where relevant:
Your LimeSurvey version:   Version 5.6.27
Own server or LimeSurvey hosting:
Survey theme/template: Fruity Theme ( fruity)

My question:  I believe that for the first column, a dropdown from 1 to 99 would be too much, therefore how could I limit the text answer, so that only numbers between 1-99 are valid? 
As for the last column, I really don't know what you mean with input mask.
Last edit: 1 year 4 months ago by coral.sanchez.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago #244681 by Joffm
Replied by Joffm on topic Array question
Hi,
here your survey back.
I show three options.
1. With a timepicker. To be honest, I do not like it.
It is too large and you have to click and click and click to enter a time.
 

2. With the input mask library of Robin Herbots
[url] github.com/RobinHerbots/Inputmask [/url]
 

3. With the input mask library of Igor Escobar
[url] igorescobar.github.io/jQuery-Mask-Plugin/ [/url]
 

Both with validation
 

 

And here the lss
 

File Attachment:

File Name: limesurvey...6-28.lss
File Size:66 KB



By the way: In my opinion you should remove all dropdowns and let the respondents enter plain numbers that you validate (as in Q1)

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • coral.sanchez
  • coral.sanchez's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago #244768 by coral.sanchez
Replied by coral.sanchez on topic Array question
Thanks a million, that was a lot of help! You were right about the time picker, I have opted for Igor Escobar's mask library. However, I am still having trouble with the validation equation and validation message. I have attached the .lss file.
I have tried various things but it is not quite there yet.

Keeping in mind: 
X001 for every row should validate answers between 0 and 99
X004 for a valid time

1- I wanted the question to validate when at least one row is completed. (You wouldn't have to answer the whole table for the question to validate, only one row), and I made that work, however, the problem is that as soon as one row is entered correctly, no matter if there is an error in the next row the question will validate.

2- The goal is: 
X001 for every row should validate answers between 0 and 99: validation message when this is not matched 'Introduzca un valor entre 0 y 99 años'
X004 for a valid time: validation message when this is not matched 'Introduzca una hora valida'
Again, it kind of works with some little problems.
- For some reason, what happens now is that X002 and X003 also have to be answered for the message to turn green.
- Is it possible for the validation message to only appear when a wrong answer is typed?

Thanks in advance!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago #244772 by Joffm
Replied by Joffm on topic Array question
Hi,
the problem is that you get an initial error.
At the beginning all cells X001 are empty, So no fullfills the requirement  ">0 AND <100". You may add an "is_empty" as you did in X004.

Now another hint.
I assume that only rows are to fill, if I use this method.
So in my opinion it is better to ask for the used methods in a separate question and show only the subquestions of these methodes (buzzwird: array filter)

In this case ALL rows have to be filled.


If I have time I'll create an example.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 4 months ago #244778 by Joffm
Replied by Joffm on topic Array question
Well, here is my proposal.
Split the question.
Now the second question can be "mandatory" -> no need to validate the drop-downs.
I added the option "none" to the regex. So you get no initial error, but because of the mandatory question it must be filled before submitting.

And I changed the validation tip to two separate tips.
 
 
 


And the lss.
 

File Attachment:

File Name: limesurvey...4471.lss
File Size:42 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • coral.sanchez
  • coral.sanchez's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 4 months ago #244784 by coral.sanchez
Replied by coral.sanchez on topic Array question
Thanks a lot! That was super helpful.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose