Skip to content

Commit

Permalink
feat: added custom setting attribute for gradebook freeze timedelta (#…
Browse files Browse the repository at this point in the history
…35189)

* feat: added custom setting attribute for gradebook freeze timedelta
  • Loading branch information
Anas12091101 authored Aug 5, 2024
1 parent 5aa6958 commit 28ce713
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lms/djangoapps/grades/grade_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from datetime import timedelta

from django.utils import timezone
from django.conf import settings

from openedx.core.djangoapps.content.course_overviews.models import CourseOverview

Expand All @@ -22,7 +23,7 @@ def are_grades_frozen(course_key):
if ENFORCE_FREEZE_GRADE_AFTER_COURSE_END.is_enabled(course_key):
course = CourseOverview.get_from_id(course_key)
if course.end:
freeze_grade_date = course.end + timedelta(30)
freeze_grade_date = course.end + timedelta(settings.GRADEBOOK_FREEZE_DAYS)
now = timezone.now()
return now > freeze_grade_date
return False
5 changes: 5 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,11 @@
# If this is true, random scores will be generated for the purpose of debugging the profile graphs
GENERATE_PROFILE_SCORES = False

# .. setting_name: GRADEBOOK_FREEZE_DAYS
# .. setting_default: 30
# .. setting_description: Sets the number of days after which the gradebook will freeze following the course's end.
GRADEBOOK_FREEZE_DAYS = 30

# Used with XQueue
XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5 # seconds
XQUEUE_INTERFACE = {
Expand Down

0 comments on commit 28ce713

Please sign in to comment.