How do I get the lines to disappear after each trial?
Also, I downloaded this task from Pavlovia. I want to make another task where participants only select from A → B → C → etc., but I cannot find where in the code the stimuli A, B, C, 1, 2, 3, etc. is defined. I do not see where I can edit the A, B, C, 1, 2, 3. Please help. Thank you in advance.
if len(shapeList):
for line in shapeList:
line.setAutoDraw(False)
JS
if (shapeList.length) {
for (var line, _pj_c = 0, _pj_a = shapeList, _pj_b = _pj_a.length; (_pj_c < _pj_b); _pj_c += 1) {
line = _pj_a[_pj_c];
line.setAutoDraw(false);
}
}
The order is hard coded in the Each Frame code, but you need to scroll to the right to see it. There are a set of trial steps which look for the distance from trialTarget positions in order.
When I make the condition in the Excel file ABCDEFG, the circles show up with the proper labels in them, but it does not register when I hover over the circles and it does not make the lines.
When I try to make the condition in the Excel file 12345678 I get the error:
I’ve sorted the error with just numbers, but I’m not sure why you had an issue with just letters. It works when I test it (my demo now has a letters and a numbers trial).
Hi. My team and I are trying to measure how long it takes for a participant to complete these trials. Could you help with implementing this? The only measure we need is the time it takes to complete each trial. Thanks so much in advance.
If all of your sequences are the same length, then you should already have this in the final RTstep column. However, if you want to remove this data saving and only save on the final step then your Each Frame code should be:
CursorTargetDistance = sqrt((trialCursor.pos[0]-trialTargets[trialStep].pos[0])**2 + (trialCursor.pos[1]-trialTargets[trialStep].pos[1])**2)
if (CursorTargetDistance < .05):
trialTargets[trialStep].setOpacity(0)
if trialStep > 0:
# Create new line
shapeList.append(visual.ShapeStim(
win=win, name="line"+trialStep,
lineColor=white,
lineWidth=2,
vertices=[[posArray1[trialStep-1],posArray2[trialStep-1]],[posArray1[trialStep],posArray2[trialStep]]],
))
shapeList[-1].setAutoDraw(True)
trialStep += 1
# End routine when last target located
if trialStep == len(targetList):
thisExp.addData('RT',round(t*1000))
continueRoutine = False