Welcome to the LimeSurvey Community Forum

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

Is it possible to declare a variable?

  • ancosema
  • ancosema's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #102563 by ancosema
Is it possible to declare a variable? was created by ancosema
Hello,

I would like show an overview of the already answered questions at the beginning of the (restarted) and the end of the survey. The problem is that in the beginning the variables are not yet declared (message: variable declared in a later page) and the survey visitor sees an error message. So how do I check if the variable is declared or not? Is it possible to check for the existence of a variable?

Thanks for any answer!
Anja
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 4 months ago #102596 by tpartner
Replied by tpartner on topic Is it possible to declare a variable?
You cannot access variables (questions) on pages (groups) that have not been visited yet, even if you are returning to the survey.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ancosema
  • ancosema's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #102600 by ancosema
Replied by ancosema on topic Is it possible to declare a variable?
Hello,

Thanks for the answer.

Is there a way to detect if a variable is not declared yet, because that would mean that the question has not been answered yet which is something that I can show in the overview in the beginning of the survey?

Or is there another way to show a list of which questions have been answered and which have not been answered yet?

Thanks,
Anja
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 4 months ago #102602 by tpartner
Replied by tpartner on topic Is it possible to declare a variable?
A question variable is not declared when the question is answered - it is declared when it's parent page (group) is visited.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ancosema
  • ancosema's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #102604 by ancosema
Replied by ancosema on topic Is it possible to declare a variable?
Thanks again for the answer...

So is there a way to check whether the variable has been declared already because in my case the question group only has one question so it's still useful to be able to check whether the question has been shown already (even in a previous start of the survey)?

Thanks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 4 months ago #102605 by tpartner
Replied by tpartner on topic Is it possible to declare a variable?
I'm sorry, I can't help.

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