Part of PLAT-2436, this is an attempt to discover where the StudentModule model and table are read/written, for the purpose of crafting a solution to update its primary key from a signed int to an unsigned bigint.
Direct access to the StudentModule model:
Courseware DjangoXBlockUserStateClient
recalculate_subsection_grades
pulls all rows for a learner/course/subsection modified within a certain time: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/grades/management/commands/recalculate_subsection_grades.py#L64reset_student_attempts
gets a single student/course/module state key: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L292list_problem_responses
gets all answers to a single problem for a course, optionally in chunks: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor_analytics/basic.py#L436_get_modules_to_update
fetches all rows for a course / list of usage keys / optional user, also does a get_or_create
: save()
: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L324get_or_create
for an individual row, plus a get, plus an update: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/model_data.py#L993get_or_create
in a loop, with potential updates using save()
: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/user_state_client.py#L246reset_student_attempts
overwrites 'attempts' using save()
: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L337 _get_modules_to_update
does a get_or_create in a loop: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor_task/tasks_helper/module_state.py#L427set_user_module_score
publishes an event that claims to update StudentModule state, but I'm not sure what the code path for that is: https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/lti_2_util.py#L258MasqueradingKeyValueStore
may also store state?: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/masquerade.py#L222StudentModuleHistoryExtended
post_save
and post_delete