The editor displays “Too many errors. (7% scanned).”.
Additionally, from line 84 to line 95 there are some remarks that some variables have to be written in “dot notation” which they actually are:
var frameDur;
function updateInfo() {
expInfo['date'] = util.MonotonicClock.getDateStr(); // add a simple timestamp
expInfo['expName'] = expName;
expInfo['psychopyVersion'] = '3.0.3';
// store frame rate of monitor if we can measure it successfully
expInfo['frameRate'] = psychoJS.window.getActualFrameRate();
if (typeof expInfo['frameRate'] !== 'undefined')
frameDur = 1.0/Math.round(expInfo['frameRate']);
else
frameDur = 1.0/60.0; // couldn't get a reliable measure so guess
The code works perfectly in PsychoPy 3.0.3, so I do not know how to solve it. Hope you have any suggestions.
Fabian
Not sure why you think this is an error, it looks ok to me. text_13 is variable name assigned to one of your text objects. The first problem to solve for your online experiment will be to use relative paths for your image files, rather than absolute paths. So, relative to your experiment (unless you have stim folders):
'C:\\Users\\Fabian Müller\\Desktop\\Python\\Decode_non-monetary\\Example.png'
#should become
'Example.png'
Also, if you do have subfolders, you may want to use forward slashes in your paths, as this is best for cross platform functionality. Give that a go and let us know.
thanks for the advise. I have changed the absolute paths to relative once, e.g. Example.png. My stim material and the condition files are stored in the resources folder which is automatically generated when a psyexp file is exported to a html directory. Thus, am I correct that I do not have to set the relative path to resources/Example.png?
Unfortunately, the link to my experiment is still not working. Attached, there is a screenshot of the possible failure of var text_13:
The images should be found without the need for the “resources” folder entry in your path.
Ok, I think this may be an error where the filename of your psyexp file is not matching your experiment name. Your html file is looking for a JavaScript file called “ID.js”, which has been set by your experiment name in the experiment settings, but your actual JavaScript experiment file has the same name as your .psyexp file, albeit with a different extension. This is an error that is popping up that needs to be resolved, but for now, if you could make sure your experiment name in the Experiment Settings dialog matches your filename of your psyexp file, and resync and try again.
I notice now you have the ‘use prefs’ error - this was fixed in 3.0.4 but you can easily fix this yourself by changing your default units of your screen from “use prefs” to whichever units you prefer (I would use “height”). You can do this in the experiment settings dialog.
Perfect, that works! The name of the experiment in Psychopy does not match to the .psyexp file name. I have changed it, resynced it and finally it worked! (https://pavlovia.org/run/FabMue/decodetask_nm/html/) Thanks for you help.
One error seems to persist. After starting the session, the following description appears:
Do I have to manually covert all pos=(X,Y) in text components, textstims and so on into pix=(X,Y)?
One more question:
During the experimental trial, I have a countdown timer. When time is up, the countdown will force the end of the trial/loop. I solved it as follows:
#Begin experiment
countdownStarted = False
timeText1=12
#Begin routine
if not countdownStarted:
countdownClock = core.CountdownTimer(12) # in s
countdownStarted = True
#Each frame
timeRemaining = countdownClock.getTime()
if timeRemaining <= 0.0:
continueRoutine = False
trials.finished = True
countdownStarted = False
else:
minutes = int(timeRemaining/60.0) # the integer number of minutes
seconds = int(timeRemaining - (minutes * 60.0))
timeText1 = str(minutes) + str(':') + str(seconds) + str(' minutes')
While reaching the first loop of the experiment, I get following message:
How and where do I have to define my variable timeText1 in JS?
Btw. project can now be found here: Fabian Mueller / Decode · GitLab
Updated Psychopy to 3.0.5 if relevant.
Looks like you have not translated your Python code into JavaScript code. For now, using code components requires you to manually translate your Python code to JavaScript. We have added the option in the code component to view the code type (py, js or both). Using “both” will allow you to have to two code windows for Python and JS open side by side, to aid your translation. In the future, there are plans to add a JS compiler that automatically translates your Python code to JS, but for now, its manual.
If you need help with your JS, there are many tutorials online. Thankfully, it is not too different from Python.