Update data download dash for parity (LMS-1203)

This commit is contained in:
Adam Palay
2014-03-06 09:47:15 -05:00
committed by Sarina Canelake
parent 6d2cd987dc
commit 74714c4ed7
3 changed files with 23 additions and 8 deletions

View File

@@ -23,10 +23,12 @@ from courseware.access import has_access
from courseware.courses import get_course_with_access, get_course_by_id
from django.contrib.auth.models import User
from django_comment_client.utils import has_forum_access
from django_comment_common.models import (Role,
FORUM_ROLE_ADMINISTRATOR,
FORUM_ROLE_MODERATOR,
FORUM_ROLE_COMMUNITY_TA)
from django_comment_common.models import (
Role,
FORUM_ROLE_ADMINISTRATOR,
FORUM_ROLE_MODERATOR,
FORUM_ROLE_COMMUNITY_TA,
)
from courseware.models import StudentModule
from student.models import unique_id_for_user

View File

@@ -18,6 +18,7 @@ class DataDownload
@$section.data 'wrapper', @
# gather elements
@$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']'")
@$grade_config_btn = @$section.find("input[name='dump-gradeconf']'")
@$calculate_grades_csv_btn = @$section.find("input[name='calculate-grades-csv']'")
@@ -43,6 +44,13 @@ class DataDownload
# this handler binds to both the download
# 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) =>
url = @$list_studs_btn.data 'endpoint'

View File

@@ -6,14 +6,19 @@
<h2>${_("Data Download")}</h2>
<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'] }">
<input type="button" name="list-profiles" value="${_("Download profile information as a CSV")}" data-csv="true"></p>
<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>
% 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>
<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>
<div class="data-display-text" id="data-grade-config-text"></div>