stroop-inheritance
stroop-inheritance.js
xxxxxxxxxx
// ### Data
// Before we dive into the actual practice of inheritance, it is important to understand the function and use of the trial's `data` property.
// The `data` property holds an object that keeps information that has to do with this trial.
// Remember that all the properties and values of `data` are arbitrary, and you can use them in any way that is convenient to you.
// It is useful for several things.
// First, every time you [log](./API.md#interactions-actions) an event to the server, anything that is in you data object gets logged along with it.
// This means that if you want to mark the type of a trial it is convenient to do it from here, and then you will have access to it from you servers database.
// In this case we will set our trials *group* using the data object:
// ```javascript
// {
// data:{group:'congruent'}
// }
// ```
// Furthermore, the data object may be used by player interactions.
// The condition `inputEqualsTrial` compares the input handle to a specified property of the trial's data object.
// This means that we can create interactions that behave a bit differently as a function of trial type as defined in the data object.
// The following interaction fires when the input handle is equal to the *group* property of the data object:
// ```javascript
// {
// conditions: [
// {type:'inputEqualsTrial',property:'group'}
// ],
// actions: [
// /* Some cool stuff of you own design */
// ]
// }
// ```
// Finally, interactions may change the data object in real time, while the trial is running.
// `setTrialAttr` sets data into the data object. The following interaction sets the *score* property of the data object to *1*
// (go [here](./API.md#interactions-actions) to learn more about the `setTrialAttr` action).
// ```javascript
// {
// conditions: [
// /* The conditions of your choice */
// ],
// actions: [
Last modified March 11, 2021: setup hugo (11980dc)