Is it possible to declare a variable?

More
3 years 10 months ago #102563 by ancosema
ancosema created the topic: Is it possible to declare a variable?
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

Please Log in to join the conversation.

More
3 years 9 months ago #102596 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
3 years 9 months ago #102600 by ancosema
ancosema replied the 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

Please Log in to join the conversation.

More
3 years 9 months ago #102602 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
3 years 9 months ago #102604 by ancosema
ancosema replied the 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

Please Log in to join the conversation.

More
3 years 9 months ago #102605 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now