JavaScript: Retrieve the current time from a 'Timing' question | XM Community
Skip to main content

Hi everyone,

I'm trying to retrieve the current time from a 'Timing' question type using JavaScript. I came across some older code that appeared to work in the past, but unfortunately, it's not functioning for me now. You can find the code snippet below. Does anyone have insights into what might be causing the issue? Is it possible that the class for the 'Timing' question type is no longer named 'Timer FlipClock'?

I greatly appreciate any assistance you can provide!

Here's the excerpt from the code that's relevant:

 

Qualtrics.SurveyEngine.addOnReady(function()

{

var timerID = document.getElementsByClassName('Timer FlipClock'))0].id;

       …]

       Event.observe(document, 'keydown', function (e) {

              var time = $(timerID).getAttribute('time');

              p…]

       });

});

The class is still Timer FlipClock.


Leave a Reply