optional instructions
Dear all,
at the beginning of my experiment participants solve a practice task in order to familiarize with the task. Before the practice task they receive instructions on how to solve the task. After the practice task the participants receive the same but shortened instructions followed by the experimental task. Since it is possible that some participants didn't understand the instructions quite yet I want to give them the chance to read the more detailed instructions again (from the practice task). My idea is that the participants can press the spacebar if they want to continue right away and another key (let's say the button "e") if they want to read the detailed instructions again. I inserted a short inline script and defined the path they are led to depending on their choice ("spacebar" or button "e"):
if self.get('response') == 'e': detailed_instruction_canvas.prepare() detailed_instruction_canvas.show()
This code does work however when I press the spacebar the program doesn't react immediately, I have to press the spacebar twice in order to continue with the task. I guess something is missing in my inline script. How can I tell the program to continue with the task right away when they press the spacebar (i.e. jump to the experimental task without reading the detailed instructions again)?
I hope this makes sense. Please do ask if my question is not clear!
Thanks,
Erwin
Comments
Hi Erwin,
Do you maybe have a keyboard item or a sketchpad item with duration "keypress" after your inline item?
Best,
Jarik
Dear Jarik,
thank you for your answer! The sequence of the experiment looks like this: I have an inline script with the short instructions where I tell the participants that they can either press the spacebar to continue with the task right away or the button e to read the detailed instructions. After that I have a keyboard item (allowed responses: space and e and timeout = infinite). This is followed by the inline script with the code I posted above (if self.get('response') == 'e' and so on). Finally - as you assumed - I added another keyboard item (allowed response: space and timeout = infinite). Do you see a problem with this sequence?
Thanks again for your help!
Erwin
Hi Erwin,
I think you'll have to delete that last keyboard item. If that doesn't work; could you upload (the problematic part of) your experiment?
Best,
Jarik
Thanks for your answer! When I delete the last keyboard item the path of the command if self.get('response') == 'e' is shown for an extremly short timeframe (maybe 10ms..). I think I need the keyboard item but I will have to add something in the inline script where I define the paths (maybe the command "else" so the experiment continues without the detailed instruction).
Here is the sequence of my experiment, hope this helps:
Thanks,
Erwin
Hi Erwin,
It's a bit hard to see what's wrong like that.
Maybe my attached example can give you some insight on how to (re)run an item from an inline_script item.
Best,
Jarik
Hi Erwin,
I think Jarik is right, so do delete the second
keyboard response
. To make the instruction not disappear form the screen to quickly, it might make sense, to clear the keyboard in the beginning of your instructions (keyboard_response.clear()
), so that pendingkeypresses will be removed
. But if you show us the code of how you present the instructions it might be easier to solve this better.Eduard
Dear Jarik, dear Eduard
Thanks for your help and your patience! In the attachment you will find my script, the crucial part is between the end of the practice_loop_SSTF and the experiment_loop_SSTF_block1 (so the sequence I posted above).
Thanks again for your help!
Erwin
Hi erwin,
If you click on the experiment sequence (the second item in the overview area), you can adjust the
show_if
fields of each item. There, put[response] = 'e'
in the show if field of thenew_keyboard_response_2
.Does that solve it?
Eduard
Dear Eduard
Brilliant, it works! Thank you so much for your help!
Kind regards,
Erwin