Array (10 point choice)

More
1 year 1 month ago #164114 by Kelly202
Hi. I apologise now as I am extremely new to using LS (2 days of using it)

I have set up a 10 point array scale for students to choose between 1 and 10 on how their course prepared them for their job and how relevant it was. (1 being not very prepared/relevant and 10 being the most prepared/relevant)

I then created a follow up question"If you scored 5 or less please explain why"

On this question I set conditions so if the students clicked on 1-5 a box would appear for them to write their details in. If they clicked 6-10 the box wouldn't appear.

However this works fine until I click on number 10 on the scale and the box still appears for them to comment in even though 10 is greater than 5 and my conditions definitely say <=5

((( ! is_empty(TO2_SQ001.NAOK) && (TO2_SQ001.NAOK <= "5")))) or ((( ! is_empty(TO2_SQ002.NAOK) && (TO2_SQ002.NAOK <= "5"))))

Does anyone know why number 10 on the scale is not registering as being greater than 5?

Thank you
Attachments:

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 year 1 month ago #164117 by Joffm
Replied by Joffm on topic Array (10 point choice)
Hi, Kelly,

because you seem to compare text by saying TO2_SQ001.NAOK <= "5".
In this case "5" is greater than "10", because this text starts with "1".

You have to compare numbers.
TO2_SQ001.NAOK <= 5


Regards
Joffm


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

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago - 1 year 1 month ago #164119 by tpartner
Replied by tpartner on topic Array (10 point choice)
Try removing the quotes around 5 - they convert it into a string instead of a number.

(!is_empty(TO2_SQ001.NAOK) && TO2_SQ001.NAOK <= 5) or (!is_empty(TO2_SQ002.NAOK) && TO2_SQ002.NAOK <= 5)

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 1 month ago by tpartner.

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #164122 by Kelly202
Replied by Kelly202 on topic Array (10 point choice)
Thank you Joffm.
Think I was on the right track, was just getting too frustrated understand why!

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #164123 by Kelly202
Replied by Kelly202 on topic Array (10 point choice)
Thank you.
Have managed to do this now so much happier today than I was yesterday trying to figure it out!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!