Reply To: Can we randomize time with newTimer() ?

PennController for IBEX Forums Support Can we randomize time with newTimer() ? Reply To: Can we randomize time with newTimer() ?

#7962
Larissa_Cury
Participant

Dear Jeremy,

but I don’t think that I put the accuracy var on this page. Let me show it to you: this is the “instructions_E” page =>

newTrial("instructions_E",
  newText("instructions-12","Você está pronto?")
    .cssContainer({
        "border": "5px solid black",
        "background-color": "yellow",
        "color": "black",
        "font-size":"50px"
    })
    .center()
    .print()
  ,
  newText("instructions-17","<p>Sinta-se livre para fazer uma pausa agora</p>")
    .cssContainer({
        "font-size":"22px",
        "text-align": "center"
    })
    .center()
    .print()
  ,
  newImage("boy-image","boy.png")
    .size(200,200)
    .center()
    .print()
  ,
  newText("instructions-14","<p><center> Se você quiser praticar de novo, clique aqui:")
    .cssContainer({
        "font-size":"22px",
        "text-align": "center"
    })
    .center()
    .print()
 ,
  newButton("come back","PRATICAR DE NOVO")
    .callback(newVar("practiceRTs").global().set( [] ),jump(startsWith("p_trial")) , end() ) 
    .css("margin","1.5em")
    .center()
    .print()
  ,
  newText("instructions-blocks","<p><center>A tarefa terá 3 blocos. <b style=color:red;>Cada bloco dura aproximadamente 5 minutos.</b> No total, você deve demorar 15 minutos.</p></center>")
    .cssContainer({
        "font-size":"22px",
        "text-align": "center",
        "white-space":"nowrap"})
    .center()
    .print()
  ,
  newText("instructions-15","<p><center>Quando você se sentir <b style=color:red;>PRONTO</b>, clique no botão abaixo:</p></center>")
    .cssContainer({
        "font-size":"22px",
        "text-align": "center"
    })
    .center()
    .print()
  ,
  newButton("wait","COMEÇAR")
    .center()
    .print()
    .wait()
);

the page that shows the feedback is the previous one of Instructions_E, this one here:

newTrial("feedback-trial",
defaultText
        .print()
,
newText("feedback-text","Seus resultados:")
.cssContainer({
    "border": "5px solid black",
    "background-color": "yellow",
    "color": "black",
    "margin":"1em",
    "font-size":"50px"})
    .center()
,
  newVar("timeText").set( getVar("practiceRTs").global() ).set(v=> "Você demorou "+(v.reduce((n,m)=>n+m)/v.length)+"ms por pergunta em média" ),
  newText( "feedbackTime" ).text( getVar("timeText") ).print()
  .cssContainer({
    "font-size":"22px",
    "text-align": "left",
    "white-space":"nowrap"})
  ,
  newVar("accuracyText").set( getVar("accurate").global() ).set(v=> "Você acertou "+v.filter(a=>a==true).length+" do total de "+v.length ),
  newText( "feedbackAccuracy" ).text( getVar("accuracyText") ).print()
  .cssContainer({
    "font-size":"22px",
    "text-align": "left",
    "white-space":"nowrap"})
  ,
  newButton("CONTINUAR")
  .center()
  .cssContainer({"margin":"1em"})
  .print()
  .wait()
);

So the sequence is this: instructions + practice trial with feedback within + final feedback + instructions_E

should I add the accuracy inside the callbutton? Like this:

  newButton("come back","PRATICAR DE NOVO")
    .callback(newVar("practiceRTs").global().set( [] ),newVar("accurate").global().set( [] ),jump(startsWith("p_trial")) , end() ) 
    .css("margin","1.5em")
    .center()
    .print()

would that work?