Measuring accurate timing for matrix table question | XM Community
Skip to main content

Hello,

 

I’m trying to more accurately measure how long it takes for people to complete a 3-item matrix question using both the date and performance functions in java (compared to just using the timing question). I have set it up so the page is submitted when all three items are answered. However, when I do a test run, the timing data for the last click is typically 100 millisecond faster than my recording using date or performance. So is timing beginning later (or ending earlier) than date and performance? And should I make any adjustments to the code?

 

 

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/
    
const t0p = performance.now();
const t0d = Date.now();
    
jQuery("#"+this.questionId+" td").click(function(){
const t1p = performance.now();
const t1d = Date.now();
setTimeout(function(){

if(jQuery(".ChoiceRow").length==jQuery(".q-checked").length)

{
const ReactionTimep = t1p - t0p;
 const ReactionTimed = t1d - t0d;
  Qualtrics.SurveyEngine.setEmbeddedData("StartTime1p", t0p);
 Qualtrics.SurveyEngine.setEmbeddedData("EndTime1p", t1p);
 Qualtrics.SurveyEngine.setEmbeddedData("ReactionTime1p", ReactionTimep);
   Qualtrics.SurveyEngine.setEmbeddedData("StartTime1d", t0d);
 Qualtrics.SurveyEngine.setEmbeddedData("EndTime1d", t1d);
 Qualtrics.SurveyEngine.setEmbeddedData("ReactionTime1d", ReactionTimed);
jQuery("#NextButton").click()
}

}, 5);
        
});
});
 

Considering this level of accuracy appears to be important to your study, please see these two video to understand why those differences are difficult to avoid.

 

 

Because you are using jquery, you can only monitor renders, Qualtrics internally on the other hand, would be using the task loop.


Leave a Reply