Welcome to the LimeSurvey Community Forum

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

Can't get this to work in an equation question

  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #176743 by jma6610
I need all three of these to be true for the result to be a 1 else 0. I can get it to work with just two of the three, but not all three. What's wrong?



{if((TOKEN:ATTRIBUTE_70!="Not at all") && (is_empty(SeriousProblemsClose_1.NAOK) && (is_empty(SeriousProblemsClose_1.NAOK)),"1","0")} 

Thanks in advance.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #176779 by Joffm
Brackets:
Code:
{if
( 
  (TOKEN:ATTRIBUTE_70!="Not at all") && 
  (
    is_empty(SeriousProblemsClose_1.NAOK) &&
  (  
    is_empty(SeriousProblemsClose_1.NAOK)
  )
  ,"1","0"
) 
}

You see: The first "is_empty" - closing bracket missing.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #176795 by DenisChenu
Replied by DenisChenu on topic Can't get this to work in an equation question
Why not write directly:
Code:
TOKEN:ATTRIBUTE_70!="Not at all" && is_empty(SeriousProblemsClose_1.NAOK) && is_empty(SeriousProblemsClose_1.NAOK)

More simple and here : see is_empty(SeriousProblemsClose_1.NAOK) 2 times : then only 2 consition are finally checked …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #176808 by jma6610
Thanks DenisChenu and JoffM,

I've finally found the problem (was a typo where a 1 was supposed to be a 2 - DenisChenu noticed that), but curious why neither of your solutions will work on the 2.59.1 Lime version I'm using when I'm experimenting a bit to learn more.

This is within an equation question. It won't let me use new lines within the code when placed within the html editor (as JeffM suggests for clarity) and I can only use the format suggested by DenisChenu within a relevance field and not within the equation question itself.

Perhaps there is something I don't understand, or perhaps this is something unique to the installation that's used by my university?

Any idea?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #176820 by holch
Don't ever use the HTML editor. I wouldn't even use it in code view. Switch it off, when you are trying to write code. It only gets in the way.

In equation questions you need {}, within relevance fields you don't.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #176821 by jma6610
I'm working from my university's installation of Lime and I know that they have certain things blocked. e.g., I had to ask the folks running the servers to permit me access to the template editor. I'm unsure that I can get access to switch the HTML editor off but I may try. ...can't find any option to do that in my installation. Can you let me know where it should be?

TIA
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #176827 by DenisChenu
Replied by DenisChenu on topic Can't get this to work in an equation question
HTML editor can be set to popup in your preferences : manual.limesurvey.org/First_login_-_your...ces#HTML_editor_mode

else, if question code are OK and you have attribute #70 in token table
Code:
TOKEN:ATTRIBUTE_70!="Not at all" && is_empty(SeriousProblemsClose_1.NAOK) && is_empty(SeriousProblemsClose_2.NAOK)
work sure at 100%

Without the lss file or a screenshot of logic file …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #176847 by jma6610
Thanks Denis,

I'm seeing in the manual section you provided that access to switch to and from the HTML mode is set in global settings by the superadministrator. I believe that this has been turned off for me by default. If I really need it, I'm sure that the server folks will give me access, but for now I'm more comfortable with the HTML editor.

At least I now understand why I'm seeing differences between what I'm seeing on line and what works in my situation. ...and know what to ask the server/superadmins for if I need to get away from the html editor.

Thanks for your kind assistance.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #176853 by DenisChenu
Replied by DenisChenu on topic Can't get this to work in an equation question

jma6610 wrote: I'm seeing in the manual section you provided that access to switch to and from the HTML mode is set in global settings by the superadministrator.

better look at page please …
manual.limesurvey.org/First_login_-_your...My_personal_settings
And dis you try to click on Yor settings menu
manual.limesurvey.org/First_login_-_your..._account_preferences

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #176857 by jma6610
Ah, now I understand. I found the option to turn the html editor off and also the option for the pop-up as per the manual pages you pointed out. The option wasn't blocked.

Thanks much.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose