From ffc80a372eaeb8cd29b145b9caa8d5ab9fd7633f Mon Sep 17 00:00:00 2001 From: Becky Gilbert Date: Wed, 2 Dec 2020 12:11:03 -0800 Subject: [PATCH] add console warning when auto preload parameter not found --- jspsych.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jspsych.js b/jspsych.js index 3605af65..6d9deb62 100755 --- a/jspsych.js +++ b/jspsych.js @@ -2578,15 +2578,15 @@ jsPsych.pluginAPI = (function() { var trials = timeline.trialsOfType(type); for (var j = 0; j < trials.length; j++) { - if (trials[j][param] && typeof trials[j][param] !== 'function') { - + if (typeof trials[j][param] == 'undefined') { + console.warn("jsPsych failed to auto preload one or more files: no parameter called "+param+" in plugin "+type); + } else if (typeof trials[j][param] !== 'function') { if ( !func || func(trials[j]) ){ if (media === 'image') { images = images.concat(jsPsych.utils.flatten([trials[j][param]])); } else if (media === 'audio') { audio = audio.concat(jsPsych.utils.flatten([trials[j][param]])); - } - else if (media === 'video') { + } else if (media === 'video') { video = video.concat(jsPsych.utils.flatten([trials[j][param]])); } }