expfactory / expfactory-experiments

version 1.0 javascript experiments that can be deployed to run in an experiment infrastructure
http://expfactory.github.io/v1/table.html
MIT License
37 stars 64 forks source link

Custom Battery does not load in psiTurk #96

Closed jkredz closed 8 years ago

jkredz commented 8 years ago

After creating a custom battery (adaptive n back only for now) with expfactory, the exp.html does not load in PsiTurk.

One problem I ran into was that Exp.html js source path references to jspysch/custom_plugins, however the folder is renamed as jspysch/poldrack_plugins when the custom battery is generated. I changed the source path in the exp.html to jspysch/poldrack_plugins, but still ran into the following errors when loading exp.html.

  1. - No plugin loaded for trials of type "text" (anonymous function) @ jspsych.js:273
  2. - No plugin loaded for trials of type "consent" (anonymous function) @ jspsych.js:273
  3. - Uncaught TypeError: Cannot read property 'trial' of undefined jspsych.js:581
vsoch commented 8 years ago

This should be easy to fix - we just forgot to update that template to reflect recent changes in the battery and experiments (the files are all loaded dynamically, so all that hard coding should be removed). I'll be able to do a fix to this soon.

vsoch commented 8 years ago

Ok, I've made changes to the battery, and just pushed. The "adaptive_n_back" is working for me now with the change. Could you re-generate the custom battery and give another try, and report any outstanding errors here?

I couldn't test your attached folder (in the email you sent) because gmail removed it, but if there are outstanding errors we can use file.pizza to transfer! :) Let me know how it goes!

jkredz commented 8 years ago

I am still running into the same errors that:

Uncaught TypeError: Cannot read property 'trial' of undefined No plugin loaded for trials of type "text"

I've updated my expfactory by doing pip uninstall and install expfactory. And it looks like its updated since the generated exp.html files reflect the changes you made in the last commit.

Also there seems to be a conflict between psiturk and expfactory's GitPython versions. The current version of psiturk requires GitPython 1.7, but the expfactory throws the following error with GitPython 1.7: AttributeError: type object 'Repo' has no attribute 'clone_from'.

vsoch commented 8 years ago

It sounds like you have other versions of expfactory installed. Try doing:

  pip uninstall expfactory

as many times as it takes until it tells you there are no more remaining (usually you see a red message in the console). Then install it again:

  pip install expfactory

psiturk does not use gitpython (to the best of my understanding) so likely the conflict is just having an older version of our software.

Also make sure that you have Control + C to shut down all old running instances of the expfactory local server (the interface to generate the web interface). If you run two at once, the window that opens up wlll actually be using the old version of the repos and software.

vsoch commented 8 years ago

Ah yes I see that psiturk specifies gitpython version 1.7. I haven't run into this issue before, and my typical workflow is to install expfactory after psiturk, so you could try updating gitpython

  pip install gitpython --upgrade

if you get the error again. I'm hoping the above will help resolve some of the issues, which again sound like they are related to older versions of expfactory.

jkredz commented 8 years ago

I ran pip install expfactory several times again, (expfactory 1.8.8), but am still getting the:

Uncaught TypeError: Cannot read property 'trial' of undefined No plugin loaded for trials of type "text"

screen shot 2016-02-04 at 10 07 08 am

Do you still think that I have an old version of expfactory? Would it help if i sent you the expfactory-battery folder that was generated?

vsoch commented 8 years ago

You need to run pip UNINSTALL, not install. Yes please send the folder.

vsoch commented 8 years ago

Oh hold the phone! This is a bug with the experiment- the js psych text plugin is not specified in the configure.json.

vsoch commented 8 years ago

Could you please send the folder?

vsoch commented 8 years ago

A quick note - I'm not happy with the way that scripts are loaded - it looks like they are added to the html and this should be done programatically. I can't fix this right this moment, but will have a resolution within a day or so.

vsoch commented 8 years ago

ok, please give another try!

jkredz commented 8 years ago

So I generated the battery with the adaptive-n-back experiment and it worked! Still running into the git command issue where Repo.clone_from( ) command does not work with gitpython(0.1.7), so I'm switching from gitpython(0.3.2) when using expfactory and gitpython(0.1.7) for psiturk.

I also tried building other batteries with different tasks and seemed to be missing files as well. Possibly missing js psych plugins in configure.json...

I'll try to rebuild the batteries next week and let you know if the experiment files are missing plugins in configure.json or something else. But so far it seems like the battery code is compiling experiments properly.

Thanks for your help!

vsoch commented 8 years ago

Sure thing! For the gitpython issue (and generally version issues), I would recommend using different virtual environments to generate the battery folder versus running psiturk.

I can't quite put my finger on the issue with the missing plugin, but I know it has to do with loading, and specifically, loading of the poldracklab-plugins. My lab made some "custom" versions, and the original seem to work, but the custom not.

I'm going to close this specific issue, and definitely please open new issues for any errors for missing plugins and experiments. I greatly appreciate the debugging help, as we are focusing on an mturk deployment (not using psiturk) and haven't gotten a chance to test the psiturk deployment properly yet.