Skip to content

returning a .js file to timeline_variables through a function #2256

Answered by jodeleeuw
abhilasha-kumar asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @abhilasha-kumar !

Currently timeline_variables doesn't support using a function. It's something we'd like to add in the future.

Does get_stimuli_list() change its value throughout the experiment? If the return value of this function is the same throughout the experiment, then I think you can omit the wrapper function like this:

 for( var i = 0; i < myArray.length; i++){
      	console.log('value of i='+i);
      	console.log('value of number='+myArray[i]);
      	var board_proc = {
      		timeline: [board],
      		timeline_variables:  get_stimuli_list(myArray[i]),
      		randomize_order: true
    	}
}

The only difference is that now get_stimuli_list will run at the start of the exp…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@abhilasha-kumar
Comment options

@abhilasha-kumar
Comment options

@jodeleeuw
Comment options

Answer selected by abhilasha-kumar
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