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?
Auto translation of Python to JavaScript is new this year
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