02-07-2023, 05:34 PM
The pause button is indeed not represented in the analysis logic. Since the analysis block is not executed while the experiment is paused (not entirely - it is still used to create a preview), it never occured to me that it is relevant, but knowing that it is the first analysis *after* a pause makes a lot of sense.
In any case, without knowing the exact experiment, I would recomment not to use the play/pause button for this, but use a button that triggers the submission. You can use multiple buttons to start/stop the measurement and the timer to control if the data is ready for submission. Then use labels to instruct the user and inform if enought data has been collected. (For example have a look at how the sensor db experiment does this (https://github.com/phyphox/phyphox-exper...db.phyphox)). Unfortunately, this also does not prevent empty submissions, but these only occur if the user presses "submit" too soon and should be easy to filter at the server side. You probably want to filter there anyway, because there could be a whole lot of things that delay measurements (depends on the sensor that is used) and a simple stop delay may not be a "safe" solution.
Another idea (again without knowing the experiment) would be a continuous measurement. The experiment keeps and analyzes the last 5 seconds and immediately submits the result when the user presses a submit button. This of course depends on the experiment.
As to why your version only works once: Not sure, this indeed looks like a bug. I have to test this. Did you try it on Android or iOS?
In any case, without knowing the exact experiment, I would recomment not to use the play/pause button for this, but use a button that triggers the submission. You can use multiple buttons to start/stop the measurement and the timer to control if the data is ready for submission. Then use labels to instruct the user and inform if enought data has been collected. (For example have a look at how the sensor db experiment does this (https://github.com/phyphox/phyphox-exper...db.phyphox)). Unfortunately, this also does not prevent empty submissions, but these only occur if the user presses "submit" too soon and should be easy to filter at the server side. You probably want to filter there anyway, because there could be a whole lot of things that delay measurements (depends on the sensor that is used) and a simple stop delay may not be a "safe" solution.
Another idea (again without knowing the experiment) would be a continuous measurement. The experiment keeps and analyzes the last 5 seconds and immediately submits the result when the user presses a submit button. This of course depends on the experiment.
As to why your version only works once: Not sure, this indeed looks like a bug. I have to test this. Did you try it on Android or iOS?