It would take the first entry if you selected sequential. However, more importantly this suggests that you are selecting row 0 in the wrong way. Try 0:1 (IIRC)
So when I tried selecting the row that way, 0:1, this works on my desktop, but when I try to pilot this through Pavlovia I get a new error message about one of my variables.
This doesn’t make sense because the “rounds” variable was never edited. Not sure what happened.
Just put rounds=0 in Begin Experiment
Getting that error means you’ve now got further through the code
I still receive the same error. This is what the code looks like.
That’s a Python code component with several imports, which means:
- It isn’t being translated to JS
- Your experiment will fail to initialise if you simply switch this component to Auto translate.
Do you have any idea why it would fail to translate? I thought it would already be compatible since Pavlovia primarily hosts PsychoPy experiments, many of which I am assume include user-generated code. The portion of code above is initiated at the beginning of the experiment, yet I am able to progress through my text-based instruction slides before I run into the error right before the program tries to pull the first visual stimulus.
Python only blocks shouldn’t cause an error online because they don’t exist?
So if I can switch off auto-translate that may somehow fix the issue? How would I do this?
Sorry, the opposite. You need to switch on auto translate and then find other ways to deal with random, etc
Take a look at my crib sheet (search the forum to find the link)
So as an example, if I am using the thisExp command and calling the method addData (ex. thisExp.addData(“seed_number”, newSeed), would this be changed to psychoJS.experiment(“seed_number”, newSeed) in my code component in PsychoPy?
That’s one way, but unnecessary if you implement code_JS as indicated in my crib sheet. (also you missed.addData in your JS translation)
Ok from the document itself it’s not clear to me how it would be implemented, is there a step-by-step write up?
Create a code component in your first routine.
Switch it to JS and (optionally) call it code_JS
Copy and paste code from the JS column of the code_JS section of my crib sheet as necessary. The elements in bold are ones I find particularly useful.
If the above is the kind of level of steps you meant then I’ll add them to it tomorrow.
Yes this is perfect. When adding the JS code component none of the Python code components should be removed correct?
This is an extra component . Most components should be set to auto
Where would I find the auto function?
The code type drop down menu on your screenshot, so long as you are using a 2020 version of PsychoPy
My drop done menu only has Py, JS, or Both as options. I think you can update PsychoPy somewhere in the application, hold on.
It says I’m running a version (3.2.4) ahead of the latest version (3.2.2). How can this be?
3.2.4 is the final pre auto version
You should upgrade to 2020.1.3