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

More
5 years 2 months ago #85422 by Anne68
Anne68 created the topic: How do I write a regular expression to match a specific password
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?

Please Log in to join the conversation.

More
5 years 2 months ago #85424 by Ben_V
Ben_V replied the topic: How do I write a regular expression to match a specific password

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/

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Attachments:

Please Log in to join the conversation.

More
5 years 2 months ago #85430 by Anne68
Anne68 replied the topic: How do I write a regular expression to match a specific password
Thanks so much, Ben

Please Log in to join the conversation.

More
5 years 2 months ago #85512 by Mazi
Mazi replied the topic: How do I write a regular expression to match a specific password
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)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 2 months ago #85602 by Anne68
Anne68 replied the topic: How do I write a regular expression to match a specific password
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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!