Merge pull request #26147 from edx/mroytman/MST-545-pass-proctoring-improvements-toggle-edx-proctoring
pass value of EXAM_RESUME_PROCTORING_IMPROVEMENTS feature toggle to ed…
This commit is contained in:
@@ -100,6 +100,21 @@ COURSEWARE_PROCTORING_IMPROVEMENTS = CourseWaffleFlag(
|
||||
WAFFLE_FLAG_NAMESPACE, 'proctoring_improvements', __name__
|
||||
)
|
||||
|
||||
# .. toggle_name: courseware.exam_resume_proctoring_improvements
|
||||
# .. toggle_implementation: CourseWaffleFlag
|
||||
# .. toggle_default: False
|
||||
# .. toggle_description: Waffle flag to toggle various exam resumption enhancements to the proctoring experience,
|
||||
# including but not limited to the addition of a "Resume" action for exam attempts in the "error" state to the
|
||||
# Student Special Exam Attempts panel of the Special Exams tab of the Instructor Dashboard, etc.
|
||||
# .. toggle_use_cases: temporary
|
||||
# .. toggle_creation_date: 2020-01-25
|
||||
# .. toggle_target_removal_date: None
|
||||
# .. toggle_warnings: None
|
||||
# .. toggle_tickets: MST-597
|
||||
EXAM_RESUME_PROCTORING_IMPROVEMENTS = CourseWaffleFlag(
|
||||
WAFFLE_FLAG_NAMESPACE, 'exam_resume_proctoring_improvements', __name__
|
||||
)
|
||||
|
||||
|
||||
def course_exit_page_is_active(course_key):
|
||||
return (
|
||||
|
||||
@@ -11,8 +11,10 @@ from six import text_type
|
||||
|
||||
from edx_proctoring.api import create_exam
|
||||
from edx_proctoring.backends.tests.test_backend import TestBackendProvider
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
|
||||
from common.djangoapps.student.tests.factories import AdminFactory
|
||||
from lms.djangoapps.courseware.toggles import EXAM_RESUME_PROCTORING_IMPROVEMENTS
|
||||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
@@ -177,6 +179,32 @@ class TestProctoringDashboardViews(SharedModuleStoreTestCase):
|
||||
self.instructor.save()
|
||||
self._assert_escalation_email_available(True)
|
||||
|
||||
@override_waffle_flag(EXAM_RESUME_PROCTORING_IMPROVEMENTS, True)
|
||||
def test_exam_resume_proctoring_improvements_toggle_enabled(self):
|
||||
"""
|
||||
The value of the feature toggle EXAM_RESUME_PROCTORING_IMPROVEMENTS should be included in the response
|
||||
via the data-enable-exam-resume-proctoring-improvements data attribute when the toggle is enabled.
|
||||
"""
|
||||
self.setup_course(True, True)
|
||||
self.instructor.is_staff = True
|
||||
self.instructor.save()
|
||||
|
||||
response = self.client.get(self.url)
|
||||
self.assertIn('data-enable-exam-resume-proctoring-improvements="True"', response.content.decode('utf-8'))
|
||||
|
||||
@override_waffle_flag(EXAM_RESUME_PROCTORING_IMPROVEMENTS, False)
|
||||
def test_exam_resume_proctoring_improvements_toggle_disabled(self):
|
||||
"""
|
||||
The value of the feature toggle EXAM_RESUME_PROCTORING_IMPROVEMENTS should be included in the response
|
||||
via the data-enable-exam-resume-proctoring-improvements data attribute when the toggle is disabled.
|
||||
"""
|
||||
self.setup_course(True, True)
|
||||
self.instructor.is_staff = True
|
||||
self.instructor.save()
|
||||
|
||||
response = self.client.get(self.url)
|
||||
self.assertIn('data-enable-exam-resume-proctoring-improvements="False"', response.content.decode('utf-8'))
|
||||
|
||||
def test_review_dashboard(self):
|
||||
"""
|
||||
The exam review dashboard will appear for backends that support the feature
|
||||
|
||||
@@ -44,6 +44,7 @@ from lms.djangoapps.certificates.models import (
|
||||
from lms.djangoapps.courseware.access import has_access
|
||||
from lms.djangoapps.courseware.courses import get_course_by_id, get_studio_url
|
||||
from lms.djangoapps.courseware.module_render import get_module_by_usage_id
|
||||
from lms.djangoapps.courseware.toggles import EXAM_RESUME_PROCTORING_IMPROVEMENTS
|
||||
from lms.djangoapps.discussion.django_comment_client.utils import available_division_schemes, has_forum_access
|
||||
from lms.djangoapps.grades.api import is_writable_gradebook_enabled
|
||||
from openedx.core.djangoapps.course_groups.cohorts import DEFAULT_COHORT_NAME, get_course_cohorts, is_course_cohorted
|
||||
@@ -276,6 +277,7 @@ def _section_special_exams(course, access):
|
||||
'course_id': course_key,
|
||||
'escalation_email': escalation_email,
|
||||
'show_dashboard': is_backend_dashboard_available(course_key),
|
||||
'enable_exam_resume_proctoring_improvements': EXAM_RESUME_PROCTORING_IMPROVEMENTS.is_enabled(course.id),
|
||||
}
|
||||
return section_data
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import pytz
|
||||
</div>
|
||||
<div class="wrap">
|
||||
<h3 class="hd hd-3">${_('Student Special Exam Attempts')}</h3>
|
||||
<div class="student-proctored-exam-container" data-course-id="${ section_data['course_id'] }"></div>
|
||||
<div class="student-proctored-exam-container" data-course-id="${ section_data['course_id'] }" data-enable-exam-resume-proctoring-improvements="${ section_data['enable_exam_resume_proctoring_improvements'] }"></div>
|
||||
</div>
|
||||
% if section_data['show_dashboard']:
|
||||
<div class="wrap">
|
||||
|
||||
Reference in New Issue
Block a user