Skip to content

Commit

Permalink
timing_post_trial fix (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jodeleeuw committed Jan 23, 2014
1 parent b6db7c0 commit 1fe60bf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/jspsych-categorize-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
trials[i].allow_response_before_complete = params.allow_response_before_complete || false;
trials[i].frame_time = params.frame_time || 500;
trials[i].timing_feedback_duration = params.timing_feedback_duration || 2000;
trials[i].timing_post_trial = params.timing_post_trial || 1000;
trials[i].timing_post_trial = (typeof params.timing_post_trial === 'undefined') ? 1000 : params.timing_post_trial;
trials[i].prompt = (typeof params.prompt === 'undefined') ? '' : params.prompt;
trials[i].data = (typeof params.data === 'undefined') ? {} : params.data[i];
}
Expand Down Expand Up @@ -172,9 +172,13 @@
function endTrial() {
clearInterval(animate_interval); // stop animation!
display_element.html(''); // clear everything
setTimeout(function() {
if(trial.timing_post_trial > 0){
setTimeout(function() {
block.next();
}, trial.timing_post_trial);
} else {
block.next();
}, trial.timing_post_trial);
}
}
};

Expand Down

0 comments on commit 1fe60bf

Please sign in to comment.