Thanks so much! I watched the video and it seems like exactly what I would like!
I’m now trying to implement it in an experiment. I’ve done so by having multiple Excel files (i.e., one for each condition). Then in my loop, I have it set to choose a specific Excel file based on the group number. To do this, I have code at the beginning of the experiment like this:
theGroup = expInfo["Group"]
And them in my Loop, the conditions file is called:
$"Group" + theGroup + ".xlsx"
This works great when I run it on my computer, but when I try to upload it to Pavlovia, I get this error. It seems like it doesn’t like only having Group defined when a person begins the experiment? Do you have any advice on how to handle this (with the eventual goal of then interfacing with VESPR)?
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 829, in findPathsInFile
File “<string>”, line 1, in <module>
NameError: name ‘theGroup’ is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 121, in _validate_archive
File “zipfile.pyc”, line 1131, in __init__
File “zipfile.pyc”, line 1198, in _RealGetContents
zipfile.BadZipFile: File is not a zip file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1344, in onPavloviaSync
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 793, in fileExport
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 74, in generateScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 247, in compileScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 219, in _makeTarget
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 254, in writeScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/flow.py”, line 309, in writeFlowSchedulerJS
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 877, in getResourceFiles
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 843, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 860, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py”, line 365, in importConditions
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 174, in load_workbook
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/openpyxl/reader/excel.py”, line 124, in _validate_archive
File “zipfile.pyc”, line 1131, in __init__
File “zipfile.pyc”, line 1198, in _RealGetContents
zipfile.BadZipFile: File is not a zip file
It would also be nice to be able to have one Conditions file, and present a subset of rows based on Group Number (i.e., instead of having multiple conditions files). I wonder if this is possible?
I’ve tried doing something like this. Having this code run before the experiment:
theGroup = expInfo["Group"]
conditions = data.importConditions(Conditions.xlsx’)
Group1 = conditions[0:3]
Group2 = conditions[4:7]
And then, in my loop, setting Selected rows to: $"Group" + theGroup
But it doesn’t seem like this is correct.