Commit 81b24349 authored by Rebecca's avatar Rebecca

clear response box online

parent aa204fc6
......@@ -345,6 +345,7 @@ function feedbackRoutineBegin(snapshot) {
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
//small fix to access text in the textbox online
if ((textbox._pixi.text === corrAns)) {
thisFeedback = "Correct!";
} else {
......@@ -353,6 +354,8 @@ function feedbackRoutineBegin(snapshot) {
trials.addData("correctAns", thisFeedback);
psychoJS.experiment.addData('textbox.text', textbox._pixi.text);
//reset the text in the textBox
textbox._pixi.text = 'Type a response'
feedbackText.setText(thisFeedback);
// keep track of which components have finished
feedbackComponents = [];
......
......@@ -353,6 +353,7 @@ function feedbackRoutineBegin(snapshot) {
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
//small fix to access text in the textbox online
if ((textbox._pixi.text === corrAns)) {
thisFeedback = "Correct!";
} else {
......@@ -361,6 +362,8 @@ function feedbackRoutineBegin(snapshot) {
trials.addData("correctAns", thisFeedback);
psychoJS.experiment.addData('textbox.text', textbox._pixi.text);
//reset the text in the textBox
textbox._pixi.text = 'Type a response'
feedbackText.setText(thisFeedback);
// keep track of which components have finished
feedbackComponents = [];
......
......@@ -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._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 JS Routine" updates="constant" val="//small fix to access text in the textbox online&amp;#10;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;&amp;#10;//reset the text in the textBox&amp;#10;textbox._pixi.text = 'Type a response'" 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