From 8a2bd25b7c6e3906b98eb4ff109e530f4ad7c687 Mon Sep 17 00:00:00 2001
From: Sarina Canelake
Date: Tue, 24 Sep 2013 10:57:39 -0400
Subject: [PATCH] Visual rearrangement of new dash "Student Admin" page
---
.../instructor/views/instructor_dashboard.py | 23 +++---
.../instructor_dashboard/student_admin.coffee | 23 +++---
.../courseware/instructor_dashboard.html | 2 +-
.../instructor_dashboard_2/course_info.html | 18 +++++
.../instructor_dashboard_2/student_admin.html | 72 +++++++++++++------
5 files changed, 93 insertions(+), 45 deletions(-)
diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py
index 031eac266b..e248d47a59 100644
--- a/lms/djangoapps/instructor/views/instructor_dashboard.py
+++ b/lms/djangoapps/instructor/views/instructor_dashboard.py
@@ -38,7 +38,7 @@ def instructor_dashboard_2(request, course_id):
raise Http404()
sections = [
- _section_course_info(course_id),
+ _section_course_info(course_id, access),
_section_membership(course_id, access),
_section_student_admin(course_id, access),
_section_data_download(course_id),
@@ -67,18 +67,21 @@ section_display_name will be used to generate link titles in the nav bar.
""" # pylint: disable=W0105
-def _section_course_info(course_id):
+def _section_course_info(course_id, access):
""" Provide data for the corresponding dashboard section """
course = get_course_by_id(course_id, depth=None)
- section_data = {}
- section_data['section_key'] = 'course_info'
- section_data['section_display_name'] = _('Course Info')
- section_data['course_id'] = course_id
- section_data['course_display_name'] = course.display_name
- section_data['enrollment_count'] = CourseEnrollment.objects.filter(course_id=course_id).count()
- section_data['has_started'] = course.has_started()
- section_data['has_ended'] = course.has_ended()
+ section_data = {
+ 'section_key': 'course_info',
+ 'section_display_name': _('Course Info'),
+ 'course_id': course_id,
+ 'access': access,
+ 'course_display_name': course.display_name,
+ 'enrollment_count': CourseEnrollment.objects.filter(course_id=course_id).count(),
+ 'has_started': course.has_started(),
+ 'has_ended': course.has_ended(),
+ 'list_instructor_tasks_url': reverse('list_instructor_tasks', kwargs={'course_id': course_id}),
+ }
try:
advance = lambda memo, (letter, score): "{}: {}, ".format(letter, score) + memo
diff --git a/lms/static/coffee/src/instructor_dashboard/student_admin.coffee b/lms/static/coffee/src/instructor_dashboard/student_admin.coffee
index 7e40eb98d4..e607a463fc 100644
--- a/lms/static/coffee/src/instructor_dashboard/student_admin.coffee
+++ b/lms/static/coffee/src/instructor_dashboard/student_admin.coffee
@@ -80,12 +80,13 @@ class StudentAdmin
# gather buttons
# some buttons are optional because they can be flipped by the instructor task feature switch
# student-specific
- @$field_student_select = find_and_assert @$section, "input[name='student-select']"
+ @$field_student_select_progress = find_and_assert @$section, "input[name='student-select-progress']"
+ @$field_student_select_grade = find_and_assert @$section, "input[name='student-select-grade']"
@$progress_link = find_and_assert @$section, "a.progress-link"
- @$btn_enroll = find_and_assert @$section, "input[name='enroll']"
- @$btn_unenroll = find_and_assert @$section, "input[name='unenroll']"
@$field_problem_select_single = find_and_assert @$section, "input[name='problem-select-single']"
@$btn_reset_attempts_single = find_and_assert @$section, "input[name='reset-attempts-single']"
+ @$btn_enroll = @$section.find "input[name='enroll']"
+ @$btn_unenroll = @$section.find "input[name='unenroll']"
@$btn_delete_state_single = @$section.find "input[name='delete-state-single']"
@$btn_rescore_problem_single = @$section.find "input[name='rescore-problem-single']"
@$btn_task_history_single = @$section.find "input[name='task-history-single']"
@@ -117,7 +118,7 @@ class StudentAdmin
# go to student progress page
@$progress_link.click (e) =>
e.preventDefault()
- email = @$field_student_select.val()
+ email = @$field_student_select_progress.val()
$.ajax
dataType: 'json'
@@ -131,7 +132,7 @@ class StudentAdmin
@$btn_enroll.click =>
send_data =
action: 'enroll'
- emails: @$field_student_select.val()
+ emails: @$field_student_select_progress.val()
auto_enroll: false
$.ajax
@@ -145,7 +146,7 @@ class StudentAdmin
@$btn_unenroll.click =>
send_data =
action: 'unenroll'
- emails: @$field_student_select.val()
+ emails: @$field_student_select_progress.val()
$.ajax
dataType: 'json'
@@ -157,7 +158,7 @@ class StudentAdmin
# reset attempts for student on problem
@$btn_reset_attempts_single.click =>
send_data =
- student_email: @$field_student_select.val()
+ student_email: @$field_student_select_grade.val()
problem_to_reset: @$field_problem_select_single.val()
delete_module: false
@@ -170,10 +171,10 @@ class StudentAdmin
# delete state for student on problem
@$btn_delete_state_single.click => confirm_then
- msg: "Delete student '#{@$field_student_select.val()}'s state on problem '#{@$field_problem_select_single.val()}'?"
+ msg: "Delete student '#{@$field_student_select_grade.val()}'s state on problem '#{@$field_problem_select_single.val()}'?"
ok: =>
send_data =
- student_email: @$field_student_select.val()
+ student_email: @$field_student_select_grade.val()
problem_to_reset: @$field_problem_select_single.val()
delete_module: true
@@ -187,7 +188,7 @@ class StudentAdmin
# start task to rescore problem for student
@$btn_rescore_problem_single.click =>
send_data =
- student_email: @$field_student_select.val()
+ student_email: @$field_student_select_grade.val()
problem_to_reset: @$field_problem_select_single.val()
$.ajax
@@ -200,7 +201,7 @@ class StudentAdmin
# list task history for student+problem
@$btn_task_history_single.click =>
send_data =
- student_email: @$field_student_select.val()
+ student_email: @$field_student_select_grade.val()
problem_urlname: @$field_problem_select_single.val()
if not send_data.student_email
diff --git a/lms/templates/courseware/instructor_dashboard.html b/lms/templates/courseware/instructor_dashboard.html
index 7f41c82c9d..7b06d8e309 100644
--- a/lms/templates/courseware/instructor_dashboard.html
+++ b/lms/templates/courseware/instructor_dashboard.html
@@ -240,7 +240,7 @@ function goto( mode)
%endif
- ${_("Student-specific grade inspection and adjustment")}
+ ${_("Student-specific grade inspection and adjustment")}
${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)}
diff --git a/lms/templates/instructor/instructor_dashboard_2/course_info.html b/lms/templates/instructor/instructor_dashboard_2/course_info.html
index 9b4114d95c..cb113e1846 100644
--- a/lms/templates/instructor/instructor_dashboard_2/course_info.html
+++ b/lms/templates/instructor/instructor_dashboard_2/course_info.html
@@ -38,8 +38,21 @@
## ${ section_data['offline_grades'] }
##
+%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
+
+
+
${_("Pending Instructor Tasks")}
+
${_("The status for any active tasks appears in a table below.")}
+
+
+
+
+%endif
+
%if len(section_data['course_errors']):
+
+
${_("Course Warnings")}:
@@ -52,5 +65,10 @@
%endfor
+
+
%endif
+
+
+
diff --git a/lms/templates/instructor/instructor_dashboard_2/student_admin.html b/lms/templates/instructor/instructor_dashboard_2/student_admin.html
index 6b6da617f6..001987ec18 100644
--- a/lms/templates/instructor/instructor_dashboard_2/student_admin.html
+++ b/lms/templates/instructor/instructor_dashboard_2/student_admin.html
@@ -2,25 +2,47 @@
<%page args="section_data"/>
-
${_("Student-specific grade adjustment")}
+
${_("Student-specific grade inspection")}
-
-
+
+
+ ${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)}
+
+
+
+ ${_("Click this link to view the student's progress page:")}
+ ${_("Student Progress Page")}
+
+
+
+
- ${_('Specify a particular problem in the course here by its url:')}
+
+
+ ${_("Student-specific grade adjustment")}
+
+
+
+ ${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)}
+
+
+
+
+ ${_('Specify a particular problem in the course here by its url:')}
+
+
${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. (For example, if the location is {location1}, then just provide the {urlname1}. If the location is {location2}, then provide {urlname2}.)').format(
location1="i4x://university/course/problem/problemname ",
@@ -29,20 +51,31 @@
urlname2="notaproblem/someothername ")
}
-
- %if section_data['access']['instructor']:
- ${_('You may also delete the entire state of a student for the specified module:')}
-
- %endif
+
+ ${_("Next, select an action to perform for the given user and problem:")}
+
+
+
+
+
%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
%endif
+
+
+
+ %if section_data['access']['instructor']:
+
${_('You may also delete the entire state of a student for the specified problem:')}
+
+ %endif
+
+
%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
- ${_("Rescoring runs in the background, and status for active tasks will appear in a table below. "
+ ${_("Rescoring runs in the background, and status for active tasks will appear in a table on the Course Info tab. "
"To see status for all tasks submitted for this problem and student, click on this button:")}
@@ -76,18 +109,11 @@
- ${_("These actions run in the background, and status for active tasks will appear in a table below. "
+ ${_("These actions run in the background, and status for active tasks will appear in a table on the Course Info tab. "
"To see status for all tasks submitted for this problem, click on this button")}:
-
-
-
-
-
${_("Pending Instructor Tasks")}
-
-
%endif