Commit 30d7a9f3 authored by Monica Connelly's avatar Monica Connelly

Input Code Branches

Stages of key responses with code components input to match the UnkObjID study.

This works on local device
parent 420c37e8
......@@ -306,7 +306,29 @@
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<TextComponent name="ContText3">
<MovieComponent name="VideoLoopMovie">
<Param name="No audio" updates="None" val="True" valType="bool"/>
<Param name="backend" updates="None" val="moviepy" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="False" valType="bool"/>
<Param name="loop" updates="None" val="True" valType="bool"/>
<Param name="movie" updates="set every repeat" val="$Vids" valType="str"/>
<Param name="name" updates="None" val="VideoLoopMovie" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="size" updates="constant" val="0.5" valType="code"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="units" updates="None" val="norm" valType="str"/>
</MovieComponent>
<TextComponent name="Resp1Text">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
......@@ -315,7 +337,7 @@
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="ContText3" valType="code"/>
<Param name="name" updates="None" val="Resp1Text" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, -0.4)" valType="code"/>
......@@ -323,21 +345,164 @@
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="time (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="2.0" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Resp 1" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="VLKeyResp02">
<Param name="allowedKeys" updates="constant" val="'a','l'" valType="code"/>
<Param name="correctAns" updates="constant" val="$CorrAns" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="VLKeyResp02" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="2.0" valType="code"/>
<Param name="store" updates="constant" val="first key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="True" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
<TextComponent name="Resp2Text">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="" valType="str"/>
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="Resp2Text" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, -0.4)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="2.0" valType="code"/>
<Param name="stopType" updates="None" val="time (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="4.0" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Resp 2" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="VLKeyResp24">
<Param name="allowedKeys" updates="constant" val="'a','l'" valType="code"/>
<Param name="correctAns" updates="constant" val="$CorrAns" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="VLKeyResp24" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="2.0" valType="code"/>
<Param name="stopType" updates="None" val="time (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="4.0" valType="code"/>
<Param name="store" updates="constant" val="first key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="True" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
<TextComponent name="Resp3Text">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="" valType="str"/>
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="Resp3Text" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, -0.4)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="4.0" valType="code"/>
<Param name="stopType" updates="None" val="time (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="6.0" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Resp 3" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="VLKeyResp46">
<Param name="allowedKeys" updates="constant" val="'a','l'" valType="code"/>
<Param name="correctAns" updates="constant" val="$CorrAns" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="VLKeyResp46" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="4.0" valType="code"/>
<Param name="stopType" updates="None" val="time (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="6.0" valType="code"/>
<Param name="store" updates="constant" val="first key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="True" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
<CodeComponent name="Resp1LoopCode">
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto-&gt;JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="var _pj;&amp;#10;function _pj_snippets(container) {&amp;#10; function in_es6(left, right) {&amp;#10; if (((right instanceof Array) || ((typeof right) === &quot;string&quot;))) {&amp;#10; return (right.indexOf(left) &gt; (- 1));&amp;#10; } else {&amp;#10; if (((right instanceof Map) || (right instanceof Set) || (right instanceof WeakMap) || (right instanceof WeakSet))) {&amp;#10; return right.has(left);&amp;#10; } else {&amp;#10; return (left in right);&amp;#10; }&amp;#10; }&amp;#10; }&amp;#10; container[&quot;in_es6&quot;] = in_es6;&amp;#10; return container;&amp;#10;}&amp;#10;_pj = {};&amp;#10;_pj_snippets(_pj);&amp;#10;if ((! _pj.in_es6(VLKeyResp02.keys, [&quot;a&quot;, &quot;l&quot;]))) {&amp;#10; Resp1Loop.finished = true;&amp;#10;} else {&amp;#10; Resp1Loop.finished = false;&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="# If the participant does not respond during the video&amp;#10;if VLKeyResp02.keys not in ['a', 'l']:&amp;#10; Resp1Loop.finished = True&amp;#10;else:&amp;#10; Resp1Loop.finished = False" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="Resp1LoopCode" valType="code"/>
</CodeComponent>
</Routine>
<Routine name="IfResp1">
<TextComponent name="IfResp1Text">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="" valType="str"/>
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="IfResp1Text" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Press 'space bar'" valType="str"/>
<Param name="text" updates="constant" val="Responded during window 1, Trial to repeat.&amp;#10;&amp;#10;&amp;#10;Press 'space bar'" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="VideoLoopKeyResp">
<KeyboardComponent name="IfResp1KeyResp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="code"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="VideoLoopKeyResp" valType="code"/>
<Param name="name" updates="None" val="IfResp1KeyResp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
......@@ -348,28 +513,183 @@
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
<MovieComponent name="VideoLoopMovie">
<Param name="No audio" updates="None" val="True" valType="bool"/>
<Param name="backend" updates="None" val="moviepy" valType="str"/>
<CodeComponent name="IfResp1Code">
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto-&gt;JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="# `continueRoutine` seems to only work on frame checking&amp;#10;&amp;#10;# If they didn't hit something too early&amp;#10;if VLKeyResp02.keys not in ['a', 'l']:&amp;#10; # We don't display this routine&amp;#10; continueRoutine = False" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="var _pj;&amp;#10;function _pj_snippets(container) {&amp;#10; function in_es6(left, right) {&amp;#10; if (((right instanceof Array) || ((typeof right) === &quot;string&quot;))) {&amp;#10; return (right.indexOf(left) &gt; (- 1));&amp;#10; } else {&amp;#10; if (((right instanceof Map) || (right instanceof Set) || (right instanceof WeakMap) || (right instanceof WeakSet))) {&amp;#10; return right.has(left);&amp;#10; } else {&amp;#10; return (left in right);&amp;#10; }&amp;#10; }&amp;#10; }&amp;#10; container[&quot;in_es6&quot;] = in_es6;&amp;#10; return container;&amp;#10;}&amp;#10;_pj = {};&amp;#10;_pj_snippets(_pj);&amp;#10;if ((! _pj.in_es6(VLKeyResp02.keys, [&quot;a&quot;, &quot;l&quot;]))) {&amp;#10; continueRoutine = false;&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="IfResp1Code" valType="code"/>
</CodeComponent>
</Routine>
<Routine name="IfResp2">
<CodeComponent name="IfResp2Code">
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto-&gt;JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="# `continueRoutine` seems to only work on frame checking&amp;#10;&amp;#10;# If they didn't hit something too early&amp;#10;if VLKeyResp24.keys not in ['a', 'l']:&amp;#10; # We don't display this routine&amp;#10; continueRoutine = False" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="var _pj;&amp;#10;function _pj_snippets(container) {&amp;#10; function in_es6(left, right) {&amp;#10; if (((right instanceof Array) || ((typeof right) === &quot;string&quot;))) {&amp;#10; return (right.indexOf(left) &gt; (- 1));&amp;#10; } else {&amp;#10; if (((right instanceof Map) || (right instanceof Set) || (right instanceof WeakMap) || (right instanceof WeakSet))) {&amp;#10; return right.has(left);&amp;#10; } else {&amp;#10; return (left in right);&amp;#10; }&amp;#10; }&amp;#10; }&amp;#10; container[&quot;in_es6&quot;] = in_es6;&amp;#10; return container;&amp;#10;}&amp;#10;_pj = {};&amp;#10;_pj_snippets(_pj);&amp;#10;if ((! _pj.in_es6(VLKeyResp24.keys, [&quot;a&quot;, &quot;l&quot;]))) {&amp;#10; continueRoutine = false;&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="IfResp2Code" valType="code"/>
</CodeComponent>
<TextComponent name="IfResp2Text">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="False" valType="bool"/>
<Param name="loop" updates="None" val="True" valType="bool"/>
<Param name="movie" updates="set every repeat" val="$Vids" valType="str"/>
<Param name="name" updates="None" val="VideoLoopMovie" valType="code"/>
<Param name="flip" updates="constant" val="" valType="str"/>
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="IfResp2Text" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="size" updates="constant" val="0.5" valType="code"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="units" updates="None" val="norm" valType="str"/>
</MovieComponent>
<Param name="text" updates="constant" val="Responded during window 2.&amp;#10;&amp;#10;&amp;#10;Press 'space bar'" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="IfResp2KeyResp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="code"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="IfResp2KeyResp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="nothing" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
<Routine name="IfResp3">
<CodeComponent name="IfResp3Code">
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto-&gt;JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="# `continueRoutine` seems to only work on frame checking&amp;#10;&amp;#10;# If they didn't hit something too early&amp;#10;if VLKeyResp46.keys not in ['a', 'l']:&amp;#10; # We don't display this routine&amp;#10; continueRoutine = False" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="var _pj;&amp;#10;function _pj_snippets(container) {&amp;#10; function in_es6(left, right) {&amp;#10; if (((right instanceof Array) || ((typeof right) === &quot;string&quot;))) {&amp;#10; return (right.indexOf(left) &gt; (- 1));&amp;#10; } else {&amp;#10; if (((right instanceof Map) || (right instanceof Set) || (right instanceof WeakMap) || (right instanceof WeakSet))) {&amp;#10; return right.has(left);&amp;#10; } else {&amp;#10; return (left in right);&amp;#10; }&amp;#10; }&amp;#10; }&amp;#10; container[&quot;in_es6&quot;] = in_es6;&amp;#10; return container;&amp;#10;}&amp;#10;_pj = {};&amp;#10;_pj_snippets(_pj);&amp;#10;if ((! _pj.in_es6(VLKeyResp46.keys, [&quot;a&quot;, &quot;l&quot;]))) {&amp;#10; continueRoutine = false;&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="IfResp3Code" valType="code"/>
</CodeComponent>
<TextComponent name="IfResp3Text">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="" valType="str"/>
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="IfResp3Text" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Responded during window 3.&amp;#10;&amp;#10;&amp;#10;Press 'space bar'" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="IfResp3KeyResp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="code"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="IfResp3KeyResp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="nothing" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
<Routine name="Initiate">
<TextComponent name="InitiateText">
<Param name="color" updates="constant" val="white" valType="str"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="" valType="str"/>
<Param name="font" updates="constant" val="Arial" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="0.05" valType="code"/>
<Param name="name" updates="None" val="InitiateText" valType="code"/>
<Param name="opacity" updates="constant" val="1" valType="code"/>
<Param name="ori" updates="constant" val="0" valType="code"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Press 'space bar' to start trial." valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="InitiateKeyResp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="code"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="InitiateKeyResp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="nothing" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
</Routines>
<Flow>
......@@ -387,7 +707,23 @@
<Param name="name" updates="None" val="trialsloop" valType="code"/>
<Param name="random seed" updates="None" val="" valType="code"/>
</LoopInitiator>
<LoopInitiator loopType="TrialHandler" name="Resp1Loop">
<Param name="Selected rows" updates="None" val="" valType="str"/>
<Param name="conditions" updates="None" val="None" valType="str"/>
<Param name="conditionsFile" updates="None" val="" valType="str"/>
<Param name="endPoints" updates="None" val="[0, 1]" valType="num"/>
<Param name="isTrials" updates="None" val="True" valType="bool"/>
<Param name="loopType" updates="None" val="sequential" valType="str"/>
<Param name="nReps" updates="None" val="5" valType="code"/>
<Param name="name" updates="None" val="Resp1Loop" valType="code"/>
<Param name="random seed" updates="None" val="" valType="code"/>
</LoopInitiator>
<Routine name="Initiate"/>
<Routine name="VideoLoop"/>
<Routine name="IfResp1"/>
<LoopTerminator name="Resp1Loop"/>
<Routine name="IfResp2"/>
<Routine name="IfResp3"/>
<LoopTerminator name="trialsloop"/>
<Routine name="Finish"/>
</Flow>
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.1.3),
on March 24, 2020, at 11:08
on March 24, 2020, at 12:38
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019)
......@@ -145,6 +145,17 @@ Vid2Movie = visual.MovieStim3(
)
Vid2keyresp = keyboard.Keyboard()
# Initialize components for Routine "Initiate"
InitiateClock = core.Clock()
InitiateText = visual.TextStim(win=win, name='InitiateText',
text="Press 'space bar' to start trial.",
font='Arial',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=0.0);
InitiateKeyResp = keyboard.Keyboard()
# Initialize components for Routine "VideoLoop"
VideoLoopClock = core.Clock()
VideoLoopText = visual.TextStim(win=win, name='VideoLoopText',
......@@ -154,14 +165,63 @@ VideoLoopText = visual.TextStim(win=win, name='VideoLoopText',
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=0.0);
ContText3 = visual.TextStim(win=win, name='ContText3',
text="Press 'space bar'",
Resp1Text = visual.TextStim(win=win, name='Resp1Text',
text='Resp 1',
font='Arial',
pos=(0, -0.4), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-2.0);
VLKeyResp02 = keyboard.Keyboard()
Resp2Text = visual.TextStim(win=win, name='Resp2Text',
text='Resp 2',
font='Arial',
pos=(0, -0.4), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-4.0);
VLKeyResp24 = keyboard.Keyboard()
Resp3Text = visual.TextStim(win=win, name='Resp3Text',
text='Resp 3',
font='Arial',
pos=(0, -0.4), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-6.0);
VLKeyResp46 = keyboard.Keyboard()
# Initialize components for Routine "IfResp1"
IfResp1Clock = core.Clock()
IfResp1Text = visual.TextStim(win=win, name='IfResp1Text',
text="Responded during window 1, Trial to repeat.\n\n\nPress 'space bar'",
font='Arial',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=0.0);
IfResp1KeyResp = keyboard.Keyboard()
# Initialize components for Routine "IfResp2"
IfResp2Clock = core.Clock()
IfResp2Text = visual.TextStim(win=win, name='IfResp2Text',
text="Responded during window 2.\n\n\nPress 'space bar'",
font='Arial',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-1.0);
IfResp2KeyResp = keyboard.Keyboard()
# Initialize components for Routine "IfResp3"
IfResp3Clock = core.Clock()
IfResp3Text = visual.TextStim(win=win, name='IfResp3Text',
text="Responded during window 3.\n\n\nPress 'space bar'",
font='Arial',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-1.0);
VideoLoopKeyResp = keyboard.Keyboard()
IfResp3KeyResp = keyboard.Keyboard()
# Initialize components for Routine "Finish"
FinishClock = core.Clock()
......@@ -508,24 +568,521 @@ for thisTrialsloop in trialsloop:
for paramName in thisTrialsloop:
exec('{} = thisTrialsloop[paramName]'.format(paramName))
# ------Prepare to start Routine "VideoLoop"-------
# set up handler to look after randomisation of conditions etc
Resp1Loop = data.TrialHandler(nReps=5, method='sequential',
extraInfo=expInfo, originPath=-1,
trialList=[None],
seed=None, name='Resp1Loop')
thisExp.addLoop(Resp1Loop) # add the loop to the experiment
thisResp1Loop = Resp1Loop.trialList[0] # so we can initialise stimuli with some values
# abbreviate parameter names if possible (e.g. rgb = thisResp1Loop.rgb)
if thisResp1Loop != None:
for paramName in thisResp1Loop:
exec('{} = thisResp1Loop[paramName]'.format(paramName))
for thisResp1Loop in Resp1Loop:
currentLoop = Resp1Loop
# abbreviate parameter names if possible (e.g. rgb = thisResp1Loop.rgb)
if thisResp1Loop != None:
for paramName in thisResp1Loop:
exec('{} = thisResp1Loop[paramName]'.format(paramName))
# ------Prepare to start Routine "Initiate"-------
continueRoutine = True
# update component parameters for each repeat
InitiateKeyResp.keys = []
InitiateKeyResp.rt = []
_InitiateKeyResp_allKeys = []
# keep track of which components have finished
InitiateComponents = [InitiateText, InitiateKeyResp]
for thisComponent in InitiateComponents:
thisComponent.tStart = None
thisComponent.tStop = None
thisComponent.tStartRefresh = None
thisComponent.tStopRefresh = None
if hasattr(thisComponent, 'status'):
thisComponent.status = NOT_STARTED
# reset timers
t = 0
_timeToFirstFrame = win.getFutureFlipTime(clock="now")
InitiateClock.reset(-_timeToFirstFrame) # t0 is time of first possible flip
frameN = -1
# -------Run Routine "Initiate"-------
while continueRoutine:
# get current time
t = InitiateClock.getTime()
tThisFlip = win.getFutureFlipTime(clock=InitiateClock)
tThisFlipGlobal = win.getFutureFlipTime(clock=None)
frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
# update/draw components on each frame
# *InitiateText* updates
if InitiateText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
InitiateText.frameNStart = frameN # exact frame index
InitiateText.tStart = t # local t and not account for scr refresh
InitiateText.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(InitiateText, 'tStartRefresh') # time at next scr refresh
InitiateText.setAutoDraw(True)
# *InitiateKeyResp* updates
waitOnFlip = False
if InitiateKeyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
InitiateKeyResp.frameNStart = frameN # exact frame index
InitiateKeyResp.tStart = t # local t and not account for scr refresh
InitiateKeyResp.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(InitiateKeyResp, 'tStartRefresh') # time at next scr refresh
InitiateKeyResp.status = STARTED
# keyboard checking is just starting
waitOnFlip = True
win.callOnFlip(InitiateKeyResp.clock.reset) # t=0 on next screen flip
win.callOnFlip(InitiateKeyResp.clearEvents, eventType='keyboard') # clear events on next screen flip
if InitiateKeyResp.status == STARTED and not waitOnFlip:
theseKeys = InitiateKeyResp.getKeys(keyList=['space'], waitRelease=False)
_InitiateKeyResp_allKeys.extend(theseKeys)
if len(_InitiateKeyResp_allKeys):
InitiateKeyResp.keys = _InitiateKeyResp_allKeys[-1].name # just the last key pressed
InitiateKeyResp.rt = _InitiateKeyResp_allKeys[-1].rt
# a response ends the routine
continueRoutine = False
# check for quit (typically the Esc key)
if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]):
core.quit()
# check if all components have finished
if not continueRoutine: # a component has requested a forced-end of Routine
break
continueRoutine = False # will revert to True if at least one component still running
for thisComponent in InitiateComponents:
if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
continueRoutine = True
break # at least one component has not yet finished
# refresh the screen
if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
win.flip()
# -------Ending Routine "Initiate"-------
for thisComponent in InitiateComponents:
if hasattr(thisComponent, "setAutoDraw"):
thisComponent.setAutoDraw(False)
Resp1Loop.addData('InitiateText.started', InitiateText.tStartRefresh)
Resp1Loop.addData('InitiateText.stopped', InitiateText.tStopRefresh)
# the Routine "Initiate" was not non-slip safe, so reset the non-slip timer
routineTimer.reset()
# ------Prepare to start Routine "VideoLoop"-------
continueRoutine = True
# update component parameters for each repeat
VideoLoopMovie = visual.MovieStim3(
win=win, name='VideoLoopMovie',units='norm',
noAudio = True,
filename=Vids,
ori=0, pos=(0, 0), opacity=1,
loop=True,
size=0.5,
depth=-1.0,
)
VLKeyResp02.keys = []
VLKeyResp02.rt = []
_VLKeyResp02_allKeys = []
VLKeyResp24.keys = []
VLKeyResp24.rt = []
_VLKeyResp24_allKeys = []
VLKeyResp46.keys = []
VLKeyResp46.rt = []
_VLKeyResp46_allKeys = []
# keep track of which components have finished
VideoLoopComponents = [VideoLoopText, VideoLoopMovie, Resp1Text, VLKeyResp02, Resp2Text, VLKeyResp24, Resp3Text, VLKeyResp46]
for thisComponent in VideoLoopComponents:
thisComponent.tStart = None
thisComponent.tStop = None
thisComponent.tStartRefresh = None
thisComponent.tStopRefresh = None
if hasattr(thisComponent, 'status'):
thisComponent.status = NOT_STARTED
# reset timers
t = 0
_timeToFirstFrame = win.getFutureFlipTime(clock="now")
VideoLoopClock.reset(-_timeToFirstFrame) # t0 is time of first possible flip
frameN = -1
# -------Run Routine "VideoLoop"-------
while continueRoutine:
# get current time
t = VideoLoopClock.getTime()
tThisFlip = win.getFutureFlipTime(clock=VideoLoopClock)
tThisFlipGlobal = win.getFutureFlipTime(clock=None)
frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
# update/draw components on each frame
# *VideoLoopText* updates
if VideoLoopT