def submission_judged(self, submission, rejudged=False): super(ProblemExperienceMixinForContestController, self)\ .submission_judged(submission, rejudged) try: report = SubmissionReport.objects.get( userresultforproblem__user=submission.user, userresultforproblem__problem_instance= submission.problem_instance ) PROBLEM_EXPERIENCE_SOURCE.handle_submission_report(report) except SubmissionReport.DoesNotExist: pass # Possible in tests
def recalculate_on_difficulty_update(sender, instance, created, **kwargs): PROBLEM_EXPERIENCE_SOURCE.force_recalculate_problem(instance.problem)