From c898dd1384266a56c40401d4ce78d2b600bb82f4 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 24 Aug 2026 11:13:29 -0400 Subject: [PATCH 1/2] refactor: migrate ENABLE_EXAM_SETTINGS_HTML_VIEW off FEATURES-as-dict xmodule/course_block.py read this flag via getattr(settings, 'FEATURES', {}).get('ENABLE_EXAM_SETTINGS_HTML_VIEW', False) to decide whether the legacy proctored/timed-exam CourseBlock fields are marked deprecated in the advanced settings editor. The flag had no flat definition anywhere. Add an annotated ENABLE_EXAM_SETTINGS_HTML_VIEW = False to openedx/envs/common.py and read it with getattr(settings, 'ENABLE_EXAM_SETTINGS_HTML_VIEW', False) -- matching the adjacent DEFAULT_MOBILE_AVAILABLE / ENABLE_SPECIAL_EXAMS readers. getattr is kept (rather than bare settings.X) because this module is imported in contexts where settings may not be fully configured, e.g. static asset compilation. Co-Authored-By: Claude Opus 4.8 --- openedx/envs/common.py | 11 +++++++++++ xmodule/course_block.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/openedx/envs/common.py b/openedx/envs/common.py index e4326a9fa81d..bf18e1f901a8 100644 --- a/openedx/envs/common.py +++ b/openedx/envs/common.py @@ -1213,6 +1213,17 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_tickets: https://github.com/openedx/edx-platform/pull/9744 ENABLE_SPECIAL_EXAMS = False +# .. toggle_name: ENABLE_EXAM_SETTINGS_HTML_VIEW +# .. toggle_implementation: DjangoSetting +# .. toggle_default: False +# .. toggle_description: Enable the "Exam Settings" view in Studio's course settings. When enabled, +# the corresponding legacy proctored/timed-exam fields on the course are marked deprecated in the +# advanced settings editor so they are edited via the dedicated view instead. +# .. toggle_use_cases: open_edx +# .. toggle_creation_date: 2020-07-09 +# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/24405 +ENABLE_EXAM_SETTINGS_HTML_VIEW = False + # .. toggle_name: SHOW_HEADER_LANGUAGE_SELECTOR # .. toggle_implementation: DjangoSetting # .. toggle_default: False diff --git a/xmodule/course_block.py b/xmodule/course_block.py index eee5beab8a66..b54dce326309 100644 --- a/xmodule/course_block.py +++ b/xmodule/course_block.py @@ -53,7 +53,7 @@ DEFAULT_MOBILE_AVAILABLE = getattr(settings, 'DEFAULT_MOBILE_AVAILABLE', False) # Note: updating assets does not have settings defined, so using `getattr`. -EXAM_SETTINGS_HTML_VIEW_ENABLED = getattr(settings, 'FEATURES', {}).get('ENABLE_EXAM_SETTINGS_HTML_VIEW', False) +EXAM_SETTINGS_HTML_VIEW_ENABLED = getattr(settings, 'ENABLE_EXAM_SETTINGS_HTML_VIEW', False) SPECIAL_EXAMS_ENABLED = getattr(settings, 'ENABLE_SPECIAL_EXAMS', False) COURSE_VISIBILITY_PRIVATE = 'private' From c571a9f9c59ae8275e87a2c3c5f3a992b760cea6 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 24 Aug 2026 11:13:29 -0400 Subject: [PATCH 2/2] refactor: migrate LICENSING off FEATURES-as-dict in production settings lms/envs/production.py and cms/envs/production.py set XBLOCK_SETTINGS["VideoBlock"]["licensing_enabled"] from FEATURES["LICENSING"]. LICENSING is a flat setting (defined in openedx/envs/common.py) and is available in these modules through the common star-import, so read it directly instead of through the FEATURES dict. Co-Authored-By: Claude Opus 4.8 --- cms/envs/production.py | 2 +- lms/envs/production.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/envs/production.py b/cms/envs/production.py index 604d2753bccd..60d5f88c1b59 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -287,7 +287,7 @@ def get_env_setting(setting): # TODO: Once we have successfully upgraded to ES7, switch this back to ELASTIC_SEARCH_CONFIG. ELASTIC_SEARCH_CONFIG = _YAML_TOKENS.get('ELASTIC_SEARCH_CONFIG_ES7', [{}]) -XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = FEATURES["LICENSING"] # noqa: F405 +XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = LICENSING # noqa: F405 XBLOCK_SETTINGS.setdefault("VideoBlock", {})['YOUTUBE_API_KEY'] = YOUTUBE_API_KEY # noqa: F405 ############################ OAUTH2 Provider ################################### diff --git a/lms/envs/production.py b/lms/envs/production.py index b13f232f5bb7..035f282dbd6f 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -332,7 +332,7 @@ def get_env_setting(setting): # TODO: Once we have successfully upgraded to ES7, switch this back to ELASTIC_SEARCH_CONFIG. ELASTIC_SEARCH_CONFIG = _YAML_TOKENS.get('ELASTIC_SEARCH_CONFIG_ES7', [{}]) -XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = FEATURES["LICENSING"] # noqa: F405 +XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = LICENSING # noqa: F405 XBLOCK_SETTINGS.setdefault("VideoBlock", {})['YOUTUBE_API_KEY'] = YOUTUBE_API_KEY # noqa: F405 ##### Custom Courses for EdX #####