Retrieve the reaction time in Qualtrics

雨燕双飞 提交于 2020-01-06 06:12:44

问题


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:


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

});


来源:https://stackoverflow.com/questions/47029443/retrieve-the-reaction-time-in-qualtrics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!