problem by Sequence and some others

PennController for IBEX Forums Support problem by Sequence and some others

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8306
    Fiona
    Participant

    Hello Jeremy,
    1. I have a problem with the Sequence function. I’d like to randomize my experiment trials. So I use the codes below:
    Sequence("instructions","instr-test","instr-test2","example","begin",randomize("experiment"), "send","finish")
    but when I preview the project, the “example” and randomize(“experiment”) part are totally missing. I mean when “instr-test2” part finished, it jumped directly to “begin” part,and then directly to “send”and “finish”. Could you please help me to solve this?
    Hier is my experiment link: https://farm.pcibex.net/r/qyFEWI/
    2. another question is, In my experiment trials, there is 1)firstly a fixation cross for 500ms, 2)a audio play, 3)when the audio finish, remove the cross and show the picture, 4)the picture present 500ms and then remove, 5)a fixation cross on the screen until press F or J key. Because I want the participants can press the key either within or after 500ms, and when they press within 500ms, the trial ends, that means no more cross on the screen. So I wrote the code like below. at newKey(“stop early”) I wrote .log(“last”), is that correct?

    ["PennController",newTrial("experiment",
             newText("cross","+")  // fixation cross
                  .css({ "font-size": "60"}) 
                  .print("center at 50%","center at 44%")
        ,
             newTimer("wait", 500)
                  .start()
                  .wait()
        ,
             newAudio("audio", row.audio)  // audio play
                  .play()
                  .wait()
        ,
             getText("cross").remove()
        ,
             newImage("pic", row.pic)  // show pic
                  .size(500, 500)
                  .print("center at 50%","center at 44%")
                  .log()
        ,
             newTimer("break", 500)  // pic delay
                  .start()
        ,
              newKey("stop early", "FJ") 
                   .callback(end())
                   .log("last")  // is hier right?
        ,
              getTimer("break")
                   .wait()   
        ,
             getImage("pic").remove()  // remove pic 
        ,   
             newText("cross2","+") // fixation cross
                  .css({ "font-size": "60"}) 
                  .print("center at 50%","center at 44%")
        ,
             newKey("keypress", "FJ")
                  .wait()
                  .log()
        )
    • This topic was modified 1 year, 9 months ago by Fiona.
    #8310
    Jeremy
    Keymaster

    Hi,

    1. The syntax you are using in Template automatically assigns a label to the items that are generated. Indeed, when I look up your code, every item generated by your Template commands consists of two PennController trials, and the two newTrial commands you use in there have different strings as their first arguments ("example" and "grad", or "experiment" and "grad")

    If you want to give labels to items consisting of pairs of elements, so that participants will always see the two newTrials of a pair in a row, and so that those two newTrials will remain associated with each other through randomize, you can pass the label before "PennController": ["experiment", "PennController",newTrial(, ["example", "PennController",newTrial( (also remember to change "example.csv" in the current Sequence command in project back to "example" like you have in your message above)

    2. Yes, I think it’s fine, but always take test-runs of your experiment and check the results file to see if you do get all the information you want. In this case, if you press F or J early, I expect that you should have a line in your results file for that Key element ("stop early") but no line for the other Key element ("keypress") or a line that reports NA. But you should really just take a test-run and check your results file

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.