cosmicds / cds-api

API for accessing the CosmicDS database
GNU General Public License v3.0
0 stars 3 forks source link

Use student's story state to filter their class data #76

Closed Carifio24 closed 1 year ago

Carifio24 commented 1 year ago

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.