Welcome, Guest
Username: Password: Remember me

TOPIC: Extract current subject number for conditional hiding

Extract current subject number for conditional hiding 2 years 7 months ago #70534

  • kuehnik
  • kuehnik's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Can I use the current subject number in a hidden text question to conditionally show/hide a subsequent question?

E.g.: Show a question to all subjects with even subject number and hide it from all subjects with odd subject number?

TIA,
Nik
The administrator has disabled public write access.

Re: Extract current subject number for conditional hiding 2 years 7 months ago #70542

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5301
  • Thank you received: 291
  • Karma: 247
Have a look at the conditions wiki page: docs.limesurvey.org/tiki-index.php?page=...g+conditions&no_bl=y

Theoretically it should be possible using a regular expression but I have never tried: docs.limesurvey.org/Using+regular+expres...r+LimeSurvey&no_bl=y

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Extract current subject number for conditional hiding 2 years 7 months ago #70554

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4069
  • Thank you received: 747
  • Karma: 341
By "current subject number" do you mean the response ID?

If so, you can use the {SAVEDID} placeholder to retrieve it but only after a question page has been submitted.

Then it would be fairly easy to use the JavaScript modulus operator to determine whether the ID was odd or even and populate a hidden question accordingly.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.143 seconds
Donation Image