I am working with @DominiqueMakowski to try to set up an experiment in which we need to filter an array of stimuli based on the demographic answers given by the participant at the beginning of the experiment.
However, setting timeline variable to be a function does not seem to work:
timeline.push({
timeline_variables: function() {return new_stimuli_list}, // new_stimuli_list being created on the on_finish of a previous phase
timeline: [
fixactioncross,
showimage,
],
}
)
We tried as an alternative to put the whole timeline object into a function with the hope that that function would only be called after the demographic phase:
function expe_trials() {
return {
timeline_variables: function() {return new_stimuli_list}, // new_stimuli_list being created on the on_finish of a previous phase
timeline: [
fixactioncross,
showimage,
],
}
}
timeline.push(expe_trials())
But that didn't do the trick either, as the function is called immediately on script initialization.
What is the best way to dynamically filter the timeline__variable? Thanks
I am working with @DominiqueMakowski to try to set up an experiment in which we need to filter an array of stimuli based on the demographic answers given by the participant at the beginning of the experiment.
However, setting timeline variable to be a function does not seem to work:
We tried as an alternative to put the whole timeline object into a function with the hope that that function would only be called after the demographic phase:
But that didn't do the trick either, as the function is called immediately on script initialization.
What is the best way to dynamically filter the timeline__variable? Thanks