psychopy.org | Reference | Downloads | Github

Encrypting experiment images online (feature request?)

Is there a way to encrypt/hide image stimuli so that they can’t be found if someone were to hypothetically open the sources in the browser developer tools? If not, is this a feature that could be added in the near future?

Check my crib sheet on how to suppress information going to the Browser console and use arbitrary image file names.

I can’t find in your sheet where it talks about this (I looked at both). Could you maybe give me a section? The images are already arbitrarily named, but I can see them in the ‘Sources’ tab of the developer tools.

Developer Tools
Use Developer Tools (Ctl-Shift-I in Windows/Chrome, Cmd-Opt-J or Cmd-Opt-I in Mac/Chrome, F12 in IE/Edge, Ctrl-Shift-J in Windows/Safari, Ctrl-Opt-J in Mac/Safari) to view errors via the browser console if you aren’t getting sufficient information from PsychoPy. You can add print(var) (which translates to console.log(var); ) to check the value of a variable var at a particular point. N.B. If you need to stop your participants doing this and being able to view trial variables you may be loading from Excel, add log4javascript.setEnabled(false); to code_JS [sotiri]. This will prevent cheating on experiments with a performance based reward.
Tutorial: Thomas Pronk / tutorial_js_console_log · GitLab
See also Tech Support & Bug Report Guidelines

(I’m usually on my phone so it’s not easy to copy and paste)

So this will stop them from being able to open developer tools altogether? I did see this bit, but I thought that was just stopping people from seeing things printed to the console. I’m really glad this is a thing, thanks!

I think it turns off logging not preventing tools being opened.

Click on sotiri’s name for more details.

Oh okay. I really need a way to just disable tools or to hide the images in sources (because I can’t have curious participants viewing and/or saving them from sources). It doesn’t seem like there’s a way to do this in web programming at all… The closest thing I can think of is just clearing all resources and forcing the participant out of the experiment if they exit full screen. Do you know if there’s a way to delete resources? And do you know if there’s an easy way to continuously check for something throughout the experiment (like PsychoPy does for the esc key)?

Sorry, I know this is a tricky issue, but it will probably be helpful for anyone trying to use protected image sets who maybe never thought of this.

It’s impossible to stop someone taking a photo of their screen, even if you could disable the print screen button. Therefore anything you do will be best effort rather than airtight.
Is it easy to find the file names used by PsychoPy via the Browser Console if logging is turned off?

They’re all in a folder in the sources tab of the developer tools window. They’re all given random names and links, so you can click on them and see them. You can find images from any website there as well, so I guess there’s really no way of hiding them. Which is why I was thinking of maybe kicking participants out if they exit full screen because they can’t open developer tools without exiting full screen.

This might help (though possibly not on all browsers)