Replies: 1 comment 3 replies
-
Hi @Altr37, what you can do is put the question trial inside of a conditional node, and in the conditional function, check the timeline variables to see whether or not a question should be shown on the current trial. This means that you also need to put some kind of indication in your timeline variables objects about whether or not each trial should have a question. One way to do this is to set the var sentence = {
// parameters...
}
var question = {
// parameters...
}
var question_conditional = {
timeline: [question],
conditional_function: function() {
// check whether or not the question trial should be presented
if (jsPsych.timelineVariable('question') == null) {
return false;
} else {
return true;
}
}
}
var trial_procedure = {
timeline: [sentence, question_conditional],
timeline_variables: your_timeline_variables_array
} And your timeline variables array would look like this: {
sentence: "The bla bla.",
question: "Was it the bla bla?", // present this question after the sentence
// more variables
},
{
sentence: "Another trial.",
question: null, // no question after this sentence
// more variables
}, Does that work for you? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I currently have a code working with sentences, followed by comprehension questions. (Copied below)
I want to change it, such that only some of the sentences will be followed by a question, while others will not, and will proceed to the next trial. I want the order to be intermixed between these two types of trials.
How can I do that?
code:
The materials currently look like that:
Instead, I want some trials to have a 'question' part, and others not.
I will appreciate any help!
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions