Welcome to the LimeSurvey Community Forum

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

Is it possible to pipe the result of an equation into the default answer?

  • LimeHo
  • LimeHo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 4 months ago #129368 by LimeHo
Hello,
I'm trying to get the results of an equation to be visible as the default answer for a single numerical input question type but it doesn't seem to be updating. From what I've read in the manual and the forums, it seems like it should be possible but I'm not able to get it to work. I'm using LS Version 2.5RC Build 151008.

Steps taken:
1. Survey has q1, q2, q3, total. Each are single numerical input question types
2. Survey also has a Equation question type: {sum(q1, q2, q3)} with question code: EqTotal
3. In total question, I put {EqTotal.shown} and it dynamically shows the value as I enter things into q1, q2, q3.
4. In total question, I put {EqTotal.shown} into the Default Answer but it only shows '0' regardless of what I put into q1, q2, q3

For #4, I've tried insertans:sidxgidxqid and other qID.{property} settings but it doesn't seem to work. From what I read there was a limitation of equation results only being available in subsequent pages but was updated to allow it after version 2.

Is it possible to pipe the result of an equation into the default answer?

Thanks in advance.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129371 by tpartner
The default answer isn't dynamic. It is only set once when the page first loads, so when that happens, q1, q2, q3 haven't been answered yet so it gets a value of 0.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LimeHo
  • LimeHo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 4 months ago #129376 by LimeHo
Thanks Tpartner! I suspected that as well but the examples that I saw made me believe that it was possible.

www.limesurvey-consulting.com/pre-fillin...xpression-manager-2/
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #129379 by tpartner
Note that that page says "The question for which you set the default answer has to be shown on a following page.".

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose