Commit 8a2bd25b by Sarina Canelake

Visual rearrangement of new dash "Student Admin" page

parent c1d555be
...@@ -38,7 +38,7 @@ def instructor_dashboard_2(request, course_id): ...@@ -38,7 +38,7 @@ def instructor_dashboard_2(request, course_id):
raise Http404() raise Http404()
sections = [ sections = [
_section_course_info(course_id), _section_course_info(course_id, access),
_section_membership(course_id, access), _section_membership(course_id, access),
_section_student_admin(course_id, access), _section_student_admin(course_id, access),
_section_data_download(course_id), _section_data_download(course_id),
...@@ -67,18 +67,21 @@ section_display_name will be used to generate link titles in the nav bar. ...@@ -67,18 +67,21 @@ section_display_name will be used to generate link titles in the nav bar.
""" # pylint: disable=W0105 """ # pylint: disable=W0105
def _section_course_info(course_id): def _section_course_info(course_id, access):
""" Provide data for the corresponding dashboard section """ """ Provide data for the corresponding dashboard section """
course = get_course_by_id(course_id, depth=None) course = get_course_by_id(course_id, depth=None)
section_data = {} section_data = {
section_data['section_key'] = 'course_info' 'section_key': 'course_info',
section_data['section_display_name'] = _('Course Info') 'section_display_name': _('Course Info'),
section_data['course_id'] = course_id 'course_id': course_id,
section_data['course_display_name'] = course.display_name 'access': access,
section_data['enrollment_count'] = CourseEnrollment.objects.filter(course_id=course_id).count() 'course_display_name': course.display_name,
section_data['has_started'] = course.has_started() 'enrollment_count': CourseEnrollment.objects.filter(course_id=course_id).count(),
section_data['has_ended'] = course.has_ended() 'has_started': course.has_started(),
'has_ended': course.has_ended(),
'list_instructor_tasks_url': reverse('list_instructor_tasks', kwargs={'course_id': course_id}),
}
try: try:
advance = lambda memo, (letter, score): "{}: {}, ".format(letter, score) + memo advance = lambda memo, (letter, score): "{}: {}, ".format(letter, score) + memo
......
...@@ -80,12 +80,13 @@ class StudentAdmin ...@@ -80,12 +80,13 @@ class StudentAdmin
# gather buttons # gather buttons
# some buttons are optional because they can be flipped by the instructor task feature switch # some buttons are optional because they can be flipped by the instructor task feature switch
# student-specific # 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" @$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']" @$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_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_delete_state_single = @$section.find "input[name='delete-state-single']"
@$btn_rescore_problem_single = @$section.find "input[name='rescore-problem-single']" @$btn_rescore_problem_single = @$section.find "input[name='rescore-problem-single']"
@$btn_task_history_single = @$section.find "input[name='task-history-single']" @$btn_task_history_single = @$section.find "input[name='task-history-single']"
...@@ -117,7 +118,7 @@ class StudentAdmin ...@@ -117,7 +118,7 @@ class StudentAdmin
# go to student progress page # go to student progress page
@$progress_link.click (e) => @$progress_link.click (e) =>
e.preventDefault() e.preventDefault()
email = @$field_student_select.val() email = @$field_student_select_progress.val()
$.ajax $.ajax
dataType: 'json' dataType: 'json'
...@@ -131,7 +132,7 @@ class StudentAdmin ...@@ -131,7 +132,7 @@ class StudentAdmin
@$btn_enroll.click => @$btn_enroll.click =>
send_data = send_data =
action: 'enroll' action: 'enroll'
emails: @$field_student_select.val() emails: @$field_student_select_progress.val()
auto_enroll: false auto_enroll: false
$.ajax $.ajax
...@@ -145,7 +146,7 @@ class StudentAdmin ...@@ -145,7 +146,7 @@ class StudentAdmin
@$btn_unenroll.click => @$btn_unenroll.click =>
send_data = send_data =
action: 'unenroll' action: 'unenroll'
emails: @$field_student_select.val() emails: @$field_student_select_progress.val()
$.ajax $.ajax
dataType: 'json' dataType: 'json'
...@@ -157,7 +158,7 @@ class StudentAdmin ...@@ -157,7 +158,7 @@ class StudentAdmin
# reset attempts for student on problem # reset attempts for student on problem
@$btn_reset_attempts_single.click => @$btn_reset_attempts_single.click =>
send_data = send_data =
student_email: @$field_student_select.val() student_email: @$field_student_select_grade.val()
problem_to_reset: @$field_problem_select_single.val() problem_to_reset: @$field_problem_select_single.val()
delete_module: false delete_module: false
...@@ -170,10 +171,10 @@ class StudentAdmin ...@@ -170,10 +171,10 @@ class StudentAdmin
# delete state for student on problem # delete state for student on problem
@$btn_delete_state_single.click => confirm_then @$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: => ok: =>
send_data = send_data =
student_email: @$field_student_select.val() student_email: @$field_student_select_grade.val()
problem_to_reset: @$field_problem_select_single.val() problem_to_reset: @$field_problem_select_single.val()
delete_module: true delete_module: true
...@@ -187,7 +188,7 @@ class StudentAdmin ...@@ -187,7 +188,7 @@ class StudentAdmin
# start task to rescore problem for student # start task to rescore problem for student
@$btn_rescore_problem_single.click => @$btn_rescore_problem_single.click =>
send_data = send_data =
student_email: @$field_student_select.val() student_email: @$field_student_select_grade.val()
problem_to_reset: @$field_problem_select_single.val() problem_to_reset: @$field_problem_select_single.val()
$.ajax $.ajax
...@@ -200,7 +201,7 @@ class StudentAdmin ...@@ -200,7 +201,7 @@ class StudentAdmin
# list task history for student+problem # list task history for student+problem
@$btn_task_history_single.click => @$btn_task_history_single.click =>
send_data = send_data =
student_email: @$field_student_select.val() student_email: @$field_student_select_grade.val()
problem_urlname: @$field_problem_select_single.val() problem_urlname: @$field_problem_select_single.val()
if not send_data.student_email if not send_data.student_email
......
...@@ -240,7 +240,7 @@ function goto( mode) ...@@ -240,7 +240,7 @@ function goto( mode)
<hr width="40%" style="align:left"> <hr width="40%" style="align:left">
%endif %endif
<H2>${_("Student-specific grade inspection and adjustment")}</h2> <h2>${_("Student-specific grade inspection and adjustment")}</h2>
<p> <p>
${_("Specify the {platform_name} email address or username of a student here:").format(platform_name=settings.PLATFORM_NAME)} ${_("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"> <input type="text" name="unique_student_identifier">
......
...@@ -38,8 +38,21 @@ ...@@ -38,8 +38,21 @@
## ${ section_data['offline_grades'] } ## ${ section_data['offline_grades'] }
## </div> ## </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']): %if len(section_data['course_errors']):
<div class="course-errors-wrapper"> <div class="course-errors-wrapper">
<hr>
<p>
<div class="toggle-wrapper"> <div class="toggle-wrapper">
<h2 class="title">${_("Course Warnings")}:</h2> <h2 class="title">${_("Course Warnings")}:</h2>
<div class="triangle"></div> <div class="triangle"></div>
...@@ -52,5 +65,10 @@ ...@@ -52,5 +65,10 @@
</div> </div>
%endfor %endfor
</div> </div>
<p>
</div> </div>
<br>
%endif %endif
...@@ -2,25 +2,47 @@ ...@@ -2,25 +2,47 @@
<%page args="section_data"/> <%page args="section_data"/>
<div class="student-specific-container action-type-container"> <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> <div class="request-response-error"></div>
<p>
<input type="text" name="student-select" placeholder="${_("Student Email")}"> <!-- 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> <br>
<div class="progress-link-wrapper"> <div class="progress-link-wrapper">
<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> <a href="" class="progress-link" data-endpoint="${ section_data['get_student_progress_url_url'] }"> ${_("Student Progress Page")} </a>
</p>
</div> </div>
<br> <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="enroll" value="${_("Enroll")}" data-endpoint="${ section_data['enrollment_url'] }">
<input type="button" name="unenroll" value="${_("Unenroll")}" data-endpoint="${ section_data['enrollment_url'] }"> <input type="button" name="unenroll" value="${_("Unenroll")}" data-endpoint="${ section_data['enrollment_url'] }">
## <select class="problems"> </p>
## <option>Getting problems...</option> -->
## </select>
<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")}"> <input type="text" name="problem-select-single" placeholder="${_("Problem urlname")}">
</p>
<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( ${_('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>", location1="<tt>i4x://university/course/problem/problemname</tt>",
...@@ -29,20 +51,31 @@ ...@@ -29,20 +51,31 @@
urlname2="<tt>notaproblem/someothername</tt>") urlname2="<tt>notaproblem/someothername</tt>")
} }
</p> </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>
<p> ${_('You may also delete the entire state of a student for the specified module:')} </p> ${_("Next, select an action to perform for the given user and problem:")}
<input type="button" class="molly-guard" name="delete-state-single" value="${_("Delete Student State for Module")}" data-endpoint="${ section_data['reset_student_attempts_url'] }"> </p>
%endif
<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']: %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'] }"> <input type="button" name="rescore-problem-single" value="${_("Rescore Student Submission")}" data-endpoint="${ section_data['rescore_problem_url'] }">
%endif %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']: %if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:
<p> <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:")} "To see status for all tasks submitted for this problem and student, click on this button:")}
</p> </p>
...@@ -76,18 +109,11 @@ ...@@ -76,18 +109,11 @@
</p> </p>
<p> <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")}: "To see status for all tasks submitted for this problem, click on this button")}:
</p> </p>
<input type="button" name="task-history-all" value="${_("Show Background Task History for Problem")}" data-endpoint="${ section_data['list_instructor_tasks_url'] }"> <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> <div class="task-history-all-table"></div>
</p> </p>
</div> </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 %endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment