var endExperiment = function() {
prompt_resubmit = function() {
replaceBody(error_message);
$("#resubmit").click(resubmit);
};
resubmit = function() {
replaceBody("<h1>Trying to resubmit...</h1>");
reprompt = setTimeout(prompt_resubmit, 10000);
psiTurk.saveData({
success: function() {
clearInterval(reprompt);
},
error: prompt_resubmit
});
};
// Load the debriefing page
psiTurk.showPage('debriefing.html');
//code for bonus??
$("#next").click(function () {
record_responses();
psiTurk.saveData({
success: function(){
psiTurk.computeBonus('compute_bonus', function() {
psiTurk.completeHIT(); // when finished saving compute bonus, the quit
});
},
error: prompt_resubmit});
});