Skip to content
Snippets Groups Projects
Commit 0a514821 authored by SaadYousaf's avatar SaadYousaf
Browse files

fix for instructor tab visible in learner role when masquerading.

parent 2f994a9b
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
<%namespace name='static' file='/static_content.html'/>
<%!
from lms.djangoapps.courseware.masquerade import is_masquerading_as_student
from lms.djangoapps.courseware.tabs import get_course_tab_list
from django.conf import settings
from django.urls import reverse
......@@ -21,6 +22,8 @@ if course is not None:
settings.FEATURES.get('ENABLE_SPECIAL_EXAMS', False) and
(course.enable_proctored_exams or course.enable_timed_exams)
)
masquerading_as_student = is_masquerading_as_student(request.user, course.id)
%>
% if include_special_exams is not UNDEFINED and include_special_exams:
......@@ -44,19 +47,23 @@ if course is not None:
<%
tab_is_active = tab.tab_id in (active_page, default_tab)
%>
<li class="nav-item ${'active' if tab_is_active else ''}">
<a href="${tab.link_func(course, reverse)}" class="nav-link">
${_(tab.name)}
% if tab_is_active:
<span class="sr-only">, ${_('current location')}</span>
%endif
% if tab_image:
## Translators: 'needs attention' is an alternative string for the
## notification image that indicates the tab "needs attention".
<img src="${tab_image}" alt="${_('needs attention')}" />
%endif
</a>
</li>
% if tab.name == 'Instructor' and masquerading_as_student:
<% continue %>
% else:
<li class="nav-item ${'active' if tab_is_active else ''}">
<a href="${tab.link_func(course, reverse)}" class="nav-link">
${_(tab.name)}
% if tab_is_active:
<span class="sr-only">, ${_('current location')}</span>
%endif
% if tab_image:
## Translators: 'needs attention' is an alternative string for the
## notification image that indicates the tab "needs attention".
<img src="${tab_image}" alt="${_('needs attention')}" />
%endif
</a>
</li>
%endif
% endfor
</ul>
</nav>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment