Skip to content

Accessing variables within conditional function #859

Answered by vijaymarupudi
wsr017 asked this question in Q&A
Discussion options

You must be logged in to vote

When you're constructing the timeline, all the code is run when you are defining the timeline, not when the participant is running the experiment. If you'd like to display the 'current' information will the participant is running the experiment, you'll want to make the parameter a function https://www.jspsych.org/overview/trial/#dynamic-parameters

If you'd like to learn more, these are called closures in Javascript!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wsr017
Comment options

Answer selected by wsr017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants