From ce6087f546e3723cc29eabf6bf402459a9ce81e9 Mon Sep 17 00:00:00 2001 From: Simon Chen Date: Mon, 17 May 2021 20:46:24 -0400 Subject: [PATCH] [Chore]:MST-677 Cleanup the waffle flag to roll out Proctoring Improvements (#27657) --- common/djangoapps/student/models.py | 14 +++++--------- common/djangoapps/student/tests/test_email.py | 3 --- common/djangoapps/student/tests/test_enrollment.py | 3 --- common/lib/xmodule/xmodule/seq_module.py | 4 +--- lms/djangoapps/courseware/toggles.py | 14 -------------- .../course_experience/views/course_home.py | 2 -- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index b0546f14ca..bde8b1e062 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -72,10 +72,7 @@ from lms.djangoapps.courseware.models import ( DynamicUpgradeDeadlineConfiguration, OrgDynamicUpgradeDeadlineConfiguration, ) -from lms.djangoapps.courseware.toggles import ( - streak_celebration_is_active, - COURSEWARE_PROCTORING_IMPROVEMENTS, -) +from lms.djangoapps.courseware.toggles import streak_celebration_is_active from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.enrollments.api import ( @@ -1423,11 +1420,10 @@ class CourseEnrollment(models.Model): self.send_signal(EnrollStatusChange.unenroll) if mode_changed: - if COURSEWARE_PROCTORING_IMPROVEMENTS.is_enabled(self.course_id): - # If mode changed to one that requires proctoring, send proctoring requirements email - if should_send_proctoring_requirements_email(self.user.username, self.course_id): - email_context = generate_proctoring_requirements_email_context(self.user, self.course_id) - send_proctoring_requirements_email(context=email_context) + # If mode changed to one that requires proctoring, send proctoring requirements email + if should_send_proctoring_requirements_email(self.user.username, self.course_id): + email_context = generate_proctoring_requirements_email_context(self.user, self.course_id) + send_proctoring_requirements_email(context=email_context) # Only emit mode change events when the user's enrollment # mode has changed from its previous setting diff --git a/common/djangoapps/student/tests/test_email.py b/common/djangoapps/student/tests/test_email.py index 0d9e7c47de..b0717308ad 100644 --- a/common/djangoapps/student/tests/test_email.py +++ b/common/djangoapps/student/tests/test_email.py @@ -15,7 +15,6 @@ from django.test import TransactionTestCase, override_settings from django.test.client import RequestFactory from django.urls import reverse from django.utils.html import escape -from edx_toggles.toggles.testutils import override_waffle_flag from common.djangoapps.edxmako.shortcuts import marketing_link from common.djangoapps.student.email_helpers import generate_proctoring_requirements_email_context @@ -30,7 +29,6 @@ from common.djangoapps.student.views import ( ) from common.djangoapps.third_party_auth.views import inactive_user_view from common.djangoapps.util.testing import EventTestMixin -from lms.djangoapps.courseware.toggles import COURSEWARE_PROCTORING_IMPROVEMENTS from lms.djangoapps.verify_student.services import IDVerificationService from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers @@ -215,7 +213,6 @@ class ActivationEmailTests(EmailTemplateTagMixin, CacheIsolationTestCase): @ddt.ddt -@override_waffle_flag(COURSEWARE_PROCTORING_IMPROVEMENTS, active=True) @patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True}) @override_settings(ACCOUNT_MICROFRONTEND_URL='http://account-mfe') @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', "Test only valid in LMS") diff --git a/common/djangoapps/student/tests/test_enrollment.py b/common/djangoapps/student/tests/test_enrollment.py index 0b34fd107d..28fe2a9f78 100644 --- a/common/djangoapps/student/tests/test_enrollment.py +++ b/common/djangoapps/student/tests/test_enrollment.py @@ -10,7 +10,6 @@ import ddt import pytest from django.conf import settings from django.urls import reverse -from edx_toggles.toggles.testutils import override_waffle_flag from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.course_modes.tests.factories import CourseModeFactory @@ -23,14 +22,12 @@ from common.djangoapps.student.models import ( from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole from common.djangoapps.student.tests.factories import CourseEnrollmentAllowedFactory, UserFactory from common.djangoapps.util.testing import UrlResetMixin -from lms.djangoapps.courseware.toggles import COURSEWARE_PROCTORING_IMPROVEMENTS from openedx.core.djangoapps.embargo.test_utils import restrict_course from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory @ddt.ddt -@override_waffle_flag(COURSEWARE_PROCTORING_IMPROVEMENTS, active=True) @patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True}) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') class EnrollmentTest(UrlResetMixin, SharedModuleStoreTestCase): diff --git a/common/lib/xmodule/xmodule/seq_module.py b/common/lib/xmodule/xmodule/seq_module.py index 87f2201894..703a295c62 100644 --- a/common/lib/xmodule/xmodule/seq_module.py +++ b/common/lib/xmodule/xmodule/seq_module.py @@ -22,7 +22,6 @@ from xblock.exceptions import NoSuchServiceError from xblock.fields import Boolean, Integer, List, Scope, String from edx_toggles.toggles import LegacyWaffleFlag -from lms.djangoapps.courseware.toggles import COURSEWARE_PROCTORING_IMPROVEMENTS from xmodule.util.xmodule_django import add_webpack_to_fragment from xmodule.x_module import ( HTMLSnippet, @@ -892,8 +891,7 @@ class SequenceBlock( 'is_practice_exam': self.is_practice_exam, 'allow_proctoring_opt_out': self.allow_proctoring_opt_out, 'due_date': self.due, - 'grace_period': self.graceperiod, # lint-amnesty, pylint: disable=no-member - 'experimental_proctoring_features': COURSEWARE_PROCTORING_IMPROVEMENTS.is_enabled(course_id), + 'grace_period': self.graceperiod # lint-amnesty, pylint: disable=no-member } # inject the user's credit requirements and fulfillments diff --git a/lms/djangoapps/courseware/toggles.py b/lms/djangoapps/courseware/toggles.py index a1d9450008..97c3e30aa9 100644 --- a/lms/djangoapps/courseware/toggles.py +++ b/lms/djangoapps/courseware/toggles.py @@ -85,20 +85,6 @@ COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES_STREAK_CELEBRATION = CourseWaffleFl WAFFLE_FLAG_NAMESPACE, 'mfe_progress_milestones_streak_celebration', __name__ ) -# .. toggle_name: courseware.proctoring_improvements -# .. toggle_implementation: CourseWaffleFlag -# .. toggle_default: False -# .. toggle_description: Waffle flag to toggle various enhancements to the proctoring experience, including but -# not limited to the display of learner facing proctoring information on the course outline, changes to the -# Proctortrack onboarding flow, changes to IDV (identity verification) requirements, etc. -# .. toggle_use_cases: temporary -# .. toggle_creation_date: 2020-10-07 -# .. toggle_target_removal_date: None -# .. toggle_tickets: MST-432 -COURSEWARE_PROCTORING_IMPROVEMENTS = CourseWaffleFlag( - WAFFLE_FLAG_NAMESPACE, 'proctoring_improvements', __name__ -) - # .. toggle_name: courseware.optimized_render_xblock # .. toggle_implementation: CourseWaffleFlag # .. toggle_default: False diff --git a/openedx/features/course_experience/views/course_home.py b/openedx/features/course_experience/views/course_home.py index 55dbadb5df..295da02cf2 100644 --- a/openedx/features/course_experience/views/course_home.py +++ b/openedx/features/course_experience/views/course_home.py @@ -25,7 +25,6 @@ from lms.djangoapps.course_goals.api import ( from lms.djangoapps.courseware.exceptions import CourseAccessRedirect, Redirect from lms.djangoapps.courseware.utils import can_show_verified_upgrade, verified_upgrade_deadline_link from lms.djangoapps.courseware.views.views import CourseTabView -from lms.djangoapps.courseware.toggles import COURSEWARE_PROCTORING_IMPROVEMENTS from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.plugin_api.views import EdxFragmentView from openedx.core.djangoapps.util.maintenance_banner import add_maintenance_banner @@ -247,7 +246,6 @@ class CourseHomeFragmentView(EdxFragmentView): 'upgrade_url': upgrade_url, 'has_discount': has_discount, 'show_search': show_search, - 'show_proctoring_info_panel': COURSEWARE_PROCTORING_IMPROVEMENTS.is_enabled(course_key), } html = render_to_string('course_experience/course-home-fragment.html', context) return Fragment(html)