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 27, 2014
1 parent 1fe60bf commit 76457f1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/jspsych-categorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// timing params
trials[i].timing_stim = params.timing_stim || -1; // default is to show image until response
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;
// optional params
trials[i].show_stim_with_feedback = (typeof params.show_stim_with_feedback === 'undefined') ? true : params.show_stim_with_feedback;
trials[i].is_html = (typeof params.is_html === 'undefined') ? false : params.is_html;
Expand Down Expand Up @@ -194,9 +194,13 @@
break;
case 3:
display_element.html("");
setTimeout(function() {
if(trial.timing_post_trial > 0){
setTimeout(function() {
block.next();
}, trial.timing_post_trial);
} else {
block.next();
}, trial.timing_post_trial);
}
break;
}
};
Expand Down

0 comments on commit 76457f1

Please sign in to comment.