According to Marco and Shanaa, sometimes trials go missing in action. That should not happen, and if it does, we should make sure that it doesn't affect combining the data or the data pre-processing.
So:
when storing the data after each trial: 1) close the file handler explicitly, and then 2) check if the file exists and has some (or all?) data (and if not, overwrite the file until it is stored correctly?)
when combining all trials in the larger data file 1) check if all trials from the experiment definition exist, and 2) if one is missing, replace it with some placeholder data (NAs?) so that the trial will exist and not mess up the pre-processing AND show a pop-up with a warning that trial T from task XYZ is missing for participant ABC
According to Marco and Shanaa, sometimes trials go missing in action. That should not happen, and if it does, we should make sure that it doesn't affect combining the data or the data pre-processing.
So: