在 Qualtrics 中检索反应时间

Retrieve the reaction time in Qualtrics

我编写了以下脚本来衡量受访者对每个问题的反应时间。我的问题是如何检索反应时间?

Qualtrics.SurveyEngine.addOnload(function(){

 var starttime = new Date().getTime();

 var that = this;

 this.hideNextButton();

 this.questionclick = function(event,element){

  if (element.type == 'radio') {
   var endtime = new Date().getTime();
   var reactiontime = endtime - starttime;
   document.getElementById("QR~"+this.questionID).value = document.getElementById("QR~"+this.questionID).value + "X" + reactiontime + ",";
  }
 that.clickNextButton();
 }

});

您可以将反应时间保存到嵌入的数据变量中。在问题块之前将反应时间定义为调查流程中的嵌入式数据变量。那么:

Qualtrics.SurveyEngine.addOnReady(function(){
    var starttime = new Date().getTime();
    $('NextButton').hide();

    this.questionclick = function(event,element){
        if (element.type == 'radio') {
            var endtime = new Date().getTime();
            var reactiontime = endtime - starttime;
            Qualtrics.SurveyEngine.setEmbeddedData('reactiontime', reactiontime);
            $('NextButton').click();           
        }
    }

});