Avoid pasting answers | XM Community
Skip to main content
Solved

Avoid pasting answers

  • January 18, 2024
  • 5 replies
  • 779 views

Forum|alt.badge.img+1

Hi! I’m very inexperienced with qualtrics and I could use some help with a specific point: 

I want to make a manipulation by asking participants to write a paragraph in the text entry type of question. However, I’m afraid they might use chatGPT to produce the text and fail my manipulation. Therefore, how do I create and insert a code that makes it not possible for people to copy & paste texts in their responses? 

 

I saw someone else here using the following code on JS, but it didn’t work for me: 

jQuery("#"+this.questionId+" .InputText:eq(0)").on("cut copy paste",function(e) {
   e.preventDefault();
  });

 

This is the link to where they mentioned this code: 

 

Thank you! 

Best answer by vgayraud

You are probably using simple layout, try using something like this instead :

let box = document.querySelector(".text-input");
box.onpaste = function () {
return false;
}

 

5 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • January 18, 2024

The code is correct and should work as it is working for me, please make sure it placed at the right place.


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 7 replies
  • January 18, 2024

The code is correct and should work as it is working for me, please make sure it placed at the right place.

Hi, Shashi! 

Could you help me understand where I should put it? It is not working for me. When I do the preview I can still paste texts on the text entry. Bellow, there’s a screenshot of what I did: 

Thanks


Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • January 18, 2024

The code is correct and should work as it is working for me, please make sure it placed at the right place.

Hi, Shashi! 

Could you help me understand where I should put it? It is not working for me. When I do the preview I can still paste texts on the text entry. Bellow, there’s a screenshot of what I did: 

Thanks

What question type are you using and have you paste this in the same question JS?


vgayraud
QPN Level 6 ●●●●●●
Forum|alt.badge.img+58
  • QPN Level 6 ●●●●●●
  • 551 replies
  • Answer
  • January 18, 2024

You are probably using simple layout, try using something like this instead :

let box = document.querySelector(".text-input");
box.onpaste = function () {
return false;
}

 


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 7 replies
  • January 18, 2024

You are probably using simple layout, try using something like this instead :

let box = document.querySelector(".text-input");
box.onpaste = function () {
return false;
}

 

Thank you very much! It works perfectly!