Clean up HTML export functionality

I have noticed the exporting of HTML could be prone to errors, for example if the media resources are not in the experiment folder, then I don’t think the files will be correctly exported. The data uploaded to pavlovia seemed to include everything in my experiment directory, which in my case included several log files and other data.

I wanted to know if the psychpy team would mind if Emotiv cleaned the HTML exporting up by:

  • Ensuring the media files are in the directory that will be uploaded
  • Not uploading unneeded files for example the data directory that has the logging data
    The only files that will be exported are.
  1. the index.html,
  2. the experiment.js and
  3. any resources in the experiment.js

Are these changes compatible with the pavlovia exporting? Or have I misunderstood what the export function does?

Both aspects are sort of linked to the use of git projects as the means to sync, share and version-control.

If the media files are outside the project folder then yes, they can’t be uploaded. A git repository does require files to be within a repo. I don’t think PsychoPy should move or duplicate files without asking the user, but maybe we can provide an alert that this is an issue if a user has their materials outside the folder.

The uploading of all the files in the folder is just for the simplicity of us not writing an interface to ask users what they want to upload. There are plenty of tools out there, like Git Cola (simple) or GitKraken (advanced) and we will I’m sure one day implement some basic file-select-view-changes interface. I wouldn’t want to change the default behaviour of PsychoPy to upload almost the entire project folder because for most people this makes sense in terms of, say, sharing a project between computers. You can change the settings for your particular project though by editing the file called .gitignore in your project folder. You could use that to avoid synchronizing data/*.log for instance but note that this will also have the effect that you won’t receive files with that pattern either (from Pavlovia)

Hope that helps clear up the design principles and reasoning?

best wishes