From 5f1e05298c7f18a1fa48f19cab456fffab0d51df Mon Sep 17 00:00:00 2001 From: Zameel Hassan <43750093+zameel7@users.noreply.github.com> Date: Fri, 18 Oct 2024 10:55:47 +0530 Subject: [PATCH] feat: Add option to turn on or off fullscreen button in SCORM content (#83) * feat: Add option to turn on or off fullscreen button in SCORM content --- openedxscorm/scormxblock.py | 9 +++++++++ openedxscorm/static/html/scormxblock.html | 5 +++-- openedxscorm/static/html/studio.html | 11 +++++++++++ openedxscorm/static/js/src/studio.js | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/openedxscorm/scormxblock.py b/openedxscorm/scormxblock.py index 596a145..047028a 100644 --- a/openedxscorm/scormxblock.py +++ b/openedxscorm/scormxblock.py @@ -164,6 +164,12 @@ def scorm_storage(xblock): default=False, scope=Scope.settings, ) + enable_fullscreen_button = Boolean( + display_name=_("Show Fullscreen Button"), + help=_("Select True to show fullscreen button in the SCORM content"), + default=True, + scope=Scope.settings, + ) navigation_menu = String(scope=Scope.settings, default="") @@ -278,6 +284,7 @@ def studio_view(self, context=None): "field_height": self.fields["height"], "field_popup_on_launch": self.fields["popup_on_launch"], "field_enable_navigation_menu": self.fields["enable_navigation_menu"], + "field_enable_fullscreen_button": self.fields["enable_fullscreen_button"], "field_navigation_menu_width": self.fields["navigation_menu_width"], "popup_on_launch": self.fields["popup_on_launch"], "scorm_xblock": self, @@ -303,6 +310,7 @@ def studio_submit(self, request, _suffix): self.height = parse_int(request.params["height"], None) self.has_score = request.params["has_score"] == "1" self.enable_navigation_menu = request.params["enable_navigation_menu"] == "1" + self.enable_fullscreen_button = request.params["enable_fullscreen_button"] == "1" self.navigation_menu_width = parse_int( request.params["navigation_menu_width"], None ) @@ -344,6 +352,7 @@ def popup_window(self, request, _suffix): "navigation_menu": self.navigation_menu, "navigation_menu_width": self.navigation_menu_width, "enable_navigation_menu": self.enable_navigation_menu, + "enable_fullscreen_button": self.enable_fullscreen_button, }, ) return Response(body=rendered) diff --git a/openedxscorm/static/html/scormxblock.html b/openedxscorm/static/html/scormxblock.html index 33622b1..0032b6d 100644 --- a/openedxscorm/static/html/scormxblock.html +++ b/openedxscorm/static/html/scormxblock.html @@ -9,12 +9,13 @@ {% endif %}