Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Several tests perform direct StudentModule.object() access.

lms/djangoapps/instructor/enrollment.py

Call ChainQueryMaps to New Query
reset_student_attempts()

module_to_reset = StudentModule.objects.get(
student_id=student.id,
course_id=course_id,
module_state_key=module_state_key
)

 Then .delete() or .save()

 

lms/djangoapps/instructor/management/commands/openended_stats.py

Call ChainQueryMaps to New Query
calculate_task_statistics()

student_modules = StudentModule.objects.filter(

module_state_key=location, student__in=students

).order_by('student')

 

lms/djangoapps/instructor/tests/test_api.py

Several tests perform direct StudentModule.object() access.

lms/djangoapps/instructor/tests/test_enrollment.py

Several tests perform direct StudentModule.object() access.

lms/djangoapps/instructor/tests/test_tools.py

Several tests perform direct StudentModule.object() access.

lms/djangoapps/instructor/views/legacy.py

Dumps CSV of problem reponses.

Call ChainQueryMaps to New Query
instructor_dashboard()

smdat = StudentModule.objects.filter(
course_id=course_key,
module_state_key=module_state_key
)
smdat = smdat.order_by('student')

 

lms/djangoapps/instructor/views/tools.py

Call ChainQueryMaps to New Query
get_extended_due(course, unit, student)

student_module = StudentModule.objects.get(
student_id=student.id,
course_id=course.id,
module_state_key=unit.location
)

 

set_due_date_extension(course, unit,

student, due_date)

student_module = StudentModule.objects.get(
student_id=student.id,
course_id=course.id,
module_state_key=node.location
)

Then .save()

or

student_module = StudentModule.objects.create(
student_id=student.id,
course_id=course.id,
module_state_key=node.location,
module_type=node.category
)

 
 dump_module_extensions(course, unit) query = StudentModule.objects.filter(

course_id=course.id,
module_state_key=unit.location)

 
dump_student_extensions(course, student)

query = StudentModule.objects.filter(
course_id=course.id,
student_id=student.id)

 

lms/djangoapps/instructor_task/tasks_helper.py

Call ChainQueryMaps to New Query
perform_module_state_update()

modules_to_update = StudentModule.objects.filter(

course_id=course_id, module_state_key__in=usage_keys

)

 

lms/djangoapps/instructor_task/tests/test_base.py

A test performs direct StudentModule.object() access.

lms/djangoapps/instructor_task/tests/test_tasks.py

Several tests perform direct StudentModule.object() access.

lms/djangoapps/psychometrics/models.py

Creates a model that joins with every single row in CSM. This functionality will likely not be possible with the CSM behind an interface!

Other associated files:

  • lms/djangoapps/psychometrics/psychoanalyze.py
  • lms/djangoapps/psychometrics/management/commands/init_psychometrics.py

src/edx-sga/edx_sga/sga.py

Staff-graded assignments XBlock.

Call ChainQueryMaps to New Query
staff_grading_data()

module, _ = StudentModule.objects.get_or_create(
course_id=self.course_id,
module_state_key=self.location,
student=user,
defaults={
'state': '{}',
'module_type': self.category,
})

 
staff_upload_annotated()

module = StudentModule.objects.get(pk=request.params['module_id'])

And finally, .save()

 
staff_download_annotated()

module = StudentModule.objects.get(pk=request.params['module_id'])

 
enter_grade()

module = StudentModule.objects.get(pk=request.params['module_id'])

And finally, .save()

 
remove_grade()

module = StudentModule.objects.get(pk=request.params['module_id'])

And finally, .save()