diff --git a/cms/djangoapps/models/settings/course_details.py b/cms/djangoapps/models/settings/course_details.py index e3391d0b96..c83fc475f0 100644 --- a/cms/djangoapps/models/settings/course_details.py +++ b/cms/djangoapps/models/settings/course_details.py @@ -54,7 +54,8 @@ class CourseDetails(object): '50' ) # minimum passing score for entrance exam content module/tree, self.has_cert_config = None # course has active certificate configuration - self.self_paced = None + if settings.FEATURES.get('ENABLE_SELF_PACED_COURSES'): + self.self_paced = None @classmethod def _fetch_about_attribute(cls, course_key, attribute): @@ -87,7 +88,8 @@ class CourseDetails(object): # Default course license is "All Rights Reserved" course_details.license = getattr(descriptor, "license", "all-rights-reserved") course_details.has_cert_config = has_active_web_certificate(descriptor) - course_details.self_paced = descriptor.self_paced + if settings.FEATURES.get('ENABLE_SELF_PACED_COURSES'): + course_details.self_paced = descriptor.self_paced for attribute in ABOUT_ATTRIBUTES: value = cls._fetch_about_attribute(course_key, attribute) @@ -190,7 +192,9 @@ class CourseDetails(object): descriptor.language = jsondict['language'] dirty = True - if 'self_paced' in jsondict and jsondict['self_paced'] != descriptor.self_paced: + if (settings.FEATURES.get('ENABLE_SELF_PACED_COURSES') + and 'self_paced' in jsondict + and jsondict['self_paced'] != descriptor.self_paced): descriptor.self_paced = jsondict['self_paced'] dirty = True diff --git a/cms/envs/bok_choy.py b/cms/envs/bok_choy.py index 817eedac89..8fa79caea5 100644 --- a/cms/envs/bok_choy.py +++ b/cms/envs/bok_choy.py @@ -106,6 +106,9 @@ FEATURES['ENTRANCE_EXAMS'] = True FEATURES['ENABLE_PROCTORED_EXAMS'] = True +# Enable self-paced courses +FEATURES['ENABLE_SELF_PACED_COURSES'] = True + # Point the URL used to test YouTube availability to our stub YouTube server YOUTUBE_PORT = 9080 YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT) diff --git a/cms/envs/common.py b/cms/envs/common.py index 67c04bab7b..f5546b3238 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -182,6 +182,9 @@ FEATURES = { # Timed or Proctored Exams 'ENABLE_PROCTORED_EXAMS': False, + + # Enable self-paced courses. + 'ENABLE_SELF_PACED_COURSES': False, } ENABLE_JASMINE = False diff --git a/cms/envs/test.py b/cms/envs/test.py index b96e0c02b3..159fbd63c5 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -279,3 +279,6 @@ FEATURES['ENABLE_TEAMS'] = True # Dummy secret key for dev/test SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd' + +# Enable self-paced courses +FEATURES['ENABLE_SELF_PACED_COURSES'] = True diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py index 4a4611f1dc..eee77ded80 100644 --- a/lms/envs/bok_choy.py +++ b/lms/envs/bok_choy.py @@ -131,6 +131,9 @@ FEATURES['LICENSING'] = True # Use the auto_auth workflow for creating users and logging them in FEATURES['AUTOMATIC_AUTH_FOR_TESTING'] = True +# Enable self-paced courses +FEATURES['ENABLE_SELF_PACED_COURSES'] = True + ########################### Entrance Exams ################################# FEATURES['MILESTONES_APP'] = True FEATURES['ENTRANCE_EXAMS'] = True diff --git a/lms/envs/common.py b/lms/envs/common.py index 3d3900cb9b..b338ffcb85 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -408,6 +408,9 @@ FEATURES = { # Enable LTI Provider feature. 'ENABLE_LTI_PROVIDER': False, + + # Enable self-paced courses. + 'ENABLE_SELF_PACED_COURSES': False, } # Ignore static asset files on import which match this pattern diff --git a/lms/envs/test.py b/lms/envs/test.py index 0ed5986cf7..6d2f46bba9 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -532,3 +532,6 @@ AUTHENTICATION_BACKENDS += ('lti_provider.users.LtiBackend',) # ORGANIZATIONS FEATURES['ORGANIZATIONS_APP'] = True + +# Enable self-paced courses +FEATURES['ENABLE_SELF_PACED_COURSES'] = True