Welcome to the LimeSurvey Community Forum

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

ExpressionScript HTML-Entities Compariosn

  • LurLur
  • LurLur's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 2 weeks ago #267922 by LurLur
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 6.5.1+240320
Own server or LimeSurvey hosting: own server
==================
The answers participants give to my questions might include characters like < and > as the questions are in regards to programming.
For example an answer could be '7<4' (without the ''). Later on, I want to give feedback on the correctness of the answer. However that provides a problem.
If I do the comparison with the question code and .show and compare (==) it with '7<4' the result is 0 instead of 1. It seems to me that Limesurvey transformed the answer somehow to '7&lt;4'. So it makes sense that the result is 0 (false) instead of 1 (true). However I can't (permanently) change my comparison text to '7&lt;4'; as limesurvey always reverses this back to '7<4' either instantly or after reopening the question which includes the ExpressionScript comparison. Is there any way how I can make this work?

Best wishes
LurLur

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 2 weeks ago #267923 by Joffm
Replied by Joffm on topic ExpressionScript HTML-Entities Compariosn
Hi,
what type of question?
Reading "question code and . show" I think of "list(radio)" or other "coded questions".
Otherwise ".show" is a bit strange.

Send the lss export of these relevant questions.

Joffm 

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

Please Log in to join the conversation.

  • LurLur
  • LurLur's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 1 week ago - 2 months 1 week ago #267957 by LurLur
Replied by LurLur on topic ExpressionScript HTML-Entities Compariosn
Hi Joffm,
thanks for your reply. I attached a small example of what I want to do. The first question asks you for some input. The second questions/text just gives feedback how many inputs are correct. You will see that every line which includes either <, > or & won't be count as correct.

 

File Attachment:

File Name: limesurvey...1-19.lss
File Size:29 KB
Last edit: 2 months 1 week ago by LurLur.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 1 week ago #267958 by Joffm
Replied by Joffm on topic ExpressionScript HTML-Entities Compariosn
HI,
use
html_entity_decode(G01Q01_SQ001)=="<",...

See here
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]

Joffm

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose