I didn't put everything from experiment.require.php into the class. The functions for writing the responses to file, and for going to the done page did not seem like they fit within the class. For the first one, I moved the relevant parts for drawing the information out of the trial to the class, and had the function add extradata and write to file outside of the class. For the goToDone function --- it just didn't make sense to have that in the class as it isn't part of any of the Experiment stuff. Instead I put a function into the class isDone() which returns a boolean telling you if there are more trials or not.
The demo trials seem to run fine as far as I can see, but I'd rather have another set of eyes on it before we merge. Thanks!
Addressing #120
You guys wanna give this a shot? I tested on Demo, but not with anything else. Some notes: These variables:
are now these variables
I didn't put everything from experiment.require.php into the class. The functions for writing the responses to file, and for going to the done page did not seem like they fit within the class. For the first one, I moved the relevant parts for drawing the information out of the trial to the class, and had the function add extradata and write to file outside of the class. For the goToDone function --- it just didn't make sense to have that in the class as it isn't part of any of the Experiment stuff. Instead I put a function into the class
isDone()
which returns a boolean telling you if there are more trials or not.The demo trials seem to run fine as far as I can see, but I'd rather have another set of eyes on it before we merge. Thanks!