def METHOD_NAME(course, last_sunday):
    next_sunday = last_sunday + timezone.timedelta(days=7)
    student_most_time = (
        Question.objects.filter(
            queue__course=course,
            time_responded_to__gte=last_sunday,
            time_asked__lt=next_sunday,
            status=Question.STATUS_ANSWERED,
        )
        .values("asked_by")
        .annotate(time_being_helped=Sum(F("time_responded_to") - F("time_response_started")))
        .order_by("-time_being_helped")[:5]
    )
    for q in student_most_time:
        student_pk = q["asked_by"]
        user = User.objects.get(pk=student_pk)
        time = q["time_being_helped"].seconds
        CourseStatistic.objects.update_or_create(
            course=course,
            user=user,
            metric=CourseStatistic.METRIC_STUDENT_TIME_BEING_HELPED,
            date=last_sunday,
            defaults={"value": time},
        )