PennController for IBEX › Forums › Support › Can we randomize time with newTimer() ? › Reply To: Can we randomize time with newTimer() ?
March 21, 2022 at 2:09 pm
#7913
Larissa_Cury
Participant
Thank you for your kind answer! I’m struggling to add the feedback on each trial together with the final one:
This is what I’ve already done (and it shows the feedback on the feedback trial):
//////////////////////////////////////////trial_1 - no_cue// PARA CIMA/LEFT////////////////////////////////////////////////////// Template("tabela-target_left.csv" , row => newTrial("p_trial_1_no_cue_UP", defaultText .center() .cssContainer({"position": "absolute", "top": "50%", "left": "50%", "transform": "translate(-50%, +50%)"}) .print() , newText("D1", " <br> <b>+</b>") .cssContainer({ "font-size":"100px", "color":"blue"}) .center() .print() , newTimer("timer-D1",1000) .start() .wait() , getText("D1") .remove() , newText("cue", "<br> <b>+</b>") .cssContainer({ "font-size":"100px", "color":"green"}) .center() .print() , newTimer("timer_cue_D2",100) .start() .wait() , getText("cue","D2") .remove() , newText("D3", "<br> <b>+</b>") .cssContainer({ "font-size":"100px", "color":"pink"}) .center() .print() , newTimer("timer_D3",400) .start() .wait() , getText("D3") .remove() , newImage("imagens", row.imagem) .size(500, 200) , newText("cruz_central", "<br> <b>+</b>") .cssContainer({ "font-size":"100px", "color":"black"}) .center() .print() , //para cima// newCanvas("center", 150,150) .add( "center at 50%" , "center at 50%" , getImage("imagens")) .cssContainer({ "position": "absolute", "margin-top": "85px"}) .center() .log() .print() , newVar("localRT").set(v=>Date.now()), newKey("keypress1","SK") .wait() , getVar("localRT").set(v=>Date.now()-v), newVar("practiceRTs",[]).global().set(v=>[...v,getVar("localRT").value]) , newVar("accurate", []).global() , getKey("keypress1") .test.pressed("S") .success(newText("success", "Correto!").print() .cssContainer({"font-size":"30px", "margin-top":"255px","font-family":"Comic Sans MS", "color":"green"}).center(), getVar("accurate").set(v=>[...v,true])) .failure( newText("failure", "Incorreto!").print() .cssContainer({"font-size":"30px", "margin-top":"255px", "font-family":"Comic Sans MS", "color":"red"}).center(), getVar("accurate").set(v=>[...v,false])) , getText("cruz_central") .remove() , getCanvas("center") .remove() , newTimer("wait-success",400) .start() .wait() , getText("success") .remove() , getText("failure") .remove() , newText("separacao", "<br> <b>+</b>") .cssContainer({ "font-size":"100px", "color":"yellow"}) .center() .print() , newTimer("wait-separacao",2500) .start() .wait() ));
How do I manage to do both? I mean: both during each trial but also in my ‘feedback” ? (https://farm.pcibex.net/r/yBeBcJ/)
Sequence( "instructions_A", "instructions_B", "instructions_C", "instructions_D","instructions_Extra","keyboard_warning", rshuffle("p_trial_1_no_cue_UP","p_trial_1_no_cue_DOWN","p_trial_2_center_cue_UP","p_trial_2_center_cue_DOWN", "p_trial_3_double_cue_UP","p_trial_3_double_cue_DOWN","p_trial_4_spatial_cue_UP","p_trial_4_spatial_cue_DOWN"), "feedback", "instructions_E",
etc etc etc