Measuring click time from start video to mouse click | XM Community
Skip to main content

Hi everyone,
I have no experience with Javascript whatsoever nor with Qualtrics. My current aim is to record the amount of time between when a preloaded movie starts playing and when a participant clicks on an image that represents: "i have decided".
So far, I have added a movie to my survey that preloads before autoplaying. I have also added a timer that starts as soon as the page is loaded. And Qualtrics also registers the mouse clicks of the participant in relation to the time.
But now the problems come:

  1. There is a difference between the page having loaded and when the movie has loaded, and thus, starts playing. Hence I was thinking to reset the time counter by adding an eventlistener that searching for the moment when the movie starts playing?

  2. The mouse click should only be registered if the participants clicks on the image that I described. All other mouse clicks should be ignored.

Can someone explain to me how to do this and what the code should be like?

  1. To get the actual time counter, you can either stop the auto play and ask them to click on play button to get the actual time by using javaScript.

  2. To get the number of clicks/click counter you will have to add a onClick function and set a variable based on that.Something like below:

var vid = document.getElementById("audi_player");
var i=0; 
vid.onplaying = function() {
  i=1;
var actual_click=i;
//console.log("played"+ i)
//alert("The video is now playing");
Qualtrics.SurveyEngine.setEmbeddedData('Q1_click',actual_click)
}




Leave a Reply