Skip to content

Commit

Permalink
Add API method for getting class measurement count.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Oct 28, 2024
1 parent 9d824d6 commit fb3d654
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/hubbleds/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,19 @@ def get_class_measurements(

return measurements.value

def get_class_measurements_count(
self,
global_state: Reactive[GlobalState],
local_state: Reactive[LocalState],
) -> int:
url = (
f"{self.API_URL}/{local_state.value.story_id}/class-measurements/"
f"{global_state.value.student.id}/{global_state.value.classroom.class_info['id']}"
)
r = self.request_session.get(url)
# TODO: Handle non-200 status codes
return r.json()["measurement_count"]

def get_all_data(
self,
local_state: Reactive[LocalState],
Expand Down

0 comments on commit fb3d654

Please sign in to comment.