Larissa_Cury

Forum Replies Created

Viewing 15 posts - 61 through 75 (of 92 total)
  • Author
    Posts
  • in reply to: Can we randomize time with newTimer() ? #7934
    Larissa_Cury
    Participant

    All right! Thank you!!! Considering the Var method above,

    timerd1duration = 400+Math.round(1200*Math.random()) // <------------- are we creating an object (such as we do in R?) i tried this, but it returned me an error. Shouldn't It be a a new Var too? 
    ,
    newTimer("timer-D1",timerd1duration).start().wait()
    ,
    getText("D1").remove()
    ,

    what about the D1 text? shouldn’t I keep it too? Would it be sth like this?

    timerd1duration = 400+Math.round(1200*Math.random()) // (which returned the error)
    ,
    newText("D1", "<br><b>+</b>")
        .cssContainer({
        "font-size":"100px",
        "color":"blue"})
        .center()
        .print()
    ,
       newTimer("timer-D1",400+Math.round(1600*Math.random()))
        .start()
        .wait()
    ,
       getText("D1")
       .remove()
    ,

    etc

    • This reply was modified 2 years, 1 month ago by Larissa_Cury.
    in reply to: Can we randomize time with newTimer() ? #7931
    Larissa_Cury
    Participant

    Got it! Thank you SO MUCH for your kindness, I really appreciate it!! I think that now I’ve understood it properly!

    Let me ask you something about the feedback trials: they’re working properly and I’ve already made the changes you’ve tought me how to do. However, on my “instructions_E” trial (below) =>

    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","Voltar à prática")
        .callback( jump(startsWith("p_trial")) , end() )
        .css("margin","1.5em")
        .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()
    );

    If I press the COME BACK button, it does come back, but it sums all trials. For example, if I take the practice trial twice, then it shows me my feedback for 48 trials. Is there a way to make it “reset” to only one time if the participant decides to come back?

    In the feedback trial,

    newVar("timeText").set( getVar("practiceRTs").global() ).set(v=> "Você demorou "+(v.reduce((n,m)=>n+m)/v.length)/1000+"s por pergunta em média" ), newText( "feedbackTime" ).text( getVar("timeText") ).print() .cssContainer({ "font-size":"22px", "text-align": "left", "white-space":"nowrap"})

    If I drop the 1000, then I would have the answer in ms, right?

    Thank you once more!

    • This reply was modified 2 years, 1 month ago by Larissa_Cury. Reason: edit typos
    in reply to: Can we randomize time with newTimer() ? #7929
    Larissa_Cury
    Participant

    Right, thank you for you patience for explaining this to me! In practical terms, the difference would be that one around one ms?

    in reply to: Can we randomize time with newTimer() ? #7926
    Larissa_Cury
    Participant

    Thank you once again! So, for the purposes of my current study, basically the only thing that actually matters is that reaction time that I’ve described (i.e, I need to know how long it took the participant to press the button)…So, If I understood it correctly, there should be not such a diffence between using the 4000s preset method or the VAR method concerning this, right?

    edit: to press the button after seeing the target image (i.e, the canvas)

    • This reply was modified 2 years, 1 month ago by Larissa_Cury. Reason: edit
    in reply to: Can we randomize time with newTimer() ? #7924
    Larissa_Cury
    Participant

    Ohhhhhhh, now it’s clear. So, whenever we code and print things, they’ll take time, ok. The difference is that with presetting the time (4000ms) then we know for sure that the role thing lasted for 4000, using the VAR option, I’d have to say something as such “the trials lasted aproximately 4000 ms”, right? Does it also make a difference in computing the reaction time afterwards ? I mean, I’m currently doing this in R => Key Element EventTime – Canvas EventTime = “how long it took for my participant to press the key”
    Would that be the same in both methods?

    in reply to: Can we randomize time with newTimer() ? #7922
    Larissa_Cury
    Participant

    Got it! So, using the VAR option means that the possible delays would depend on the participants internet/browser/etc? while the first option would mitigate this by determining the fixed 4000 ms? concerning the delay, how bad could that be in pratical terms?

    ps: thank you once more!

    in reply to: Can we randomize time with newTimer() ? #7919
    Larissa_Cury
    Participant

    Thank you once again, Jeremy! And also thank you for your comment! By doing the other way around, the timing would be more precise or the slight delay occur one way or another?

    in reply to: Can we randomize time with newTimer() ? #7917
    Larissa_Cury
    Participant

    Thank you once again, Jeremy! You’re always kind with me, thank you. Now the feedback seems to be working just fine! Thank you!! Regarging the timer issue, I get that setting the timer before is simplier and easier, but I’m afraid (even thoug the effect is the same), some reviwers could argue that I’d not be following the original design strictly, is there a way to come up with a matematical form for the last timer making it be 3500 minus rt minus D1?

    in reply to: Can we randomize time with newTimer() ? #7915
    Larissa_Cury
    Participant

    I’m probably doing something wrong, the thing with the timers is (this is from the original article which is the base of my experiment):

    “Each trial consisted of five events. First, there was a fixation period for a random variable duration (400–1600 msec) (MY TIMER D1). Then, a warning cue was presented for 100 msec (MY TIMER- D2). There was a short fixation period for 400 msec (MY TIMER D3) after the warning cue and then the target and flankers appeared simultaneously. The target and flankers were presented until the participant responded, but for no longer than 1700 msec. (MY TIMER RT) After participants made a response, the target and flankers disappeared immediately and there was a posttarget fixation period for a variable duration which was based on the duration of the first fixation and RT (3500 msec minus duration of the first fixation minus RT). (MY TIMER WAIT-SEPARACAO)
    After this interval the next trial began. Each trial lasted for 4000 msec.”

    but I agree with you, the count is 3800, not 4000. I really don’t know what’s wrong… Anyway, is there a formula that I could use on timer-wait-separação? as we did with the random ?

    in reply to: Can we randomize time with newTimer() ? #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

    in reply to: Can we randomize time with newTimer() ? #7907
    Larissa_Cury
    Participant

    Dear Jeremy, I was able to take steps a and b, but I’m struggling with step c:

    Template("tabela-target.csv" , row => 
        newTrial("trial_2_center_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+Math.round(1600*Math.random())) // ------------------------------> my new random time between 400 and 1600 ms
        .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()
    ,
    newTimer("timer-RT",1700) // <-------------------------------------------- my new RT trial which imposes the answer within 1700 ms
        .start()
    ,
        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()
    ,
        newKey("keypress1","SK")
        .log()
        .callback( getTimer("timer-RT").stop())
    ,
        getTimer("timer-RT").wait()
    ,
         getKey("keypress1").disable(),
         getText("cruz_central"),
         getCanvas("center")
        .remove()
    ,
       newText("separacao", "<br> <b>+</b>") // <------------------------- this should be 3500 ms - timer-RT - timer-D1
       .cssContainer({
        "font-size":"100px",
        "color":"yellow"})
       .center()
       .print()
    ,
        newTimer("wait-separacao",2500)
        .start()
        .wait()
    )
      .log("imagens", row.imagem)
      .log("item", row.versao)
    );

    I don’t see how putting “wait separação” before D1 would make it be: WAIT SEPARAÇÃO = 3500 MINUS timer-RT MINUS timer-D1 . Would you mind explaining it again, please?

    Thanks in advance, as always!

    in reply to: Delay in making changes #7905
    Larissa_Cury
    Participant

    Edit: I’ve just seen this: https://www.pcibex.net/forums/topic/code-doesnt-get-updated-despite-the-saved-message/ and it seems that making a copy really works!

    • This reply was modified 2 years, 1 month ago by Larissa_Cury. Reason: typo
    in reply to: Can we randomize time with newTimer() ? #7901
    Larissa_Cury
    Participant

    Dear Jeremy,

    What if I need to show feedback together with the test.pressed feebback? I mean, I still need the averege one, but I’d need something like this after each item:

    “correct! your speed was: 150 ms!
    “incorrect! your speed was 500ms!” etc

    Is it possible, if so, how?

    in reply to: Can we randomize time with newTimer() ? #7896
    Larissa_Cury
    Participant

    Thank you so much, Jeremy!! I’ll work on all these codes! Thank you for your kind answers as always 🙂

    in reply to: Can we randomize time with newTimer() ? #7892
    Larissa_Cury
    Participant

    All right! That sounds amazing! I’ll wait for the reaction average time feedback, I’m sorry I typed that wrong! Thank you!!

    • This reply was modified 2 years, 1 month ago by Larissa_Cury. Reason: typo
Viewing 15 posts - 61 through 75 (of 92 total)