checkins Class Check-ins¶
Author: Zhenyu Yang yangzhenyu@sust.edu.cn
Last updated: Apr 24, 2026
Corresponding API docs: Class Check-in API
checkins Code Entry¶
backend/apps/checkins/models/__init__.pybackend/apps/checkins/views/__init__.pybackend/apps/checkins/serializers/__init__.pybackend/apps/checkins/services/__init__.py
checkins Core Data¶
CheckinSession¶
One-to-one optional relationship with
CourseOccurrence.Stores the check-in date, class period, status, check-in code, open/close times, creator, and remarks.
CheckinRecord¶
Stores a student’s check-in status for a given session.
(session, student)has a unique constraint.Recorded fields include
status,checkin_time,method,source,remark, andconfidence.
Permission Model¶
Admin roles:
superadminsecretaryassistant
Non-admin users may only manage check-in data for their own courses.
Students can only view check-in records and
my-schedulerelated to themselves.
Key Actions¶
Creating a Check-in Session¶
Entry:
CheckinSessionViewSet.createAnchored by
occurrence_idIdempotent: duplicate creation does not produce a second session.
List & Daily View¶
listsupports filtering by course, classroom, status, and date range.dailyreturns today’s sessions.On
list,_update_statuses()is called to automatically refresh the status of today’s sessions:30 minutes before class starts until class ends:
draft -> openAfter class ends:
draft/open -> closed
Roster & Check-in¶
rosterassembles the roster by matchingCourse.class_name == User.student_class.toggle-statusis designed for real-time roll call; defaults tomethod="manual",source="miniapp".manualis an alternative manual check-in entry; defaults tomethod="manual",source="web".
Student View¶
CheckinRecordViewSet.my_scheduleView courses and check-in status for the student’s class on a given date.
Current Implementation Boundaries¶
Check-in is still teacher-driven; sessions are not opened automatically.
Signage devices are not integrated into the check-in write flow.
Face recognition check-in fields have been reserved in the data model, but they currently serve as placeholders for future expansion.