Commit d041d0d8 authored by Rebecca's avatar Rebecca

JS translation

changes .text to ._text
parent df5aa34f
corrAns,trials.thisRepN,trials.thisTrialN,trials.thisN,trials.thisIndex,textbox.text,textbox.started,textbox.stopped,endButton.started,endButton.stopped,mouse.x,mouse.y,mouse.leftButton,mouse.midButton,mouse.rightButton,mouse.time,mouse.clicked_name,mouse.started,mouse.stopped,correctAns,feedbackText.started,feedbackText.stopped,participant,session,date,expName,psychopyVersion,frameRate,
correct response,0,0,0,0,Type a reponse,13.093016300001182,None,13.093016300001182,None,-0.16875,-0.4025,1,0,0,0.9466373999894131,endButton,0.010306340060196817,None,Incorrect,14.018591000000015,None,,001,2020_Oct_20_0914,textBoxDemo,2020.2.4,60.16267988194094,
5.4558 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
10.3276 WARNING Requested an unavailable screen number - using first available.
12.0737 EXP Created window1 = Window(allowGUI=True, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color=array([0., 0., 0.]), colorSpace='rgb', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x000001A1DCC07438>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x000001A1DC856748>, multiSample=False, name='window1', numSamples=2, pos=[320.0, 200.0], screen=1, size=array([1280, 800]), stencilBits=0, stereo=False, units='height', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
12.0739 EXP window1: mouseVisible = True
12.0739 EXP window1: recordFrameIntervals = False
12.2395 EXP window1: recordFrameIntervals = True
12.4240 EXP window1: recordFrameIntervals = False
12.5934 ERROR Unknown colorSpace: named
12.9754 EXP Created endButton = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='endButton', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text='Click here to continue', units='height', win=Window(...), wrapWidth=1)
12.9755 EXP window1: mouseVisible = True
12.9887 EXP Created feedbackText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.1, italic=False, languageStyle='LTR', name='feedbackText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='default text', units='height', win=Window(...), wrapWidth=1)
13.0185 EXP Imported conditions.xlsx as conditions, 1 conditions, 1 params
13.0188 EXP Created sequence: random, trialTypes=1, nReps=3, seed=None
13.0190 EXP New trial (rep=0, index=0): OrderedDict([('corrAns', 'correct response')])
13.0930 EXP textbox: autoLog = True
13.0930 EXP textbox: text = 'Type a reponse'
13.0930 EXP textbox: autoDraw = True
13.0930 EXP endButton: autoDraw = True
13.9932 DATA Mouse: Left button down, pos=(505,78)
14.0186 EXP textbox: autoDraw = False
14.0186 EXP endButton: autoDraw = False
14.0186 EXP feedbackText: text = 'Incorrect'
14.0186 EXP feedbackText: autoDraw = True
14.0616 DATA Mouse: Left button up, pos=(505,78)
15.0108 EXP New trial (rep=1, index=0): OrderedDict([('corrAns', 'correct response')])
15.0260 EXP feedbackText: autoDraw = False
15.0260 EXP textbox: text = 'Type a reponse'
15.0260 EXP textbox: autoDraw = True
15.0260 EXP endButton: autoDraw = True
16.2623 DATA Keypress: escape
16.3661 EXP window1: mouseVisible = True
......@@ -345,7 +345,7 @@ function feedbackRoutineBegin(snapshot) {
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
if ((textbox.text === corrAns)) {
if ((textbox._text === corrAns)) {
thisFeedback = "Correct!";
} else {
thisFeedback = "Incorrect";
......
......@@ -353,7 +353,7 @@ function feedbackRoutineBegin(snapshot) {
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
if ((textbox.text === corrAns)) {
if ((textbox._text === corrAns)) {
thisFeedback = "Correct!";
} else {
thisFeedback = "Incorrect";
......
......@@ -118,9 +118,9 @@
<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._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 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="Auto-&gt;JS" valType="str"/>
<Param name="Code Type" updates="None" val="Both" 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"/>
......
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.4),
on October 19, 2020, at 21:24
on October 20, 2020, at 09:14
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)
......@@ -271,6 +271,7 @@ for thisTrial in trials:
continueRoutine = True
routineTimer.add(1.000000)
# update component parameters for each repeat
print(dir(textbox))
if textbox.text == corrAns:
thisFeedback = 'Correct!'
else:
......
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