The original plan was to fetch the class data and drop any measurement that we didn't want app-side, but since this server has access to the student's story state, it seems easier to me to just build this filter into the database query. Note that if a student hasn't reached stage 5 yet, their class_data_students list in the state will be empty - in that case, we just ignore it.
As part of the scheme outlined in https://github.com/cosmicds/hubbleds/issues/284#issuecomment-1645759328, when a student reaches stage 5, the data that they received is frozen, and a list is kept in their state of the IDs of other students whose data is used for their class data.
The original plan was to fetch the class data and drop any measurement that we didn't want app-side, but since this server has access to the student's story state, it seems easier to me to just build this filter into the database query. Note that if a student hasn't reached stage 5 yet, their
class_data_students
list in the state will be empty - in that case, we just ignore it.