diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index b437478ecc..83710fd121 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -755,7 +755,7 @@ class CapaModule(CapaFields, XModule): self.system.track_function('save_problem_check', event_info) if hasattr(self.system, 'psychometrics_handler'): # update PsychometricsData using callback - self.system.psychometrics_handler(self.get_instance_state()) + self.system.psychometrics_handler(self.get_state_for_lcp()) # render problem into HTML html = self.get_problem_html(encapsulate=False) diff --git a/lms/djangoapps/psychometrics/psychoanalyze.py b/lms/djangoapps/psychometrics/psychoanalyze.py index 3e9edcc997..008a4034a5 100644 --- a/lms/djangoapps/psychometrics/psychoanalyze.py +++ b/lms/djangoapps/psychometrics/psychoanalyze.py @@ -302,12 +302,12 @@ def make_psychometrics_data_update_handler(course_id, user, module_state_key): Construct and return a procedure which may be called to update the PsychometricsData instance for the given StudentModule instance. """ - sm = studentmodule.objects.get_or_create( - course_id=course_id, - student=user, - module_state_key=module_state_key, - defaults={'state': '{}', 'module_type': 'problem'}, - ) + sm, status = StudentModule.objects.get_or_create( + course_id=course_id, + student=user, + module_state_key=module_state_key, + defaults={'state': '{}', 'module_type': 'problem'}, + ) try: pmd = PsychometricData.objects.using(db).get(studentmodule=sm)