Can't get this to work in an equation question

More
3 months 2 days 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.

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

More
3 months 2 days ago #176779 by Joffm
Brackets:
{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

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

More
3 months 2 days ago #176795 by DenisChenu
Why not write directly:
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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

More
3 months 2 days 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?

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

More
3 months 2 days 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

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

More
3 months 2 days 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

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

More
3 months 2 days ago #176827 by DenisChenu
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
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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

More
3 months 2 days 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.

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

More
3 months 2 days ago #176853 by DenisChenu

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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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

More
3 months 1 day 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.

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!