PennController for IBEX › Forums › Support › html layout/event times/selector vs. scale/ compatibility › Reply To: html layout/event times/selector vs. scale/ compatibility
Hi,
I am running this experiment and some participants experience a problem with the blank function that I load at the beginning of the experiment
blank = sentence => Object({html: sentence.replace(/_+/g, (t,i)=>`<textarea name='blank${i}' rows=1 cols=${t.length+1} style='max-height: 1.7em'></textarea>`) }); Template("ansa_template.csv", row => newTrial("ansa", newVar("ansa_1","").global(),newVar("ansa_2","").global(),newVar("ansa_3","").global(),newVar("ansa_4","").global(),newVar("ansa_5","").global(), newVar("ansa_6","").global(),newVar("ansa_7","").global(),newVar("ansa_8","").global(),newVar("ansa_9","").global(),newVar("ansa_10","").global(), newVar("ansa_11","").global(),newVar("ansa_12","").global(),newVar("ansa_13","").global(),newVar("ansa_14","").global(),newVar("ansa_15","").global(), newVar("ansa_16","").global(),newVar("ansa_17","").global(),newVar("ansa_18","").global(),newVar("ansa_19","").global(),newVar("ansa_20","").global() , //.test.is('AB') newTimer("loop", 10).callback( getVar("ansa_1").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[0]||{value:v1}).value ), getVar("ansa_2").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[1]||{value:v1}).value ), getVar("ansa_3").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[2]||{value:v1}).value ), getVar("ansa_4").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[3]||{value:v1}).value ), getVar("ansa_5").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[4]||{value:v1}).value ), getVar("ansa_6").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[5]||{value:v1}).value ), getVar("ansa_7").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[6]||{value:v1}).value ), getVar("ansa_8").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[7]||{value:v1}).value ), getVar("ansa_9").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[8]||{value:v1}).value ), getVar("ansa_10").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[9]||{value:v1}).value ), getVar("ansa_11").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[10]||{value:v1}).value ), getVar("ansa_12").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[11]||{value:v1}).value ), getVar("ansa_13").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[12]||{value:v1}).value ), getVar("ansa_14").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[13]||{value:v1}).value ), getVar("ansa_15").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[14]||{value:v1}).value ), getVar("ansa_16").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[15]||{value:v1}).value ), getVar("ansa_17").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[16]||{value:v1}).value ), getVar("ansa_18").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[17]||{value:v1}).value ), getVar("ansa_19").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[18]||{value:v1}).value ), getVar("ansa_20").set(v1=>(document.querySelectorAll("textarea[name^='blank']")[19]||{value:v1}).value ) , getTimer("loop").start() ).start()
So there is a text, the correct answers are loaded in the template, the participants have to fill the blank in the text, and I match them with the solution in the template and count whether the answer is correct.
I have a doubt about the timer, I have set it at 10 thinking that every 10 ms seconds the script checks whether the blank is filled, but some participants get a message to fill the blank even when it is filled, meaning it is seeing the cell as empty and it is not. I thought there was some error in the code of the text, but in the end, there is not. I think this happens when they are particularly slow. So I wondered if the timer that I have set is not ok.
I am not understanding if I should lower it (lower than 10), and it refreshes more times, or place a higher number and it considers a longer window of time?
What strategy do you suggest?
Thank you
HPI