Retrieve the reaction time in Qualtrics

2019-08-22 18:09发布

I wrote the following script to measure the respondent's reaction time for each question. My question is how can I retrieve the reaction time?

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();
	}

});

1条回答
Deceive 欺骗
2楼-- · 2019-08-22 18:24

You can save reaction time to an embedded data variable. Define reactiontime as an embedded data variable in the survey flow prior to the question block. Then:

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();           
        }
    }

});
查看更多
登录 后发表回答