Versions Compared

Key

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

...

Code Block
languagepy
from datetime import timedelta
from django.utils import timezone
def should_update_grades(course_key):
    some_waffle_switch = True // Some waffle switch which we can pull information from for active/inactive?
    course = CourseOverview.get_from_id(course_key)
    if some_waffle_switch and course.end: // Not sure if we are ok for self paced courses with ends dates to be the part of the change 
    grade_update_offset = course.end + timedelta(30) // There should some good place to store `30`. A config model/settings/static variable? 
    now = timezone.now()
    if now > offset:
        return False
 return True

Questions

  1. Where to place the helper method? There is signal handler in CMS for course grade update and there are signal handlers in LMS for subsection grade changes when learner attempts to score a problem.