ChadCumba / Online-Behavioral-Experiment

3 stars 0 forks source link

Javascript Errors #2

Open askochar opened 13 years ago

askochar commented 13 years ago

Hi,

I work with Thomas, the poster of the previous database error. We managed to get that working, I think it was a conflict between the structures of the database created by the Django script and the sql file you provided. Thanks for your quick response! After a number of minor setbacks we seem to finally have gotten all the python code functional. We can now access /game/instructions which leads us through a few pages to one that says press the spacebar to continue, at which point everything stops. The console has been giving us a number of javascript errors relating to the trial variable and the run_trial function and were not really sure how to make it run. Are there any changes we need to make to the javascript files?

Here is an example of one of the errors: action.js:47Uncaught TypeError: Cannot call method 'runTrial' of undefined

In a more general sense we were wondering to what level the code you have provided is complete and functional. Has it been used to run an experiment/gather data?

Thank you very much for your help!

Angad

ChadCumba commented 13 years ago

It has been used to gather, I want to say.... ~300 behavioral study responses in about a week and a half. The trick to it is that we used a previously existing set of data that was serialized and used to seed the program from the database.

the system doesn't generate trials on its own, it attempts to load them and then create action objects. Action objects should respond to the runTrial method on them. So what you're experiencing is without any trials to load from the database, the wrapper can't make any trial objects with 'runTrial' defined on them.

If you've got some experience with javascript, I'd recommend digging in to the code in documentEventHandlers.js, loadData.js, and initialize.js. They handle most of the major object construction and provided that loadData.js can find serialized JSON to build objects from.