Unknown Resource Error Pilot Test

Ok downloading now.

Ok I have it downloaded. These are the screenshots of both pieces of code.

Does this look right?

You need to do something in the Python side of your Auto block to wake up the auto translate. The translation should appear in the JS side.

Delete the import commands and the random seed section. I’m guessing you come from a MATLAB background. Python and JavaScript both seed randomly by default.

Are you using random, math or time elsewhere? If so, you’ll need to rewrite your Python code.

Thank you after I removed the import command and random seed sections the code did translate. However I do use the random function in some other sections of the task, how would I trigger this now?

image

Here is what it looks like.

random()*100 is I believe the same as your random uniform command.

Your code component is showing as Py not Auto.

Have you seen randint on my crib sheet?

Yes, does randint also select the number from a uniform distribution of values?

Also this is what I receive now when I leave the random function untouched, would this work? I believe it only converted the round function to Java but I’m not certain.

Please have a read through my crib sheet.

I think you want randint (which is a uniform distribution) but you’ve also missed that all loops in JS have to be addressed as trials

Ok so it should be something like this? I am not seeing it translating the randint function.

Also, when you state do not use a $ for specifying a variable for nReps, this would mean I would just remove the $ for all loops like the one below?

image

Remove the dollar sign

Remove random. from randint

Ok thank you that fixed it. So my last question is for this last piece of code in the same component. It also won’t translate and I’m not sure what needs to be edited. These are the two primary sections of code. Thank you so much for your help btw.

Nevermind I figured this out. I will be testing running it in a minute.

By “it won’t translate “ what do you mean? It looks like you haven’t clicked into the Python side to activate the translation

Yes I realized it after I had sent the message. So a first run through on my desktop crashed when it tried to close my practice game loop, which had initially been named “pracloop”. It says “trials” isn’t defined. I have another game loop in the task and both loops can’t be named trials so how would I work around this? Or can this version of the task only work through Pavlovia and Javascript?

After you’ve done the auto translation switch auto to both and change the loop names to trials in the JS side only

Thank you. I have made additional adjustments to the task based on your crib sheet and now when I run the task the visual stimuli are pulled from the excel file now! The only issue is that the event.clearEvents() function isn’t clearing my previous responses for the game. Is event.clearEvents() supposed to translate into something else when in JS format?

clearEvents just clears the keyboard buffer.

Do you have a bunch of variables that need to be reset in Begin Routine?

No just one keyboard response from the participant for every round of the game.

Here is what it looks like (key_decision is the name of the keyboard response component).

Well hold on, there are a couple of other variables but the issue primarily seems to be with resetting the keyboard response.

Is the problem that the routine starts as soon as the previous routine has finished and therefore the key is still pressed. Do you have an ISI to allow the participant to lift their finger?

Yes my “ISI” periods are points in which the participant is anticipating a response from their partner.

Taking a look at the flowchart at the bottom of the image, decisions are made in the “DecisionPrac” routine of the loop, then one of the “Anti” loops is triggered and one of the “Feed” loops is triggered, all sequentially, before returning to DecisionPrac.