Files
edx-platform/lms/djangoapps/grades/config/__init__.py
2017-04-18 16:51:17 -04:00

17 lines
573 B
Python

from lms.djangoapps.grades.config.models import PersistentGradesEnabledFlag
from lms.djangoapps.grades.config.waffle import waffle as waffle_func, ASSUME_ZERO_GRADE_IF_ABSENT
def assume_zero_if_absent(course_key):
"""
Returns whether an absent grade should be assumed to be zero.
"""
return should_persist_grades(course_key) and waffle_func().is_enabled(ASSUME_ZERO_GRADE_IF_ABSENT)
def should_persist_grades(course_key):
"""
Returns whether grades should be persisted.
"""
return PersistentGradesEnabledFlag.feature_enabled(course_key)