PennController for IBEX › Forums › Support › problem by Sequence and some others
- This topic has 1 reply, 2 voices, and was last updated 2 years, 4 months ago by Jeremy.
-
AuthorPosts
-
July 22, 2022 at 7:27 pm #8306FionaParticipant
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 2 years, 4 months ago by Fiona.
July 25, 2022 at 1:00 pm #8310JeremyKeymasterHi,
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 yourTemplate
commands consists of two PennController trials, and the twonewTrial
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
newTrial
s of a pair in a row, and so that those twonewTrial
s will remain associated with each other throughrandomize
, you can pass the label before"PennController"
:["experiment", "PennController",newTrial(
,["example", "PennController",newTrial(
(also remember to change"example.csv"
in the currentSequence
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 fileJeremy
-
AuthorPosts
- You must be logged in to reply to this topic.