Skip to content
Snippets Groups Projects
Commit d294a91f authored by Eric Fischer's avatar Eric Fischer
Browse files

Clarify instructor vs staff accessible features on dashboard

Using the guideline "Course staff should have access to features related to
individual learners, but not course-wide modifications", most tools on the
student admin sub-tab of the instructor dashboard should be available to
staff as well as instructors.

TNL-5907
parent 41e852fe
No related merge requests found
......@@ -14,7 +14,7 @@ from django.test.utils import override_settings
from edxmako.shortcuts import render_to_response
from courseware.tabs import get_course_tab_list
from courseware.tests.factories import UserFactory, StudentModuleFactory
from courseware.tests.factories import UserFactory, StudentModuleFactory, StaffFactory
from courseware.tests.helpers import LoginEnrollmentTestCase
from lms.djangoapps.instructor.views.gradebook_api import calculate_page_info
......@@ -100,9 +100,30 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
return len([tab for tab in tabs if tab.name == 'Instructor']) == 1
self.assertTrue(has_instructor_tab(self.instructor, self.course))
staff = StaffFactory(course_key=self.course.id)
self.assertTrue(has_instructor_tab(staff, self.course))
student = UserFactory.create()
self.assertFalse(has_instructor_tab(student, self.course))
def test_student_admin_staff_instructor(self):
"""
Verify that staff users are not able to see course-wide options, while still
seeing individual learner options.
"""
# Original (instructor) user can see both specific grades, and course-wide grade adjustment tools
response = self.client.get(self.url)
self.assertIn('<h4 class="hd hd-4">Adjust all enrolled learners', response.content)
self.assertIn('<h4 class="hd hd-4">View a specific learner&#39;s grades and progress', response.content)
# But staff user can only see specific grades
staff = StaffFactory(course_key=self.course.id)
self.client.login(username=staff.username, password="test")
response = self.client.get(self.url)
self.assertNotIn('<h4 class="hd hd-4">Adjust all enrolled learners', response.content)
self.assertIn('<h4 class="hd hd-4">View a specific learner&#39;s grades and progress', response.content)
def test_default_currency_in_the_html_response(self):
"""
Test that checks the default currency_symbol ($) in the response
......
<%page args="section_data" expression_filter="h"/>
<%! from django.utils.translation import ugettext as _ %>
%if section_data['access']['instructor']:
%if section_data['access']['staff'] or section_data['access']['instructor']:
<div class="action-type-container">
%if section_data['is_small_course']:
<br><br>
......@@ -112,7 +112,7 @@
<input type="button" name="skip-entrance-exam" value="${_('Let Learner Skip Entrance Exam')}" data-endpoint="${ section_data['student_can_skip_entrance_exam_url'] }">
<br><br>
%if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
%if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
<h5 class="hd hd-5">${_("Rescore")}</h5>
<label for="rescore-actions-entrance-exam">
${_("Rescore any responses that have been submitted. The 'Rescore All Problems Only If Score Improves' option updates the learner's scores only if it improves in the learner's favor.")}
......@@ -147,6 +147,9 @@
</div>
%endif
%endif
%if section_data['access']['instructor']:
%if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
<div class="course-specific-container action-type-container">
<h4 class="hd hd-4">${_("Adjust all enrolled learners' grades for a specific problem")}</h4>
......
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