Saving the time of clicks during a video | XM Community
Solved

Saving the time of clicks during a video

  • 26 December 2019
  • 2 replies
  • 22 views

Badge +6
Hey (:
I uploaded a video from Qulatrics libary.
The subject need to press space when he recognize a dangerous situation (while watching the video).
I want to save the time of all the presses.
The subject can press many times and I need to save each time
how can i do that?
and how can I get access to saved data ?

this is my code:
Qualtrics.SurveyEngine.addOnReady(function()
{

let question = this;

/* hide next button */
question.hideNextButton();

/* when the video end, click on next button */
jQuery($('videoPlayer')).on("ended", function() { setTimeout(function () {jQuery('#NextButton').click();},1000); });


document.onkeydown = function(event) {
if (event.which == 32) {
let pressCuurnetTime = $('videoPlayer').currentTime /* the time when the subject pressed space */
event.preventDefault();

}
}

});
icon

Best answer by TomG 26 December 2019, 15:18

View original

2 replies

Userlevel 7
Badge +27
Make 'pressCuurnetTime' an array and push the time onto it each time space is pressed.

Add an addOnPageSubmit function to convert the array to a comma separated string and save it to an embedded data variable.
Badge +6
Thank you! (:

Leave a Reply