Hello,
I wrote some code in python so that my program will create an array of the participants points and will look at the last 20 points (+1/-1) in the array, sum them, and divide by 20 to see if they’ve reached 80% correct in their last 20 trials so they can move to the next task.
However, I am having a lot of issues getting this to work when uploaded to pavlovia.
At first it was giving me trouble with the .append command for my array, so I have changed this to .push (the JS equivalent). This helped.
Now it is not recognizing the .sum command in python. I am having a hard time with this part. I’m seeing how I could sum in JS with the lodash function, but I’m not sure how to do this so it only adds the last 20 points and not the entire array? Any help would be greatly appreciated! Code below.
Thanks!