added comments

parent 32d73462
......@@ -454,13 +454,13 @@ function trialRoutineBegin(snapshot) {
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
thisA = listA.pop();
thisExp.addData("thisA", thisA);
shuffle(sides);
if ((sides[0] > 0)) {
corrAns = "right";
} else {
corrAns = "left";
}
thisExp.addData("thisA", thisA);
thisExp.addData("Answer", corrAns);
text_letter.setPos([sides[0], 0]);
......
......@@ -461,13 +461,13 @@ function trialRoutineBegin(snapshot) {
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
thisA = listA.pop();
thisExp.addData("thisA", thisA);
shuffle(sides);
if ((sides[0] > 0)) {
corrAns = "right";
} else {
corrAns = "left";
}
thisExp.addData("thisA", thisA);
thisExp.addData("Answer", corrAns);
text_letter.setPos([sides[0], 0]);
......
......@@ -39,15 +39,15 @@
<Param name="Before JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Experiment" updates="constant" val="sides=[-.3,.3]&amp;#10;corrAns=''&amp;#10;score = 0" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="sides = [(- 0.3), 0.3];&amp;#10;corrAns = &quot;&quot;;&amp;#10;score = 0;&amp;#10;" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="thisA = listA.pop();&amp;#10;shuffle(sides);&amp;#10;if ((sides[0] &gt; 0)) {&amp;#10; corrAns = &quot;right&quot;;&amp;#10;} else {&amp;#10; corrAns = &quot;left&quot;;&amp;#10;}&amp;#10;thisExp.addData(&quot;thisA&quot;, thisA);&amp;#10;thisExp.addData(&quot;Answer&quot;, corrAns);&amp;#10;" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="thisA=listA.pop()&amp;#10;shuffle(sides)&amp;#10;if sides[0]&gt;0:&amp;#10; corrAns='right'&amp;#10;else:&amp;#10; corrAns='left'&amp;#10;thisExp.addData('thisA',thisA)&amp;#10;thisExp.addData('Answer',corrAns)&amp;#10;" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="thisA = listA.pop();&amp;#10;thisExp.addData(&quot;thisA&quot;, thisA);&amp;#10;shuffle(sides);&amp;#10;if ((sides[0] &gt; 0)) {&amp;#10; corrAns = &quot;right&quot;;&amp;#10;} else {&amp;#10; corrAns = &quot;left&quot;;&amp;#10;}&amp;#10;thisExp.addData(&quot;Answer&quot;, corrAns);&amp;#10;" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="# Select and record a value for listA&amp;#10;thisA=listA.pop()&amp;#10;thisExp.addData('thisA',thisA)&amp;#10;&amp;#10;# Select and record correct answer&amp;#10;shuffle(sides)&amp;#10;if sides[0]&gt;0:&amp;#10; corrAns='right'&amp;#10;else:&amp;#10; corrAns='left'&amp;#10;thisExp.addData('Answer',corrAns)&amp;#10;" 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="score += key_resp.corr;&amp;#10;" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="score+=key_resp.corr" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="# Keep a tally of the score&amp;#10;score+=key_resp.corr" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="code" valType="code"/>
</CodeComponent>
......@@ -125,7 +125,7 @@
<Param name="Begin Experiment" updates="constant" val="listA=[]" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="listA = [];&amp;#10;" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="listA.append(Number.parseInt(colA).toString());&amp;#10;" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="listA.append(str(int(colA)))" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="listA.append(str(int(colA)))&amp;#10;# Use listA.append(colA) if colA is text&amp;#10;&amp;#10;# Note that in this case loading_loop&amp;#10;# is using rows 0:10 and has nReps = 3&amp;#10;# to make a list of 30 numbers. If&amp;#10;# colA and colB have the same length or&amp;#10;# come from different spreadsheets, use&amp;#10;# rows should be blank with nReps = 1" 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"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment