Commit 74714c4e by Adam Palay Committed by Sarina Canelake

Update data download dash for parity (LMS-1203)

parent 6d2cd987
...@@ -23,10 +23,12 @@ from courseware.access import has_access ...@@ -23,10 +23,12 @@ from courseware.access import has_access
from courseware.courses import get_course_with_access, get_course_by_id from courseware.courses import get_course_with_access, get_course_by_id
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django_comment_client.utils import has_forum_access from django_comment_client.utils import has_forum_access
from django_comment_common.models import (Role, from django_comment_common.models import (
FORUM_ROLE_ADMINISTRATOR, Role,
FORUM_ROLE_MODERATOR, FORUM_ROLE_ADMINISTRATOR,
FORUM_ROLE_COMMUNITY_TA) FORUM_ROLE_MODERATOR,
FORUM_ROLE_COMMUNITY_TA,
)
from courseware.models import StudentModule from courseware.models import StudentModule
from student.models import unique_id_for_user from student.models import unique_id_for_user
......
...@@ -18,6 +18,7 @@ class DataDownload ...@@ -18,6 +18,7 @@ class DataDownload
@$section.data 'wrapper', @ @$section.data 'wrapper', @
# gather elements # gather elements
@$list_studs_btn = @$section.find("input[name='list-profiles']'") @$list_studs_btn = @$section.find("input[name='list-profiles']'")
@$list_studs_csv_btn = @$section.find("input[name='list-profiles-csv']'")
@$list_anon_btn = @$section.find("input[name='list-anon-ids']'") @$list_anon_btn = @$section.find("input[name='list-anon-ids']'")
@$grade_config_btn = @$section.find("input[name='dump-gradeconf']'") @$grade_config_btn = @$section.find("input[name='dump-gradeconf']'")
@$calculate_grades_csv_btn = @$section.find("input[name='calculate-grades-csv']'") @$calculate_grades_csv_btn = @$section.find("input[name='calculate-grades-csv']'")
...@@ -43,6 +44,13 @@ class DataDownload ...@@ -43,6 +44,13 @@ class DataDownload
# this handler binds to both the download # this handler binds to both the download
# and the csv button # and the csv button
@$list_studs_csv_btn.click (e) =>
url = @$list_studs_btn.data 'endpoint'
# handle csv special case
# redirect the document to the csv file.
url += '/csv'
location.href = url
@$list_studs_btn.click (e) => @$list_studs_btn.click (e) =>
url = @$list_studs_btn.data 'endpoint' url = @$list_studs_btn.data 'endpoint'
......
...@@ -6,14 +6,19 @@ ...@@ -6,14 +6,19 @@
<h2>${_("Data Download")}</h2> <h2>${_("Data Download")}</h2>
<div class="request-response-error msg msg-error copy" id="data-request-response-error"></div> <div class="request-response-error msg msg-error copy" id="data-request-response-error"></div>
<p>${_("The following button displays a list of all students enrolled in this course, along with profile information such as email address and username. The data can also be downloaded as a CSV file.")}</p> <p>${_("The following button generates a CSV file of all students enrolled in this course, along with profile information such as email address and username.")}</p>
<p><input type="button" name="list-profiles" value="${_("List enrolled students' profile information")}" data-endpoint="${ section_data['get_students_features_url'] }"> <p><input type="button" name="list-profiles-csv" value="${_("Download profile information as a CSV")}" data-endpoint="${ section_data['get_students_features_url'] }" data-csv="true"></p>
<input type="button" name="list-profiles" value="${_("Download profile information as a CSV")}" data-csv="true"></p>
% if not disable_buttons:
<p>${_("For smaller courses, profile information for enrolled students can be listed directly on this page:")}</p>
<p><input type="button" name="list-profiles" value="${_("List enrolled students' profile information")}" data-endpoint="${ section_data['get_students_features_url'] }"></p>
%endif
<div class="data-display-table" id="data-student-profiles-table"></div> <div class="data-display-table" id="data-student-profiles-table"></div>
<br> <br>
<p>${_("Displays the grading configuration for the course. The grading configuration is the breakdown of graded subsections of the course (such as exams and problem sets), and can be changed on the 'Grading' page (under 'Settings') in Studio.")}</p> <p>${_("The following button displays the grading configuration for the course. The grading configuration is the breakdown of graded subsections of the course (such as exams and problem sets), and can be changed on the 'Grading' page (under 'Settings') in Studio.")}</p>
<p><input type="button" name="dump-gradeconf" value="${_("Grading Configuration")}" data-endpoint="${ section_data['get_grading_config_url'] }"></p> <p><input type="button" name="dump-gradeconf" value="${_("Grading Configuration")}" data-endpoint="${ section_data['get_grading_config_url'] }"></p>
<div class="data-display-text" id="data-grade-config-text"></div> <div class="data-display-text" id="data-grade-config-text"></div>
......
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