You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the useful tool! I have a question about data writing. I'd like to add a label of which block it is for all the trials, so I add this whichblock property to the block timeline like this. blockArray is an object with length of 4, each corresponds to all the trials of a block.
var Bs = []
for (let i = 0; i < blockArray.length; i++) {
Bs.push({
timeline: aTrial,
timeline_variables: blockArray[i],
randomize_order: false,
**on_finish: function(data){
data.whichblock = i
},**
})
}
Generally it works, most trials will have a column called whichblock with the index of the current block (0, 1, 2, 3) in it.
However, in certain trials, the value of whichblock is missing. If a trial object also writes data, i.e., it has
then the whichblock value of this trial will be empty. Even the property I tried to write in this trial object has nothing to do with whichblock. I tried to put this function(data) in different trials like fixation, image presentation, etc, the whichblock will disappear for these trials.
I wonder is there any conflict between data writing in individual trials and the global timeline? How can I write something in each trial of the whole block? (Now I circumvent this problem by fetching data from other trials which have whichblock value and adding it to the trial in which I need to write data data.whichblock = jsPsych.data.get().last(2).values()[0].whichblock; , but sometimes this is not applicable)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
Thanks for the useful tool! I have a question about data writing. I'd like to add a label of which block it is for all the trials, so I add this
whichblock
property to the block timeline like this.blockArray
is an object with length of 4, each corresponds to all the trials of a block.Generally it works, most trials will have a column called
whichblock
with the index of the current block (0, 1, 2, 3) in it.However, in certain trials, the value of whichblock is missing. If a trial object also writes data, i.e., it has
then the
whichblock
value of this trial will be empty. Even the property I tried to write in this trial object has nothing to do withwhichblock
. I tried to put thisfunction(data)
in different trials like fixation, image presentation, etc, thewhichblock
will disappear for these trials.I wonder is there any conflict between data writing in individual trials and the global timeline? How can I write something in each trial of the whole block? (Now I circumvent this problem by fetching data from other trials which have
whichblock
value and adding it to the trial in which I need to write datadata.whichblock = jsPsych.data.get().last(2).values()[0].whichblock;
, but sometimes this is not applicable)Thanks so much for any help!
Qiu
Beta Was this translation helpful? Give feedback.
All reactions