Skip to content

Commit

Permalink
fix: gate use of proctoring api if provider is LTI based
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto committed Sep 30, 2024
1 parent a100166 commit caf9d70
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 10 additions & 7 deletions cms/djangoapps/contentstore/views/tests/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -3674,14 +3674,15 @@ def test_special_exam_xblock_info(
@patch_does_backend_support_onboarding
@patch_get_exam_by_content_id_success
@ddt.data(
("lti_external", False),
("other_proctoring_backend", True),
("lti_external", False, None),
("other_proctoring_backend", True, "test_url"),
)
@ddt.unpack
def test_support_onboarding_is_correct_depending_on_lti_external(
def test_proctoring_values_correct_depending_on_lti_external(
self,
external_id,
expected_value,
expected_supports_onboarding_value,
expected_proctoring_link,
mock_get_exam_by_content_id,
mock_does_backend_support_onboarding,
_mock_get_exam_configuration_dashboard_url,
Expand All @@ -3691,8 +3692,9 @@ def test_support_onboarding_is_correct_depending_on_lti_external(
category="sequential",
display_name="Test Lesson 1",
user_id=self.user.id,
is_proctored_enabled=False,
is_time_limited=False,
is_proctored_enabled=True,
is_time_limited=True,
default_time_limit_minutes=100,
is_onboarding_exam=False,
)

Expand All @@ -3709,7 +3711,8 @@ def test_support_onboarding_is_correct_depending_on_lti_external(
include_children_predicate=ALWAYS,
course=self.course,
)
assert xblock_info["supports_onboarding"] is expected_value
assert xblock_info["supports_onboarding"] is expected_supports_onboarding_value
assert xblock_info["proctoring_exam_configuration_link"] == expected_proctoring_link

@patch_get_exam_configuration_dashboard_url
@patch_does_backend_support_onboarding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,9 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements
supports_onboarding = False

proctoring_exam_configuration_link = None
if xblock.is_proctored_exam:

# only call get_exam_configuration_dashboard_url if not using an LTI proctoring provider
if xblock.is_proctored_exam and (course.proctoring_provider != 'lti_external'):
proctoring_exam_configuration_link = (
get_exam_configuration_dashboard_url(
course.id, xblock_info["id"]
Expand Down

0 comments on commit caf9d70

Please sign in to comment.