Welcome to the LimeSurvey Community Forum

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

Array (10 point choice)

  • Kelly202
  • Kelly202's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 months ago #164114 by Kelly202
Array (10 point choice) was created 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
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago - 6 years 2 months 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.

Code:
(!is_empty(TO2_SQ001.NAOK) &amp;&amp; TO2_SQ001.NAOK <= 5) or (!is_empty(TO2_SQ002.NAOK) &amp;&amp; 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: 6 years 2 months ago by tpartner.
The topic has been locked.
  • Kelly202
  • Kelly202's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 months 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!
The topic has been locked.
  • Kelly202
  • Kelly202's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 months 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!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose