Welcome to the LimeSurvey Community Forum

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

Equation question not working

More
1 year 2 months ago - 1 year 2 months ago #225939 by ployrich
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.27.14
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity (for baseline testing)
==================
I wanted to do some value assignment tests today and was stumped because suddenly the expression manager seems not to work within equation question anymore.
I have attached a minimal example and a screenshot of the error in the console.
(tried it in firefox and chrome)
Thank you.

P.S in the screenshot the secon question is the equation which should set the third question to 10 if 1 is chosen in the first question. I realize that i should have taken a screenshot that, but I assure you I am not faking this problem.

File Attachment:

File Name: limesurvey...9837.lss
File Size:15 KB
Last edit: 1 year 2 months ago by ployrich.

Please Log in to join the conversation.

More
1 year 2 months ago #225944 by holch
Replied by holch on topic Equation question not working
You equation and your question that will receive the "assigned value" need to be on a different page and the equation needs to come after the question you want to assign the value to. Tested and it works.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: ployrich

Please Log in to join the conversation.

More
1 year 2 months ago #225946 by ployrich
I could have sworn i tried all those iterations. Thank you for pushing me into my own error.

Please Log in to join the conversation.

More
1 year 2 months ago #225947 by DenisChenu
But this javascript broken must not happen : i think you can report the issue.

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.

Please Log in to join the conversation.

More
1 year 2 months ago #225948 by holch
Replied by holch on topic Equation question not working
It wasn't happening to me when I first tested the LSS ployrich had sent.

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

Please Log in to join the conversation.

More
1 year 2 months ago #225950 by tpartner
I agree with Denis, there should not be a JavaScript error. Please file a bug report - bugs.limesurvey.org .

Additionally, your equation is wrong. If you are trying to set "h1", this:

Code:
{if(setting == 1, h1 = 10, h1 = -90)}

Should be this:

Code:
{h1 = if(setting == 1, 10, -90)}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ployrich

Please Log in to join the conversation.

More
1 year 2 months ago #225956 by holch
Replied by holch on topic Equation question not working
Code:
{h1 = if(setting == 1, 10, -90)}

Yeah, this makes more sense and might not require to have the question and the equation on another page. But his/her equation works as well.

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

Please Log in to join the conversation.

More
1 year 2 months ago #225964 by ployrich
bug reported: bugs.limesurvey.org/view.php?id=17936

Thanks for all the help! Bookmarking this thread so I won't forget my oversight and the right syntax again.


P.S. I just found own notes with the right syntax...so I already was aware in a different life apparently.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose