Ernesto,
In your code, you are removing the third and second item from the list,
even if it doesn't exist. So you removing the wrong item at times. I
suspect some orders will crash because you are looking for the third
item that doesn't exist or something.
See attached for a better way of doing this that simplifies things as
well. I edited the location for the data file to make it easier for
me--you might look at the GetNewDataFile() function which will simplify
this as well.
On 2020-03-04 03:14, Ernesto Reyes Zamorano wrote:
Hi there:
I'm having trouble with a version of the Limited-Hold Memory Task I'm trying to implement in PEBL. The problem basically is that whenever the correct answer is given, the third answer is not recorded, I first tried this with a 5 item version, and the with the 3 item version I'm attaching to this email.
If the answer is 1-3-2, 2-1-3, 2-3-1, 3-2-1 or 3-2-1 everything runs the way is supposed, but when the correct answer (1-2-3) is given, the program ignores the mouse click. Am I missing something?
Thanks for the great work and your help
--
Dr Ernesto Reyes Zamorano
UAMcS, Facultad de Psicología
Profesor Investigador
erre...@gmail.com
ernesto.rey...@anahuac.mx
56288800 ext. 213
_______________________________________________
Pebl-list mailing list
Pebl-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pebl-list
define Start(p)
{
gSleepEasy <- 1
gVideoWidth <- 960
gVideoHeight <- 720
gwin <- MakeWindow("white")
gSubNum <- GetSubNum(gWin)
gletra <- MakeFont("Vera.ttf", 0, 60, MakeColor("black"),
MakeColor("white"),1)
nombrearch <- "bepalhmt" + gSubNum + ".csv"
addendum <- 0
while(FileExists(nombrearch))
{
nombrearch <- "bepalhmt" + gSubNum + addendum + ".csv"
addendum <- addendum + 1
}
garchivo <- FileOpenAppend(nombrearch)
#crearestimulos
estimulos <- ["1","2","3","4","5","6","7","8","9"]
coordenad <- [[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7],[1,8],
[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7],[2,8],
[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7],[3,8],
[4,1],[4,2],[4,3],[4,4],[4,5],[4,6],[4,7],[4,8],
[5,1],[5,2],[5,3],[5,4],[5,5],[5,6],[5,7],[5,8]]
#secciones <- [gParams.numeromin,gParams.numeromed,gParams.numeromax]
footer <- EasyLabel("",gVideoWidth/2,gVideoHeight-50,gWin,25)
#minimo
contar <- 1
while(contar<10)
{
#items <- ChooseN(estimulos,3)
items <- ["1","2","3"]
coord <- Flatten(SampleN(coordenad,3))
#Poner estÃmulos
coxuno <- Nth(coord,1)
coxdos <- Nth(coord,3)
coxtre <- Nth(coord,5)
coyuno <- Nth(coord,2)
coydos <- Nth(coord,4)
coytre <- Nth(coord,6)
estuno <- MakeTextBox(Nth(items,1),gletra,80,80)
estdos <- MakeTextBox(Nth(items,2),gletra,80,80)
esttre <- MakeTextBox(Nth(items,3),gletra,80,80)
AddObject(estuno,gwin)
AddObject(estdos,gwin)
AddObject(esttre,gwin)
Move(estuno,30+100*coyuno,60+100*coxuno)
Move(estdos,30+100*coydos,60+100*coxdos)
Move(esttre,30+100*coytre,60+100*coxtre)
Draw()
Wait(650)
#quitar estÃmulos y poner cubiertas
RemoveObject(estuno,gwin)
RemoveObject(estdos,gwin)
RemoveObject(esttre,gwin)
tapa1 <- Square(50+100*coyuno,95+100*coxuno,80,MakeColor("black"),1)
tapa2 <- Square(50+100*coydos,95+100*coxdos,80,MakeColor("black"),1)
tapa3 <- Square(50+100*coytre,95+100*coxtre,80,MakeColor("black"),1)
AddObject(tapa1,gwin)
AddObject(tapa2,gwin)
AddObject(tapa3,gwin)
Draw()
objetivos <- [tapa1,tapa2,tapa3]
significa <- [1,2,3]
itemnum <- 1
unclicked <- Repeat(1,3)
responseorder <- []
rts <- []
time0 <- GetTime()
cont <- 1
while(cont)
{
footer.text <- "Click on squares by number"
Print("unclicked:" + unclicked)
Draw()
##Filter the targets and responses based on the objects not yet
clicked:
targets <- Filter(objetivos,unclicked)
output <- Filter(significa,unclicked)
loop(targ,targets)
{
AddObject(targ,gWin)
}
Draw()
##Get the response, but only from the unclicked targets
respondio <- WaitForClickOnTarget(targets,output)
time1 <- GetTime()
##Mark the clicked target as clicked.
PushOnEnd(responseorder,respondio)
PushOnEnd(rts,(time1-time0))
SetElement(unclicked,respondio,0)
RemoveObjects(targets,gWin)
##Stop when we have clicked on everything.
if(Sum(unclicked)==0)
{
cont <- 0
}
}
##Print out trial data
Print(Flatten([gSubNum,responseorder,rts]))
footer.text <- "Press any key to continue"
Draw()
contar <- contar + 1
WaitForAnyKeyPress()
}
}
_______________________________________________
Pebl-list mailing list
Pebl-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pebl-list