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

TOPIC: Extract current subject number for conditional hiding

Extract current subject number for conditional hiding 5 years 10 hours 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 5 years 10 hours ago #70542

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
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)survey-consulting.com'"
The administrator has disabled public write access.

Extract current subject number for conditional hiding 5 years 9 hours ago #70554

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