Last active
August 29, 2015 13:56
-
-
Save etosch/9241545 to your computer and use it in GitHub Desktop.
To find the time spent per question, we need to track the time between firings of showQuestion and registerAndShowNextQuestion.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oldShowQuestion = sm.showQuestion; | |
var oldRegisterAndShowNextQuestion = sm.registerAndShowNextQuestion; | |
var addTimingInfo = function(q, tag) { | |
var start = document.createElement('input'); | |
start.type='text'; | |
start.id=tag+'_'+q.id; | |
start.name=tag+'_'+q.id; | |
start.form='mturk_form'; | |
start.hidden=true; | |
start.defaultValue=new Date().getTime(); | |
console.log(start.value); | |
document.getElementById('mturk_form').appendChild(start); | |
}; | |
sm.showQuestion = function (q) { | |
addTimingInfo(q,'start'); | |
oldShowQuestion(q); | |
}; | |
sm.registerAndShowNextQuestion = function (pid,q,o){ | |
addTimingInfo(q,'end'); | |
oldRegisterAndShowNextQuestion(pid,q,o); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment