Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Latin Square design using JavaScript

Hello,

I am trying to figure out how to implement a latin-square randomized design using JavaScript so that I can run the experiment online. I have created a quick template, with 4 different blocks of trials, to figure out how it would work. I referenced a post by sebastiaan (https://forum.cogsci.nl/discussion/2401/selecting-randomization-lists-in-latin-squared-designs). Details are shown in the images below:

When I try to run this as shown, I get an error message "ReferenceError: items is not defined". Any ideas or suggestions on how I can make this work?

Thank you!

--Daniel

Comments

  • ** Sorry for the duplicate post **

    I solved this problem by using the "slice" command in the block_loop, after creating two variables at the top of the experiment, as so:

    vars.slice_top = (vars.subject_nr * 4);

    vars.slice_bot = (vars.slice_top + 4);

    In the block_loop script, I put:

    slice "[slice_top]" "[slice_bot]"

Sign In or Register to comment.