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.
class_dashboard
aggregates or selects across many StudentModule
rows in single queries in these places:xblock_utils
uses direct aggregate SELECT SQL executed here:course_blocks
courseware
model_data
user_state_client
views
grades
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#L64instructor
reset_student_attempts
gets a single student/course/module state key: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L292instructor_analytics
list_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#L436instructor_task
_get_modules_to_update
fetches all rows for a course / list of usage keys / optional user, also does a get_or_create
:instructor
reset_student_attempts
overwrites 'attempts' using save()
: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L337course_blocks
courseware
model_data
get_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#L993user_state_client
get_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#L246 instructor_task
_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#L427xmodule
lti_2_util
's set_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#L258instructor
reset_student_attempts
can optionally delete StudentModule
rows recursively: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L299courseware
courseware/model_data.py
access or store StudentModule
data, ex: DjangoKeyValueStore
& FieldDataCache
: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/model_data.py#L680MasqueradingKeyValueStore
may also store state?: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/masquerade.py#L222instructor_task _get_module_instance_for_task
indirectly reads via DjangoKeyValueStore
: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor_task/tasks_helper/module_state.py#L329StudentModuleFactory
(many)StudentModuleHistoryExtended
post_save
and post_delete
StudentModule
.