Commit c3b3c067 authored by Rebecca's avatar Rebecca

JS fix

parent d041d0d8
......@@ -345,12 +345,13 @@ function feedbackRoutineBegin(snapshot) {
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
if ((textbox._text === corrAns)) {
if ((textbox._pixi.text === corrAns)) {
thisFeedback = "Correct!";
} else {
thisFeedback = "Incorrect";
}
trials.addData("correctAns", thisFeedback);
psychoJS.experiment.addData('textbox.text', textbox._pixi.text);
feedbackText.setText(thisFeedback);
// keep track of which components have finished
......
......@@ -353,12 +353,13 @@ function feedbackRoutineBegin(snapshot) {
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
if ((textbox._text === corrAns)) {
if ((textbox._pixi.text === corrAns)) {
thisFeedback = "Correct!";
} else {
thisFeedback = "Incorrect";
}
trials.addData("correctAns", thisFeedback);
psychoJS.experiment.addData('textbox.text', textbox._pixi.text);
feedbackText.setText(thisFeedback);
// keep track of which components have finished
......
......@@ -118,7 +118,7 @@
<Param name="Before JS Experiment" updates="constant" val="" valType="extendedCode"/>
<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="if ((textbox._text === corrAns)) {&amp;#10; thisFeedback = &quot;Correct!&quot;;&amp;#10;} else {&amp;#10; thisFeedback = &quot;Incorrect&quot;;&amp;#10;}&amp;#10;trials.addData(&quot;correctAns&quot;, thisFeedback);&amp;#10;" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="if ((textbox._pixi.text === corrAns)) {&amp;#10; thisFeedback = &quot;Correct!&quot;;&amp;#10;} else {&amp;#10; thisFeedback = &quot;Incorrect&quot;;&amp;#10;}&amp;#10;trials.addData(&quot;correctAns&quot;, thisFeedback);&amp;#10;psychoJS.experiment.addData('textbox.text', textbox._pixi.text);&amp;#10;" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="if textbox.text == corrAns:&amp;#10; thisFeedback = 'Correct!'&amp;#10;else:&amp;#10; thisFeedback = 'Incorrect'&amp;#10;&amp;#10;trials.addData('correctAns', thisFeedback)" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Both" valType="str"/>
<Param name="Each 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