Hello:)
I’m new to PsychoPy and have close to zero knowledge about coding.
What are you trying to achieve?:
In my experiment I would like to skip some routines when a certain excel cell in my trial sheet contains an “XXXXX”, using an “if” JAVA script.
I couldn’t figure out how to direct the script to read the desired excel column.
What did you try to make it work?:
Tryin to avoid referencing the excel column directly from the script, I added a text component that accesses this column and displays its text (for 0s). Then I tried to reference the text component using this code:
if (text_12 === “XXXXX”) {
continueRoutine = false;
}
*I copied this “if” code from another part of the experiment, where it worked well referencing a keyboard response. It is located in the “each frame” tab in a code component.
I guess it isn’t written correctly because when trying to pilot the experiment on Pavlovia I got the following error message:
Thank you for your reply!
What is an Auto component?
I tried using your code but Pavlovia keeps showing me the same error message.
How would the program know I’m referencing a name of an excel column in this case? Is every column in my trials sheet already considered a variable automatically or do I need to define it first?
You are showing me Python code in a JavaScript code component. Please copy the code to the clipboard and then paste it into the Python side on auto components
I finally managed to locate my problem, it doesn’t have anything to do with the current code! apparently all the changes I kept making on psychopy didn’t get updated on pavlovia!
Thank you so much for your help dealing with JS!!
Right now I’m seeing a different problem
Some of the routines with this code are not getting skipped, and others (using the same code but referencing a different column) lead to displaying “Hello World” instead of skipping. (I’m pretty sure that the “hello world” is showing in place of a these routines that should be skipped).
Needless to say there is no hello world in my sheet, and I searched “hello world” in my code in pavlovia with 0 results.
This is the code as you guided me to use it. It is used for skipping routines for items 9 and 10, and I have the same code with column “CondL” for skipping different routines for items 7 and 8 (containing the blank word cells). Both routines aren’t skipped when needed to.
I can’t immediately see any issues. If you are using a recent version then the code should also work in Begin Routine but in Each Frame it should be fine apart from perhaps displaying Hello World briefly.
You should add print(‘CondF’,CondF) just before the if statement and print(‘Skipping now?’) within it to narrow down which bit is failing. Are you doing anything to modify CondF before it gets checked?