Im trying to set the coder to tell participants to do the same trial again if they didn’t get 80% correct and do tell participants what their percentages were during the trial. I have written this code and was wondering if anyone can check:
if its correct
if im missing anything
how to add into the text the percentage the participants got
You seem to be using CorrResp as both an array to store the scores for each trial and the trials themselves. You are also then comparing this array with a number.
The easiest way to calculate the proportion of correct responses is to have two numeric variables: one that increments every trial and one that only increments on a correct response.
Hi, thanks for your help so far its been really helpful. I implemented the code you said but im getting a CorrResp is not defined unless I add it above the nTrials section but if I do it doesn’t stop you if you get less than 80% correct it just lets you carry on.
Also, how to I tell participants how many they got right? Like what code is needed in the sentence to tell them this is the percentage of correct scores?
Now you’ve shown more of you code, I can see that you don’t need CorrResp at all. Just put nCorrect += 1 in the line below where you save CorrResp to the data file. (line 3 of your code in the image).
nCorrect = 0 and nTrials = 0 needs to go before your trials loop starts.