Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsPsych is not defined in experiments #32

Open
jkredz opened this issue Feb 8, 2016 · 2 comments
Open

jsPsych is not defined in experiments #32

jkredz opened this issue Feb 8, 2016 · 2 comments

Comments

@jkredz
Copy link

jkredz commented Feb 8, 2016

When trying to run a battery test with (plus_minus, stop_signal, and stroop), the experiment doesnt load because of the following errors

  1. Uncaught ReferenceError jsPsych is not defined experiment.js:35
  2. Uncaught ReferenceError jsPsych is not defined experiment.js:167
  3. Uncaught ReferenceError jsPsych is not defined experiment.js:147
  4. Uncaught ReferenceError stroop_experiment is not defined load_experiments.js:48

Error 1,2,3 are referencing to the line calling jsPsych.randomization
var numbers = jsPsych.randomization.repeat(numbers, 1, false)

Error 4 references to
case "stroop":
experiments = experiments.concat(stroop_experiment)
break;

@vsoch
Copy link
Member

vsoch commented Feb 8, 2016

I think I can anticipate this bug - the original creator of the battery used JsPsych functions to randomize experiment selection, but the change to make it modular means that JsPsych isn't actually loaded until later. I'm doing some thesis stuffs this morning, but will be able to look into this soon.

@vsoch
Copy link
Member

vsoch commented Feb 8, 2016

ok, I think I've fixed this bug. I used numpy.unique() to reduce the list of js/css files into only those unique, but that would sort the list (and remove the ordering that is specified in config.jsons, which is important). I found a way to find unique without changing order, and also added the missing jspsych-text plugin to config.jsons, so those three tasks work for me now, so you might want to uninstall as many times as needed:

   pip uninstall expfactory

until you see it is not installed, then install again

  pip install expfactory

and it should be good to go! Keep in mind the experiments are still very beta - for example the numbers task first screen should scroll, but clearly doesn't. If the tasks are important for your lab for now you can help us develop and submit a PR to fix (this would be greatly appreciated!) or post issues about them, and we can work on when we get the chance. Re: the issue of specifying timing of the battery, I chat with @IanEisenberg and we will be able to work on this after the pilot is finished. For now, if you want to change the time, open up the load_experiment.js in static/js and change this line:

https://github.com/expfactory/expfactory-battery/blob/master/static/js/load_experiments.js#L16

That will select from your tasks up to that time specified, in minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants