Skip to content
Discussion options

You must be logged in to vote

Hi Suzanne,

If I'm understanding correctly you've got a timeline variable that specifies word or pic. You can access timeline variables in the conditional_function of a timeline. So something like this should work:

var word_timeline = {
	timeline: [word_trial],
	conditional_function: function(){
		if(jsPsych.timelineVariable('word_or_pic', true) == 'word') {
			return true;
		} else {
			return false;
		}
	}
}

var pic_timeline = {
	timeline: [pic_trial],
	conditional_function: function(){
		if(jsPsych.timelineVariable('word_or_pic', true) == 'pic') {
			return true;
		} else {
			return false;
		}
	}
}

var word_or_pic = {
	timeline: [word_timeline, pic_timeline],
	timeline_variables: [
		{

Replies: 1 comment 1 reply

Comment options

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

Answer selected by SRJongman
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