// jspsych.js // // Josh de Leeuw and Drew Hendrickson // Percepts and Concepts Lab, Indiana University // (function( $ ) { jsPsych = (function() { // // public object // var core = {}; // // private class variables // // options var opts = {}; // exp structure var exp_blocks = []; // flow control var curr_block = 0; // everything loaded? var initialized = false; // target DOM element var DOM_target; // trial start callback method var on_trial_start; // trial finish callback method var on_trial_finish; // // public methods // core.init = function($this, options){ var defaults = { 'on_trial_start': function(){ return undefined; } 'on_trial_finish': function() { return undefined; } } // import options opts = $.extend({}, defaults, options); // set target DOM_target = $this; run(); } // core.data returns all of the data objects for each block as an array // where core.data[0] = data object from block 0, etc... core.data = function(){ var all_data = []; for(var i=0;i