Replies: 1 comment 2 replies
-
Having dynamic experimental designs like these usually means forgoing timeline variables and embracing loops and functions. Something like this. let second_timeline = []; // Array.concat this with the full timeline.
for (let i = 0; i < new_stimuli.length; i++) {
second_timeline.push({
type: "html-keyboard-response",
stimulus: function() {
return new_stimuli[i];
}
})
} Then the stimulus will be evaluated at the time of the trial, when new_stimuli will have been assigned. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am presenting study word pairs, then asking for a JOL, then a choice of whether to restudy the word pair LATER in the program, pretest the word pair LATER in the program, or neither.
This is what my stimulus looks like:
So the choice is actually made on the stimulus for "Enter A, B..." instead of the stimulus that I actually want to redisplay later in the program. (The above word pairs).
This is the code:
OK - so 1) I would expect with this code to see "stimulus: Enter A to study again", but all I'm getting in the console is "stimulus: " (blank).
2) how do I get to the stimulus from the study procedure, which is actually what I want to display again? This is not a looping function, because I want to show ALL of the study word pairs BEFORE redisplaying the chosen word pairs to restudy or pretest. I need to finish all word pairs before going back and finding the flagged word pairs to display again.
So currently, the program runs and displays all word pairs, then ends, because the new_stimuli array is blank.
Thanks,
Rose
Beta Was this translation helpful? Give feedback.
All reactions