diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 87292a1..6480b28 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,14 @@ Unreleased ********** * +[0.1.8] - 2024-03-14 +************************************************ + +Changed +======= + +* Verification pipeline filter not run for proctored exam units + [0.1.7] - 2024-01-31 ************************************************ diff --git a/skill_tagging/__init__.py b/skill_tagging/__init__.py index a45dcd4..73731e5 100644 --- a/skill_tagging/__init__.py +++ b/skill_tagging/__init__.py @@ -2,7 +2,7 @@ Django app plugin for fetching and verifying tags for xblock skills. """ -__version__ = '0.1.7' +__version__ = '0.1.8' # pylint: disable=invalid-name default_app_config = 'skill_tagging.apps.SkillTaggingConfig' diff --git a/skill_tagging/pipeline.py b/skill_tagging/pipeline.py index c70332a..6f4f756 100644 --- a/skill_tagging/pipeline.py +++ b/skill_tagging/pipeline.py @@ -9,6 +9,11 @@ from django.template import Context, Template from openedx_filters import PipelineStep +try: + from edx_proctoring.models import ProctoredExam +except ImportError: + ProctoredExam = None + logger = logging.getLogger(__name__) DEFAULT_PROBABILITY = 0.03 @@ -35,6 +40,13 @@ def fetch_related_skills(block): tags = fetch_tags() return tags + @staticmethod + def is_proctored_exam(content_id): + """Determines whether the content is a proctored exam.""" + if ProctoredExam: + return ProctoredExam.objects.filter(content_id=content_id, is_proctored=True).exists() + return False + @staticmethod def should_run_filter(): """Determines whether we should run filter and display form.""" @@ -81,14 +93,13 @@ class AddVerticalBlockSkillVerificationSection(VerificationPipelineBase, Pipelin """ def run_filter(self, block, fragment, context, view): # pylint: disable=arguments-differ """Pipeline Step implementing the Filter""" - + usage_id = block.scope_ids.usage_id # Check whether we need to run this filter and only call the API. - if not self.should_run_filter(): + if not self.should_run_filter() or self.is_proctored_exam(str(usage_id)): return {"block": block, "fragment": fragment, "context": context, "view": view} skills = self.fetch_related_skills(block) if not skills: return {"block": block, "fragment": fragment, "context": context, "view": view} - usage_id = block.scope_ids.usage_id data = self.get_skill_context(usage_id, block, skills) html = resource_string("static/tagging.html") css = resource_string("static/tagging.css")