# Array (10 point choice)

9 months 3 weeks ago #164114 by Kelly202
Kelly202 created the topic: Array (10 point choice)
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:

9 months 3 weeks ago #164117 by Joffm
Joffm replied the 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

9 months 3 weeks ago - 9 months 3 weeks ago #164119 by tpartner
tpartner replied the 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: 9 months 3 weeks ago by tpartner.

9 months 3 weeks ago #164122 by Kelly202
Kelly202 replied the topic: Array (10 point choice)
Thank you Joffm.
Think I was on the right track, was just getting too frustrated understand why!

9 months 3 weeks ago #164123 by Kelly202
Kelly202 replied the 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!