I am new to Psychopy, and I’m trying to build my first experiment.
The propose of the experiment is to run a movie (let’s say for 15 sec) and while the movie run, the participant can rate the movie as many times he wants. I want to keep track of the rate and the second the participant rate.
For example, if I rate at second 5 the movie as 4, at second 10 I can rate to 5, and so on.
Important to say, the movie needs to run without stops for rating.
I succeed to build an experiment that plays the movie and rate the first number I choose, but once I selected the rate, I cant change it.
Is there an option to run the movie with multiple rating?
Thanks in advance!
Here is the code I did:
Create some handy timers
globalClock = core.Clock() # to track the time since experiment started
routineTimer = core.CountdownTimer() # to track time remaining of each (non-slip) routine
trialComponents = [movie, rating]
for thisComponent in trialComponents:
if hasattr(thisComponent, ‘status’):
thisComponent.status = NOT_STARTED
-------Start Routine “trial”-------
while continueRoutine:
# get current time
t = trialClock.getTime()
frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
# update/draw components on each frame
# *movie* updates
if t >= 0.0 and movie.status == NOT_STARTED:
# keep track of start time/frame for later
movie.tStart = t
movie.frameNStart = frameN # exact frame index
movie.setAutoDraw(True)
# *rating* updates
if t >= 0.0 and rating.status == NOT_STARTED:
# keep track of start time/frame for later
rating.tStart = t
rating.frameNStart = frameN # exact frame index
rating.setAutoDraw(True)
I already check the store history in the advanced tab,
As follow:
But yet, when I run the experiment, I can only choose one rate, when I choose and click the triangle become grey, and I unable to change it.
you can see in the photo below;
In that case I suspect that the data are getting collected at run-time but not saved, because the accept button is not pressed. So to keep your experiment set up this way, and not require people to indicate accept, you’ll need to add a code component, and at the end of the routine add code
Hi, I try to add this to the code, it still not working, I get an empty file.
Only if I change the setting to show accept, and click on rate only at the end of the movie I get all the history rating.
is there any other option to do this?
for thisComponent in trialComponents:
if hasattr(thisComponent, "setAutoDraw"):
thisComponent.setAutoDraw(False)
thisExp.addData('rating.response', rating.getRating())
thisExp.addData('rating.rt', rating.getRT())
thisExp.addData('rating.history', rating.getHistory())
thisExp.nextEntry()
Lets try to get a minimal version working for you, then explore how your experiment differs from one that work for you. The following works for me with PsychoPy 1.85.
make a new experiment
add one ratingscale component
set its advanced settings to:
disable: disappear, force-end-routine, show accept singleclick
enable: store history, store rating, store rating time
no code components, loops, or anything else, just that one trial
save and run, set the marker to a few places, then press return to end the trial. look at the .csv data file. I get values in the data fields for the rating, the rt, and the history