Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Is it possible to declare a variable?

Is it possible to declare a variable? 2 years 9 months ago #102563

  • ancosema
  • ancosema's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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 administrator has disabled public write access.

Is it possible to declare a variable? 2 years 9 months ago #102596

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6323
  • Thank you received: 1407
  • Karma: 547
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 administrator has disabled public write access.

Is it possible to declare a variable? 2 years 9 months ago #102600

  • ancosema
  • ancosema's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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 administrator has disabled public write access.

Is it possible to declare a variable? 2 years 9 months ago #102602

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6323
  • Thank you received: 1407
  • Karma: 547
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 administrator has disabled public write access.

Is it possible to declare a variable? 2 years 9 months ago #102604

  • ancosema
  • ancosema's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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 administrator has disabled public write access.

Is it possible to declare a variable? 2 years 9 months ago #102605

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6323
  • Thank you received: 1407
  • Karma: 547
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 administrator has disabled public write access.
Time to create page: 0.307 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form