Skip to content

Commit 2a339fc

Browse files
EerikSaksimarkkuriekkinen
authored andcommitted
LTI Tool v1.3: remove staff buttons in exercise and submission views
The staff views have not been implemented for the LTI Tool. The views do not currently support opening in iframes and they include navigation bars that have been removed in LTI Tool views. Fixes #1115
1 parent 8ce98a6 commit 2a339fc

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

exercise/templates/exercise/exercise_base.html

+9-7
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,25 @@
9393
{% if is_course_staff %}
9494
<li>
9595
<p class="navbar-text navbar-btn">
96-
{% if submission %}
96+
{% if submission and not disable_staff_nav %}
9797
<a href="{{ submission|url:'submission-inspect' }}" role="button" class="aplus-button--secondary aplus-button--xs">
9898
<span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>
9999
{% translate "INSPECT_SUBMISSION" %}
100100
</a>
101-
{% elif is_teacher %}
101+
{% elif is_teacher and not disable_staff_nav %}
102102
{% load editcourse %}
103103
<a href="{{ exercise|editurl:'exercise' }}" role="button" class="aplus-button--secondary aplus-button--xs">
104104
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
105105
{% translate "EDIT_EXERCISE" %}
106106
</a>
107107
{% endif %}
108-
{% if is_teacher or exercise.allow_assistant_viewing %}
109-
<a href="{{ exercise|url:'submission-list' }}" role="button" class="aplus-button--secondary aplus-button--xs">
110-
<span class="glyphicon glyphicon-list" aria-hidden="true"></span>
111-
{% translate "VIEW_ALL_SUBMISSIONS" %}
112-
</a>
108+
{% if not disable_staff_nav %}
109+
{% if is_teacher or exercise.allow_assistant_viewing %}
110+
<a href="{{ exercise|url:'submission-list' }}" role="button" class="aplus-button--secondary aplus-button--xs">
111+
<span class="glyphicon glyphicon-list" aria-hidden="true"></span>
112+
{% translate "VIEW_ALL_SUBMISSIONS" %}
113+
</a>
114+
{% endif %}
113115
{% endif %}
114116
</p>
115117
</li>

lti_tool/views.py

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ def parse_lti_session_params(self):
128128
)
129129
self.message_launch_data = self.message_launch.get_launch_data()
130130

131+
def get_common_objects(self):
132+
super().get_common_objects()
133+
self.disable_staff_nav = True
134+
self.note("disable_staff_nav")
135+
131136

132137
class LtiInstanceView(LtiSessionMixin, InstanceView):
133138

0 commit comments

Comments
 (0)