From 37241b30a97f8370ef6fbd76a6cec9bfebc5087c Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 23 Aug 2017 14:54:12 -0400 Subject: [PATCH] Better handling of proctoring help URL --- cms/djangoapps/contentstore/views/item.py | 3 ++- ...d-examination-preference-editor.underscore | 22 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 240a7dc2d4..6b4cce7534 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -1192,9 +1192,10 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F 'enable_timed_exams': xblock.enable_timed_exams }) elif xblock.category == 'sequential': + rules_url = settings.PROCTORING_SETTINGS.get('LINK_URLS', {}).get('online_proctoring_rules', ""), xblock_info.update({ 'is_proctored_exam': xblock.is_proctored_exam, - 'online_proctoring_rules': settings.PROCTORING_SETTINGS.get('LINK_URLS', {}).get('online_proctoring_rules', {}), + 'online_proctoring_rules': rules_url, 'is_practice_exam': xblock.is_practice_exam, 'is_time_limited': xblock.is_time_limited, 'exam_review_rules': xblock.exam_review_rules, diff --git a/cms/templates/js/timed-examination-preference-editor.underscore b/cms/templates/js/timed-examination-preference-editor.underscore index fad00198d3..8853fce368 100644 --- a/cms/templates/js/timed-examination-preference-editor.underscore +++ b/cms/templates/js/timed-examination-preference-editor.underscore @@ -44,15 +44,19 @@ <% var online_proctoring_rules = xblockInfo.get('online_proctoring_rules'); %>

- <%= edx.HtmlUtils.interpolateHtml( - gettext('Specify any rules or rule exceptions that the proctoring review team should enforce when reviewing the videos. For example, you could specify that calculators are allowed. These specified rules are visible to learners before the learners start the exam, along with the {linkStart}general proctored exam rules{linkEnd}.'), - { - linkStart: edx.HtmlUtils.interpolateHtml( - edx.HtmlUtils.HTML(''), - { onlineProctoringUrl: online_proctoring_rules, onlineProctoringTitle: gettext('General Proctored Exam Rules')}), - linkEnd: edx.HtmlUtils.HTML('') - }) - %> + <% if (online_proctoring_rules) { %> + <%= edx.HtmlUtils.interpolateHtml( + gettext('Specify any rules or rule exceptions that the proctoring review team should enforce when reviewing the videos. For example, you could specify that calculators are allowed. These specified rules are visible to learners before the learners start the exam, along with the {linkStart}general proctored exam rules{linkEnd}.'), + { + linkStart: edx.HtmlUtils.interpolateHtml( + edx.HtmlUtils.HTML(''), + { onlineProctoringUrl: online_proctoring_rules, onlineProctoringTitle: gettext('General Proctored Exam Rules')}), + linkEnd: edx.HtmlUtils.HTML('') + }) + %> + <% } else { %> + <%- gettext('Specify any rules or rule exceptions that the proctoring review team should enforce when reviewing the videos. For example, you could specify that calculators are allowed. These specified rules are visible to learners before the learners start the exam.') %> + <% } %>