Visual rearrangement of new dash "Student Admin" page
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -240,7 +240,7 @@ function goto( mode)
|
||||
<hr width="40%" style="align:left">
|
||||
%endif
|
||||
|
||||
<H2>${_("Student-specific grade inspection and adjustment")}</h2>
|
||||
<h2>${_("Student-specific grade inspection and adjustment")}</h2>
|
||||
<p>
|
||||
${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)}
|
||||
<input type="text" name="unique_student_identifier">
|
||||
|
||||
@@ -38,8 +38,21 @@
|
||||
## ${ section_data['offline_grades'] }
|
||||
## </div>
|
||||
|
||||
%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
|
||||
<div class="running-tasks-container action-type-container">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
<p>${_("The status for any active tasks appears in a table below.")} </p>
|
||||
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
</div>
|
||||
|
||||
%endif
|
||||
|
||||
%if len(section_data['course_errors']):
|
||||
<div class="course-errors-wrapper">
|
||||
<hr>
|
||||
<p>
|
||||
<div class="toggle-wrapper">
|
||||
<h2 class="title">${_("Course Warnings")}:</h2>
|
||||
<div class="triangle"></div>
|
||||
@@ -52,5 +65,10 @@
|
||||
</div>
|
||||
%endfor
|
||||
</div>
|
||||
<p>
|
||||
</div>
|
||||
<br>
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,25 +2,47 @@
|
||||
<%page args="section_data"/>
|
||||
|
||||
<div class="student-specific-container action-type-container">
|
||||
<H2>${_("Student-specific grade adjustment")}</h2>
|
||||
<h2>${_("Student-specific grade inspection")}</h2>
|
||||
<div class="request-response-error"></div>
|
||||
|
||||
<input type="text" name="student-select" placeholder="${_("Student Email")}">
|
||||
<p>
|
||||
<!-- Doesn't work for username but this MUST work -->
|
||||
${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)}
|
||||
<input type="text" name="student-select-progress" placeholder="${_("Student Email or Username")}">
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<div class="progress-link-wrapper">
|
||||
<a href="" class="progress-link" data-endpoint="${ section_data['get_student_progress_url_url'] }"> ${_("Student Progress Page")} </a>
|
||||
</div>
|
||||
<p>
|
||||
${_("Click this link to view the student's progress page:")}
|
||||
|
||||
<a href="" class="progress-link" data-endpoint="${ section_data['get_student_progress_url_url'] }"> ${_("Student Progress Page")} </a>
|
||||
</p>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!-- These buttons don't appear to be working
|
||||
<p>
|
||||
${_("Click to enroll or unenroll this student from the course:")}
|
||||
<input type="button" name="enroll" value="${_("Enroll")}" data-endpoint="${ section_data['enrollment_url'] }">
|
||||
<input type="button" name="unenroll" value="${_("Unenroll")}" data-endpoint="${ section_data['enrollment_url'] }">
|
||||
## <select class="problems">
|
||||
## <option>Getting problems...</option>
|
||||
## </select>
|
||||
</p>
|
||||
-->
|
||||
|
||||
<p> ${_('Specify a particular problem in the course here by its url:')} </p>
|
||||
<hr>
|
||||
|
||||
<h2>${_("Student-specific grade adjustment")}</h2>
|
||||
|
||||
<p>
|
||||
<!-- Doesn't work for username but this MUST work -->
|
||||
${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)}
|
||||
<input type="text" name="student-select-grade" placeholder="${_("Student Email or Username")}">
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<p> ${_('Specify a particular problem in the course here by its url:')}
|
||||
<input type="text" name="problem-select-single" placeholder="${_("Problem urlname")}">
|
||||
</p>
|
||||
|
||||
<p>
|
||||
${_('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="<tt>i4x://university/course/problem/problemname</tt>",
|
||||
@@ -29,20 +51,31 @@
|
||||
urlname2="<tt>notaproblem/someothername</tt>")
|
||||
}
|
||||
</p>
|
||||
<input type="button" name="reset-attempts-single" value="${_("Reset Student Attempts")}" data-endpoint="${ section_data['reset_student_attempts_url'] }">
|
||||
|
||||
%if section_data['access']['instructor']:
|
||||
<p> ${_('You may also delete the entire state of a student for the specified module:')} </p>
|
||||
<input type="button" class="molly-guard" name="delete-state-single" value="${_("Delete Student State for Module")}" data-endpoint="${ section_data['reset_student_attempts_url'] }">
|
||||
%endif
|
||||
<p>
|
||||
${_("Next, select an action to perform for the given user and problem:")}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<!-- Doesn't give any type of notification upon success -->
|
||||
<input type="button" name="reset-attempts-single" value="${_("Reset Student Attempts")}" data-endpoint="${ section_data['reset_student_attempts_url'] }">
|
||||
|
||||
%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
|
||||
<input type="button" name="rescore-problem-single" value="${_("Rescore Student Submission")}" data-endpoint="${ section_data['rescore_problem_url'] }">
|
||||
%endif
|
||||
</p>
|
||||
|
||||
<p>
|
||||
%if section_data['access']['instructor']:
|
||||
<p> ${_('You may also delete the entire state of a student for the specified problem:')} </p>
|
||||
<input type="button" class="molly-guard" name="delete-state-single" value="${_("Delete Student State for Problem")}" data-endpoint="${ section_data['reset_student_attempts_url'] }">
|
||||
%endif
|
||||
</p>
|
||||
|
||||
|
||||
%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
|
||||
<p>
|
||||
${_("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:")}
|
||||
</p>
|
||||
|
||||
@@ -76,18 +109,11 @@
|
||||
</p>
|
||||
<p>
|
||||
<p>
|
||||
${_("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")}:
|
||||
</p>
|
||||
<input type="button" name="task-history-all" value="${_("Show Background Task History for Problem")}" data-endpoint="${ section_data['list_instructor_tasks_url'] }">
|
||||
<div class="task-history-all-table"></div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="running-tasks-container action-type-container">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
<div class="running-tasks-table" data-endpoint="${ section_data['list_instructor_tasks_url'] }"></div>
|
||||
</div>
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user