From b33ab88b22dd30a28933fa515d51d00cee2cf833 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Tue, 17 Jul 2012 17:51:17 -0400 Subject: [PATCH] Added core.progress // core.progress returns an object with the following properties // total_blocks: the number of total blocks in the experiment // total_trials: the number of total trials in the experiment // current_trial_global: the current trial number in global terms // i.e. if each block has 20 trials and the experiment is // currently in block 2 trial 10, this has a value of 30. // current_trial_local: the current trial number within the block. // current_block: the current block number. Useful for showing user progress through the experiment. Planning to add an option to show a progress bar in the future. --- jspsych.js | 55 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/jspsych.js b/jspsych.js index 34dbaa40..838451b7 100755 --- a/jspsych.js +++ b/jspsych.js @@ -37,25 +37,11 @@ DOM_target = $this; run(); - /* - * load scripts dynamically?? - * - * - // load plugin script files - var scripts_loaded = 0; - // load all of the plugins that are defined in the opts["plugins"] - for(var j = 0; j < opts["plugins"].length; j++) - { - $.getScript(opts["plugins"][j]["src"], function(){ - scripts_loaded++; - if(scripts_loaded==opts["plugins"].length) { - intialized = true; - 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