static/js/waiting_task_o.js
// Trial plan - shuffle keeping types even throughout
Trial plan - shuffle keeping types even throughout
Trial plan - shuffle keeping types even throughout
function pseudoShuffle(items, types, bin_size = 6) {
  var cond0 = items.filter(item => item["type"] == types[0]),
    cond1 = items.filter(item => item["type"] == types[1]);
  cond0 = jsPsych.randomization.shuffle(cond0);
  cond1 = jsPsych.randomization.shuffle(cond1);
  var shuf_items = [];
  for (i = 0; i < Math.ceil(cond0.length / (bin_size / 2)); i++) {
    var this_add = cond0.slice(i * (bin_size / 2), i * (bin_size / 2) + (bin_size / 2)).concat(
      cond1.slice(i * (bin_size / 2), i * (bin_size / 2) + (bin_size / 2))
    );
    this_add = jsPsych.randomization.shuffle(this_add);
    shuf_items = shuf_items.concat(this_add);
  }
  return shuf_items
}
function pseudoShuffle ( items , types , bin_size = 6 ) { var cond0 = items . filter ( item => item [ "type" ] == types [ 0 ] ) , cond1 = items . filter ( item => item [ "type" ] == types [ 1 ] ) ; cond0 = jsPsych . randomization . shuffle ( cond0 ) ; cond1 = jsPsych . randomization . shuffle ( cond1 ) ; var shuf_items = [ ] ; for ( i = 0 ; i < Math . ceil ( cond0 . length / ( bin_size / 2 ) ) ; i ++ ) { var this_add = cond0 . slice ( i * ( bin_size / 2 ) , i * ( bin_size / 2 ) + ( bin_size / 2 ) ) . concat ( cond1 . slice ( i * ( bin_size / 2 ) , i * ( bin_size / 2 ) + ( bin_size / 2 ) ) ) ; this_add = jsPsych . randomization . shuffle ( this_add ) ; shuf_items = shuf_items . concat ( this_add ) ; } return shuf_items }
Trial plan - shuffle keeping types even throughout
Trial plan - shuffle keeping types even throughout
// Separate by type of question // Random order each type