Cool.
Please could you highlight the code that sets the player2 decision for the first trial and then the code that sets it for subsequent trials?
Cool.
Please could you highlight the code that sets the player2 decision for the first trial and then the code that sets it for subsequent trials?
Ok so from what I have highlighted here, you see that the first decision for player2 is set at “c” so that’s why there is no issue there. The problem arises when JS tries to read my if-then contingencies from round 2 on, which are dependent up what is currently in the outcomes list and what number compcoop is. This whole contingency process works correctly in Python but JS is having trouble reading my variables I think.
I’ve never used an expression of the form if x == [“y”]. I would recommend trying if x[0] == “y”
Nice ok so this worked for the round 2 contingency! However, the subsequent contingencies still don’t work correctly, the ones right under the highlighted portion of the image I sent you. I’m wondering if JS is having problems slicing the list. When I remove the brackets, the code is logging both player1 and player2 responses, however player2 response does not follow the contingency and defaults to “d” after a couple rounds.
What’s your slice code and what is it intended to do?
I’ve highlighted the beginning of the code block but they all function in the same way. Essentially, for the rest of the rounds player2 is supposed to make a decision based on the previous 2 outcomes of the game. This necessitates slicing the last 2 outcomes from the list then generating a response based on the compcoop value and those last 2 outcomes together.
I suspect that the slice is working but not the test for equality.
You could use
if list[-2]==x and list[-1]==y:
Ok yes this is finally working! Seems like PsychoPy has a hard time translating some of the Python specific code I suppose? I only made the edits to the practice game participants play before the full game so I will go ahead and make the edits to the full game to ensure everything is operating smoothly and let you know. I am tremendously grateful for your help over the past month or so and once again my advisors and I have already talked about including you in acknowledgements as well as an author for eventual publication down the line.
Ok the task is now fully operational! What is your email so I can send you a copy of my dissertation proposal for reference? I will keep in touch as data collection and analysis proceeds over the coming year. Have a great summer Wake and thank you again!
Hey Wake hope you are doing well. Unfortunately I come to you with another question but luckily not about the computer algorithm for the task. I had not let the task run all the way to conclusion the last time we talked and when piloting with a labmate today, when the final screen concluded (it runs on a timer, no key needs to be pessed), I received this error.

I ran it a couple more times and this error was generated every time at the end of the task. When taking a look at the task in Developer mode I saw this error.

Have you ever seen this error before? This is preventing me from actually logging complete experiments and it looks like Pavlovia doesn’t save “incomplete” results for the version of PsychoJS I am using.
That looks very much like the error caused by an earlier version of my crib sheet.
Do you mean that code_JS didn’t contain the.upper code or removing it didn’t help? If the latter then it’s probably a cache issue. The rest of your code_JS looks fine.
Do you have any other code that might be causing a similar issue (probably in JS or Both components rather than auto translate)?
Removing it didn’t help. And no I don’t think so, but I can send some pics if needed. The rest of the code is either setting global variables for Python and JS or configuring the computer algorithms response to the participant.
Hey Wake, I figured out the problem, it seemed to be this if-then contingency for PsychoJS that triggers at the end of the experiment. When I removed it the task terminated successfully. I don’t remember inserting it so it might be something that is done automatically? Is this something I would need to figure out if I want participants to be able to play the task on their phones?
There are no automatic insertions into optional code components. Have you tried deleting the offending code?
Yes I already did this and it worked, the task is now running to completion. I’m still not sure how the code got there but I will keep a copy in case I need to figure out how to run the task on mobile. Thank you.
URL of experiment: https://run.pavlovia.org/Sycheva_Varvara/faceregtest21april
Hi I also encountered similar problem. I keep getting this error message when trying to Pilot my test in Pavlovia.
The code could run in the Psychopy Builder. Unfortunately we couldn’t bring it online for Pilot.
We encountered the following error:
I already added .jpg in all files name, and not sure what to do anymore. I also already convert the conditions excel file into csv. Could you help me please?
From my crib sheet.
Use experiment settings (cog image ) > online > +/- keys to add the list of resources your experiment will need.
Hello,
Thank you so much for the sheet and your reply.
I am sorry, I am not fully understand. Is the experiment setting is a feature we can edit in Pavlovia? Or you mean something else.
Thank you.