OS : MacOS Catalina
PsychoPy version : 2020.2.10
**Standard Standalone?: yes
URL of experiment: New_Cinema_Expe [PsychoPy]
What are you trying to achieve?:
I am designing an experiment where participants are shown video clips and have to click a mouse whenever they spot a continuity edit. I’ve marked these moments by adding a polygon of 1 second duration (starting slightly before and finishing slightly after the continuity edit). This enables me to see if participants have clicked around the moment of interest (polygon) or simply on the movie clip at a different moment. As part of the training for the experiment, I am including feedback within a trial loop as shown below. In the loop, participants view 12 short movie clips (of a few seconds long) in which there are either
a. no continuity edit (correct response is to not click) or
b. continuity edits (correct response is to click on the polygon).
The feedback code uses the output column ‘respTrain.clicked_name’ and the column ‘corrAns’ from my conditions file as shown below.
In ‘Begin Experiment’, I’ve put
In ‘Begin Routine’ I’ve put
if respTrain.clicked_name==corrAns: msg = "Correct!" msgcolor='green' else: msg = "Incorrect!" msgcolor='red'
Description of the problem:
The feedback (as shown above) works correctly offline but doesn’t work when pushed to Pavlovia. There is no error message and everything seems to run fine except that the feedback is always ‘Incorrect!’ and when I look at the Output .csv file, the corrAns column is empty, so nothing from corrAns is being printed out.
What did you try to make it work?:
I understand the issue has to do with my two variable columns (corrAns and respTrain.clicked_name) not having the same format in PsychoPy and PsychoJS, which means they do not match.
Following a suggestion from another thread (https://discourse.psychopy.org/t/correct-answer-not-registered-in-online-experiment/13453/2) I first tried converting the ‘respTrain.clicked_name’ column to a string with the code
if respTrain.clicked_name.toString()==corrAns: msg = "Correct!" msgcolor='green'
and changing the ‘corrAns’ variable in my excel file from [“polygonTrain”, “trainClips”] to polygonTrain, trainClips as that is how it should come out after converting to a string. This successfully printed the corrAns column in the output file but did not match the mouse column, so the feedback still wasn’t correct.
I then tried using the ‘split function’ to convert the corrAns variable into two strings using ‘,’ ‘;’ and ‘_’ in my conditions file (e.g. polygonTrain_trainClips instead of [“polygonTrain”, “trainClips”]) and adding a split function in the code in Begin Routine which printed corrAns successfully in the output file but still does not match the format of respTrain.clicked_name so the feedback still only appears as ‘Incorrect!’.
I would very much appreciate any pointers on how to proceed if anyone has run into the same problem. I must add that I am new to both coding and PsychoPy so am sure that there is a lot I am not understanding.
Many thanks in advance for any help!