gorkang / jsPsychMaker

https://gorkang.github.io/jsPsychR-manual/index.html
MIT License
2 stars 0 forks source link

Nuevo protocolo falla si all_conditions no esta definida #31

Open gorkang opened 3 years ago

gorkang commented 3 years ago

Ocurre en protocolo 10 y 12 con la v0.2.0. NO ocurre en test/10_OLD (tiene alguna version intermedia de la maquinaria)

Primera solucion

Dados los problemas con la otra solucion, me inclino mas por una version de la primera (en esencia, hacer un check en helpers. Si existe all_conditions, comprueba si esta bien definido, si no existe, definelo: all_conditions = {"protocol": {"type": ["survey"]}}; )

Segunda solucion

HAY UN PROBLEMA CON ESTA SOLUCION. NO SE ALMACENA NADA EN USER_TASK, POR LO QUE NO SE PUEDE RECUPERAR EL ESTADO DE LOS PARTICIPANTES.

Lineas ~ 312 en mysql_controller.js

// REVIEW: With all_conditions = {}; it will never enter the for loop, and condition_selection() was not giving any response, freezing the protocol
if (unique_between_tasks.length === 0) {

  if (debug_mode === true) console.error('condition_selection() | unique_between_tasks EMPTY | No between_tasks defined');
  resolve(true);

} else {

  // AQUI EL FOR LOOP
  // For each of the between tasks (usually just one)
  for (var i = 0; i < unique_between_tasks.length; i++) {

Esto podria generar algun problema?

gorkang commented 2 years ago

Corregido añadiendo condicional en mysql_controller mas all conditions por defecto en config.js

all_conditions = {"protocol": {"type": ["survey"]}};

Faltaria añadir comprobacion en helpers.