Java code to avoid identical answers and custom validation for URL links | XM Community
Question

Java code to avoid identical answers and custom validation for URL links

  • 23 October 2018
  • 3 replies
  • 35 views

Hello,
I am creating a survey where I ask participants to search online for some unique URL image links and to enter them in 200 text entry question. I would like to set up a java code that helps me to avoid identical text entries (i.e., subjects can copy paste the same links for many times). I could set up custom validation on each of the questions that it will only pass if what they enter is not equal to the text entry value for any of the previous questions( by using a piped text) but I was wondering whether there is a java code for this?
Second, the text entry must contain "https://" or something like that so that it has to be a link. Is it possible to do it with a java code? If I use a regex how should the expression look like?

Many thanks!!

3 replies

Hello @iuiu ,

This is just for custom validation for URL links:
Try using this Regex in custom validation and just remove the following part from it `?|ftp`
Userlevel 6
Badge +18
@iuiu ,

Hope this thread help you to get solution for identical text entries.
Thanks Shashi for the Regex!!

@SaurabhPujare_Ugam, I am not very familiar with javascripts and I am having some troubles in understanding how to incorporate it in qualtrics. 😞 Because I have questions as text entry and I have say that entry text of those questions should not be equal.

Leave a Reply