Online? not yet. I entered the code right after the time that you mentioned:
if ‘space’ in keys:
wordNum+=1
thisExp.addData(‘Word’+str(wordNum),t) Exp.nextEntry()
if wordNum==nWords:
continueRoutine=False
and this is the error I receive:
NameError: name ‘Exp’ is not defined
Wow! thank you for sharing
But man, this is so detailed. should i use the free-recall section codes?
Search for Free Recall on Pavlovia for the most recent version (with more comments) but it probably has too much code for you since it allows up to 20 words in two columns in a single page
Thank you but except your experiment, I couldn’t find another free recall task except for a weird smiley face experiment. I will watch some tutorials on YT and hopefully, I can build one editable textbox. Let’s see where it goes
Thanks for bearing with me
I did insert the codes in each routine, but still no difference in the data file. Staircase-wise and cumulative. Same old same old. Thank you anyway
Have you changed the above to thisExp.addData(‘Word’,myClock.getTime()) followed by myClock.reset() ?
If you have then what are you doing to refresh the cache? Sorry, ignore that bit since you’re running it locally. Changes you make should definitely be used so if they aren’t then I have to wonder how you are running the experiment.
I’m in a trial and error phase right now. I’m building the whole thing in PsychoPy, checking, re-checking the data to see how it works
Then, I’m going to push it to Pavlovia by pressing a button. I assume this is how works
Unless, you are an expert in coding and you can figure out what’s wrong by checking the Console and stuff like that. right?
Hi again
The syntax error is solved. Now it’s asking me to define the clock. I have written every code related to clock under
Currently, Each Frame of mine is like this:
if ‘space’ in keys:
wordNum+=1
thisExp.addData(“Word”,myClock.getTime())
myClock=core.Clock()
myClock.reset()
thisExp.nextEntry()
if wordNum==nWords:
continueRoutine=False
Dear @wakecarter,
i know it’s been long, but the question I have is with regard to this discussion, hence, I posed it here. Remember how I wanted the output of the excel to look like this?(previous chat) Well, it appears the very first format works better for data analysis. So i went through the previous codes and I could pull it off and come up with this
But again the RT for each word is recorded in a cumulative way. And look at my code, i did insert the reset code; Idk why this happened: Begin Experiment:
if wordNum>oldWordNum:
phrase+=words[wordNum]+' '
text.text=words[wordNum]
oldWordNum=wordNum
keys=event.getKeys()
if 'space' in keys:
wordNum+=1
thisExp.addData("Word",myClock.getTime())
myClock.reset()
thisExp.nextEntry()
if wordNum==nWords:
continueRoutine=False
What i want is a noncumulative RT for each word. I’d appreciate any helpful comment of yours.
The code you’ve given can’t produce the output you’ve posted. You need the following:
Begin Experiment:
myClock=core.Clock()
# myClock=new util.Clock() on JS side of Both component if you want it to work online
Begin Routine:
words=Sentence.split(' ')
nWords=len(words)
wordNum=0
oldWordNum=-1
phrase=' '
event.clearEvents()
myClock.reset()
win.color = "white" # Does this work online?
# Don't use win.flip() in Builder
Each frame:
if wordNum>oldWordNum:
phrase+=words[wordNum]+' '
text.text=words[wordNum]
oldWordNum=wordNum
keys=event.getKeys()
if 'space' in keys:
wordNum+=1
# Add wordNum to the following line as shown to give each column a unique name.
thisExp.addData("Word"+str(wordNum),myClock.getTime())
myClock.reset()
# Don't use thisExp.nextEntry() if you want data on the same line
if wordNum==nWords:
continueRoutine=False
Thank you @wakecarter,
works perfectly now. But just a quick Q:
thank you kindly for the online tips and tricks. But when I run it with this code of clock it collapses, and the error says: you need to define your clock.
I rummaged PsychoJS but couldn’t find anything. I thought we need to define clocks in begin experiment so I’m totally clueless in this. Any ideas?