First pass at allowing functions as variables

This commit is contained in:
Josh de Leeuw 2014-03-03 11:47:16 -05:00
parent c8cb4204d1
commit 30df65e95b

View File

@ -55,13 +55,19 @@
var sim_trial_complete = false;
plugin.trial = function(display_element, block, trial, part) {
// if any trial variables are functions
// this evaluates the function and replaces
// it with the output of the function
trial = jsPsych.normalizeTrialVariables(trial);
switch (part) {
case 1:
sim_trial_complete = false;
// show the images
if (!trial.is_html) {
display_element.append($('<img>', {
"src": trial.a_path,
"src": normed_trial.a_path,
"id": 'jspsych_sim_stim'
}));
}