Avoid pasting answers | XM Community
Skip to main content
Solved

Avoid pasting answers


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;
}

 

View original

5 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+32
  • Level 8 ●●●●●●●●
  • 633 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
Shashi wrote:

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+32
  • Level 8 ●●●●●●●●
  • 633 replies
  • January 18, 2024
Renataalmeida wrote:
Shashi wrote:

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 5 ●●●●●
Forum|alt.badge.img+48
  • QPN Level 5 ●●●●●
  • 366 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
vgayraud wrote:

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! 


Leave a Reply