Thanks @dvbridges! that got rid of the error!
I have two further questions:
- For randomization purposes, I have a couple of .csv files with different trial lists. At the beginning of my experiment, I randomly pick one of these .csv files with a code component (written both in Python and Java). Here’s the java snippet:
// Begin Experiment
function random_character() {
var chars = "ABCD";
return chars.substr( Math.floor(Math.random() * 2), 1);
}
condition = random_character();
Then, in the “condition” box of my main routine, I load the corresponding .csv file:
'design_' + $condition + '.csv'
When running in PsychoPy, this works fine. However, when I try to export, I get the following error:
Traceback (most recent call last):
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 1682, in fileExport
target="PsychoJS")
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 2242, in generateScript
else:
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 51, in compileScript
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 201, in writeScript
self.settings.writeInitCodeJS(script, self.psychopyVersion, localDateTime, modular)
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\components\settings\__init__.py", line 497, in writeInitCodeJS
self.prepareResourcesJS()
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\components\settings\__init__.py", line 486, in prepareResourcesJS
resourceFiles = self.exp.getResourceFiles()
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 790, in getResourceFiles
condsPaths = findPathsInFile(params['conditionsFile'].val)
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 743, in findPathsInFile
filePath = eval(filePath)
File "<string>", line 1
'Block_' + $condition + '.csv'
^
SyntaxError: invalid syntax
I get that the way of calling the condition variable is not working, but, any ideas on how to properly call it?
- If my .psyexp file is in a different drive from C:, then I get the following error when trying to import to html (the experiment runs in psychopy smoothly):
Traceback (most recent call last):
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 1682, in fileExport
target="PsychoJS")
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 2242, in generateScript
else:
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 51, in compileScript
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 201, in writeScript
self.settings.writeInitCodeJS(script, self.psychopyVersion, localDateTime, modular)
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\components\settings\__init__.py", line 497, in writeInitCodeJS
self.prepareResourcesJS()
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\components\settings\__init__.py", line 486, in prepareResourcesJS
resourceFiles = self.exp.getResourceFiles()
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 801, in getResourceFiles
thisFile = getPaths(thisParam.val)
File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 722, in getPaths
thisFile['rel'] = os.path.relpath(filePath, srcRoot)
File "C:\Program Files (x86)\PsychoPy3\lib\ntpath.py", line 586, in relpath
path_drive, start_drive))
ValueError: path is on mount 'C:', start on mount 'H:'
If I copy the folder of the experiment to C:, then I can convert to html just fine, but I was wondering if it would be possible to convert from different drives…
Thanks!