def METHOD_NAME(env, submission, **kwargs):
    # Ignore model solutions
    if not submission.user:
        return env
    (
        problem_statistics,
        created,
    ) = ProblemStatistics.objects.select_for_update().get_or_create(
        problem=submission.problem_instance.problem
    )
    user_statistics, created = UserStatistics.objects.select_for_update().get_or_create(
        user=submission.user, problem_statistics=problem_statistics
    )
    submission.problem_instance.controller.METHOD_NAME(
        problem_statistics, user_statistics, submission
    )
    user_statistics.save()
    problem_statistics.save()
    return env