Welcome, Guest
Username: Password: Remember me

TOPIC: How do I write a regular expression to match a specific password

How do I write a regular expression to match a specific password 2 years 2 months ago #85422

  • Anne68
  • Anne68's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
I want to restrict access to a survey to those who know a password - the same password for all users.

There are several threads that advise you how to do this, (create a short text question and then put conditions on all the subsequent questions)
The problem is I have NO idea how to write the condition.

Can I use a constant value, or does it have to be regex. What would that look like?
For example, if later questions only display if the user enters "Cats" in that first question, what do I put in the condition.
Can anyone take pity on me?
The administrator has disabled public write access.

Re: How do I write a regular expression to match a specific password 2 years 2 months ago #85424

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1151
  • Thank you received: 274
  • Karma: 79
Can anyone take pity on me?
yes of course!

the best is download and import the attached survey with both,
password with regex and password using conditions
...+ instructions

Ben/
Attachments:
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.

Re: How do I write a regular expression to match a specific password 2 years 2 months ago #85430

  • Anne68
  • Anne68's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Thanks so much, Ben
The administrator has disabled public write access.

Re: How do I write a regular expression to match a specific password 2 years 2 months ago #85512

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
When using the condition editor, you an "question X equals 'wgbwrigiwi' (constant)" expression.

When using the Expression Manager, a relevance equation like:
((pwquestion == 'mysecretpassword'))

...should do the trick ("pwquestion is the question code).

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: How do I write a regular expression to match a specific password 2 years 2 months ago #85602

  • Anne68
  • Anne68's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Thank you so much Mazi.

Ben had already helped. Actually, I had tried the correct way myself, but it hadn't worked because I hadn't copied the condition to the whole group.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.122 seconds
Donation Image