Retrieving all timeline variables for a given trial
See original GitHub issueI currently have a design that uses a lot of timeline variables, and one annoying aspect is that I sometimes forget adding one of the timeline variables to the data section (I’m actually not sure why they are not automatically put into the data, as otherwise that information is just lost).
So some data section looks like this:
data: {
segment: "word-classification",
audiofile: jsPsych.timelineVariable('audiofile'),
word: jsPsych.timelineVariable('word'),
trial: jsPsych.timelineVariable('trial'),
repetition: jsPsych.timelineVariable('repetition'),
group: jsPsych.timelineVariable('group'),
choices: jsPsych.timelineVariable('choices'),
}
This is because I couldn’t find a way to just retrieve all timeline variables, in which case I could just do something like:
data: jsPsych.allTimelineVariables()
Is it only possible to ask for one specific variable name and get back whether it exists or not, or is there not an actual list accessible somewhere?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Creating an Experiment: The Timeline - jsPsych
One is that it allows you to define common parameters across trials once and have them apply to all the trials on the...
Read more >2. Randomisation, repetition and variables - jaysire
Avoid code duplication using timeline variables; Randomise the order of trials within a block; Repetition of blocks of trials.
Read more >Making prompt in between a trial sequence, loading different ...
The most brute force way I can imagine is to just initialize that amount of variables and push all of them to the...
Read more >3.1 Timeline Variables | Online Behavioral Experiments with ...
The timeline_variables parameter is an array that contains one or more objects, where each object contains the information that is specific to a...
Read more >The structure of a jsPsych experiment
var trials_with_variables = { timeline: [trial], timeline_variables: variables };. Then change jsPsych.run to run this: jsPsych.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for fixing this!
I implemented a first pass at this in the
features-all-timeline-vars
branch. I added a single test case to the end oftimeline-variables.test.js
. It needs a lot of expansion to make sure this implementation works.