Skip to content
Discussion options

You must be logged in to vote

A custom sampling function using the shuffleNoRepeats method could work.

timeline.push({
    // timeline
    // timeline_variables
    sample: {
        type: 'custom',
        fn: function(){
		// define groups
		var groups = [[0,1,2,3],[4,5,6,7],[8,9,10,11],[12,13,14,15],[16,17,18,19],[20,21,22,23],[24,25,26,27],[28,29,30,31]];

		// create object for each timeline variable specifying group membership and item
		var all_items = [];
		for(var i=0; i<groups.length; i++){
			for(var j=0; j<groups[i].length; j++){
				all_items.push({group: i, trial_num: groups[i][j]});
			}
		}
		
		// randomize group order, with no repeat constraint
		// use custom equality function to specify what a "rep…

Replies: 3 comments 4 replies

Comment options

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

Comment options

You must be logged in to vote
3 replies
@becky-gilbert
Comment options

@ghost
Comment options

@jodeleeuw
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants