gikeymarcia / Collector

A program for running psychology experiments on the web
32 stars 15 forks source link

Experiment Class #129

Closed adamblake closed 8 years ago

adamblake commented 8 years ago

Addressing #120

You guys wanna give this a shot? I tested on Demo, but not with anything else. Some notes: These variables:

$_SESSION['Position']
$_SESSION['PostNumber'] 
$_SESSION['Procedure']
$_SESSION['Stimuli']
$_SESSION['Responses']
$_SESSION['Condition']

are now these variables

$_EXPT->position
$_EXPT->postNumber
$_EXPT->procedure
$_EXPT->stimuli
$_EXPT->responses
$_EXPT->condition

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!