Changing values for slider ticks and labels in loop

Yes, you can create a counter and change the iteration when the counter reaches 5 (or 4 for zero-indexed number):

// Begin Experiment
counter = 0;

// Begin routine
if (counter === 4) {
  slider.labels = ["True", "False"]; 
  counter = 0;  // reset slider counter
}  else {
  slider.labels = ["agree", "disagree"]; 
}

counter = counter + 1;
slider._needVertexUpdate = true;
slider._buildSlider();

1 Like