Set range condition for Other option & Multiple numerical input

More
4 months 3 weeks ago - 4 months 3 weeks ago #219185 by xueting
Hi all,
There are 2 questions about setting ranges for answers, I would appreciate if there will be any help. The lss. file is attached.  

File Attachment:

File Name: limesurvey... (1).lss
File Size:21 KB

Firstly, I was wondering is it possible to set range for the other option of List (radio)? In the following question showed in the 1st picture, the other option is for one-day cost of car-parking, and I'd like to set the range such as 20.

 

The 2nd is in regard to the Multiple numerical input showed in the 2nd picture. I read a post about how to set different ranges for answers,
forums.limesurvey.org/forum/can-i-do-thi...nge-condition#179363

The thing is it didn't work in my case. The ranges I expect for the 1st answer (hour) is 4, for the 2nd (minute) is 59.  Thus I entered the following into the question validatoin equation: (!is_empty(TripTimeWork_SQ001) AND !is_empty(TripTimeWork_SQ002) AND TripTimeWork_SQ001<4 AND TripTimeWork_SQ002<59)
Seems only Maximum value of input (59) works here. Now the max. limitation for both of them are 59.

 

Kind regards,
Xueting
Attachments:
Last edit: 4 months 3 weeks ago by xueting.

Please Log in to join the conversation.

More
4 months 3 weeks ago #219208 by Joffm
Hm, nearly correct.

Here your example back with some improvements.
 

File Attachment:

File Name: limesurvey...7947.lss
File Size:21 KB


You may fine tune the error messages.

   



Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
4 months 3 weeks ago #219222 by xueting
Thank you so much Joffm for your prompt reply, but there seems another problem for the quetion of List(radio), that is the survey can go on ONLY when the Other option is chosen. When chosing others, there will be the following note:

 

I was wondering how to cope with it?
Many thanks,
Xueting
Attachments:

Please Log in to join the conversation.

More
4 months 3 weeks ago #219231 by Joffm
You just have to add the case that a normal item was selected, like this
(CarParkWork=='-oth-' AND CarParkWork_other < 20) or (CarParkWork!='-oth-')

Joffm
 


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

Please Log in to join the conversation.

More
4 months 3 weeks ago #219233 by xueting
Understand, thanks a lot!

Xueting

Please Log in to join the conversation.

More
4 months 3 weeks ago #219256 by xueting
Hi Joffm, I was also wondering whether it's possible to establish logical relationships between ranges and answers? E.g. the range of trip time is dependent on the trip distance they would indicate.

Best regards,
Xueting

Please Log in to join the conversation.

More
4 months 3 weeks ago #219258 by Joffm
Of course it is possible.
Without knowing more, I should say
Use an equation with a nested if statement to set the time range depending on distance.
Use the result of the equation to set the logic of the time question.

Joffm


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

Please Log in to join the conversation.

More
4 months 3 weeks ago - 4 months 3 weeks ago #219266 by xueting
Thank you Joffm for your guidance!
It seems work well after I revised the equations a bit, I would appreciate if you could let me know once there is any problem in my equations.
Say the limitation is trip time < 0.05* trip distance:
   
 

Many thanks
Xueting
 
Attachments:
Last edit: 4 months 3 weeks ago by xueting.

Please Log in to join the conversation.

More
4 months 2 weeks ago - 4 months 2 weeks ago #219474 by xueting
Hi Joffm,
There is another question, whether it's possible to set ranges for boxes in table of Array(text)?
The lss.file is attached. As the following picture shows, column 1 and 4 are all the text field, I was wondering could they be set as numerical input and column 1 <100 while column 4<200?
   

File Attachment:

File Name: limesurvey... (1).lss
File Size:23 KB


Best regards,
Xueting 
Attachments:
Last edit: 4 months 2 weeks ago by xueting.

Please Log in to join the conversation.

More
4 months 2 weeks ago #219495 by Joffm
Hi,
you have to validate.
Here for the first row:
(is_empty(Q1_Y001_X001) or (is_numeric(Q1_Y001_X001) and Q1_Y001_X001 ge 0 and Q1_Y001_X001 lt 100)) and (is_empty(Q1_Y001_X004) or (is_numeric(Q1_Y001_X004) and Q1_Y001_X004 ge 0 and Q1_Y001_X004 lt 200))

and a hint like
{if(!is_empty(Q1_Y001_X001) and (!is_numeric(Q1_Y001_X001) or Q1_Y001_X001 ge 100),"Only numbers between 0 and 99 in column 1",if(!is_empty(Q1_Y001_X004) and (!is_numeric(Q1_Y001_X004) or Q1_Y001_X004 ge 200),"Only numbers between 0 and 199 in column 4",""))

 
 


You have to extend the validation for the other rows.

Joffm
 


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

Please Log in to join the conversation.

More
4 months 1 week ago #219684 by xueting
Thank you Joffm! It works well:)
Best regards,
Xueting

Please Log in to join the conversation.

More
3 months 4 weeks ago #220107 by xueting
Hi Joffm,
I have another question. That is when there is more than one range condition for a question,  then the red(!) without text would always there before all answers for blanks are entered, and the red(!) will turn to green (!) when the eligible answers are put in the blanks. It seems this mechanism of red(!) without text is a bit misleading. I was wondering can it disappear?

Many thanks,
Xueting
   
Attachments:

Please Log in to join the conversation.

More
3 months 4 weeks ago #220109 by Joffm
Let the validation start when both fields are "not empty"

Joffm


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

Please Log in to join the conversation.

More
3 months 4 weeks ago - 3 months 4 weeks ago #220112 by xueting
Sorry I don't understand, may I ask for your help with the attached lss. file please?
 

File Attachment:

File Name: limesurvey...4848.lss
File Size:21 KB


Many thanks,
Xueting
Attachments:
Last edit: 3 months 4 weeks ago by xueting.

Please Log in to join the conversation.

More
3 months 4 weeks ago #220114 by Joffm
You have to allow the empty fields.
If you say !is_empty() AND ... you have an error right at the start.
Of course these fields may be empty.
That they don't stay empty is because the question is mandatory.

So (is_empty(1) OR (is_empty(2)) and ...

 



Adapt the error messages.

Joffm

And you should remove this "0" from the default answers


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

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now