EmotionCognitionLab / lipbelly

MIT License
0 stars 0 forks source link

Tighten up close-to-midnight check #27

Open noah10 opened 10 months ago

noah10 commented 10 months ago

In #26 we have an example of a case where someone had just enough time to do a final session before midnight, but emWave took long enough getting the pulse sensor going that it pushed her over the limit and caused the session to finish after midnight.

There are two things we should do to tighten this up:

  1. Add a minute or so of slop factor to the calculation to allow for this scenario.
  2. Move the time check to RestComponent (or perhaps just add it to RestComponent but also have it in TrainingComponent?) so that if someone tries to start a session, runs into problems with emWave, and then tries to start again, we catch them if there's not enough time to complete the session on their second attempt.
choipaul92 commented 10 months ago

I'm okay with both options.

I think Option 1 is good for user experience (participants get a little bit of grace where if they start before midnight, their session still counts for that day if it's completed close to after midnight) and Option 2 is good for consistency in research (2 image rating + 2 practices must be all completed before midnight = strict cut-offs).

It's also important to note that we will be recruiting from USC SONA students who are enrolled in classes. I'm willing to bet some will be completing/starting them near midnight. We also need to factor in time for participants who have faulty ear sensors where they will have to do more than 2 meditation practices a day for our app to register receiving all 40 minutes of emWave data (until they receive a new one).

noah10 commented 10 months ago

Note that they aren't options - they're two things that we have to do to fix the problem.

noah10 commented 10 months ago

Also, there's no way to factor in time for faulty ear sensors - if someone starts their 40 minutes of training at 11:18PM and loses 3 minutes due to an ear sensor problem they will not get through all of their training for the day.

noah10 commented 10 months ago

This is ready for testing. There are some edge cases to be aware of: