Welcome, Guest
Username: Password: Remember me

TOPIC: Extract current subject number for conditional hiding

Extract current subject number for conditional hiding 3 years 8 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.

Extract current subject number for conditional hiding 3 years 8 months ago #70542

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5725
  • Thank you received: 334
  • Karma: 255
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.

Extract current subject number for conditional hiding 3 years 8 months ago #70554

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5106
  • Thank you received: 1049
  • Karma: 440
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.137 seconds