Check out the LimeSurvey source code on GitHub!

Profanity filter

More
5 years 2 months ago #69709 by Nem3s1S
I would like to setup a profanity filter for short/long free text answers, so if a user types any profanity, from a set/defined list, in their response and click next they will return to the question and told they cannot use profanity in their response. Can anyone point me in the right direction on how this might be achieved?

Please Log in to join the conversation.

More
5 years 2 months ago #69715 by jelo
Never saw this in a survey app, since you want to capture the voice of the proband. Never would use that, since it means influencing the proband. If the system is telling me "don't use profanity", I call it a clbuttic scenario ;-)

Technically I don't see any chance to implement this in a useful and reliable way.
A Javascript, which is used to parse the textfield where the proband is typing and display a info box. Ideas can be found here:
www.codingforums.com/showthread.php?t=192048

Please Log in to join the conversation.

More
5 years 2 months ago #69739 by Mazi
The only solution would be some Javascript which is run during text input and uses a predefined checking algorithm. You can disable the next button until the check says that it is a valid input.
But it will be hard to define a useful checking algorithm.


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 #69917 by Nem3s1S
Thanks for the feedback. I will look into JavaScript and will post back if i have any success.

Please Log in to join the conversation.

More
5 years 2 months ago #70038 by Mazi

Nem3s1S wrote: Thanks for the feedback. I will look into JavaScript and will post back if i have any success.

You're welcome.


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 #70103 by Nem3s1S
So two fantastic work associates and myself have worked on a Regular expression that is working for Short, Long, Huge free text answers. It works for at least one word at a time, but hey, its a start right! Here is what we have thus far:

/^(?i)((?!\bENTERPROFANITYHERE\b).)*$(?-i)/

Obviously replace "ENTERPROFANITYHERE" with your bad word!

The \b will allow passing of words such as "assassination" & "hello" if you enter ass or hell as your profanity word. This also works if you are trying to omit other words, names etc. from answers.

Feedback\Criticism is always welcome!

Please Log in to join the conversation.

More
5 years 2 months ago #70110 by Mazi


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 following user(s) said Thank You: Nem3s1S

Please Log in to join the conversation.

More
5 years 2 months ago #70375 by Nem3s1S
Added!

Please Log in to join the conversation.

More
5 years 2 months ago #70415 by Mazi
Great, thanks for your help.


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.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form