Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d8904d90
Commit
d8904d90
authored
Aug 11, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up Grade Downloads section of legacy dash
parent
a15110f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
97 deletions
+6
-97
lms/djangoapps/instructor/tests/test_legacy_download_csv.py
+0
-72
lms/djangoapps/instructor/tests/test_legacy_xss.py
+0
-3
lms/djangoapps/instructor/views/legacy.py
+0
-16
lms/templates/courseware/legacy_instructor_dashboard.html
+6
-6
No files found.
lms/djangoapps/instructor/tests/test_legacy_download_csv.py
deleted
100644 → 0
View file @
a15110f0
"""
Unit tests for instructor dashboard
Based on (and depends on) unit tests for courseware.
Notes for running by hand:
./manage.py lms --settings test test lms/djangoapps/instructor
"""
from
django.test.utils
import
override_settings
# Need access to internal func to put users in the right group
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MOCK_MODULESTORE
from
student.roles
import
CourseStaffRole
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
)
class
TestInstructorDashboardGradeDownloadCSV
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
'''
Check for download of csv
'''
def
setUp
(
self
):
# clear_existing_modulestores()
self
.
toy
=
CourseFactory
.
create
(
org
=
'edX'
,
course
=
'toy'
,
display_name
=
'2012_Fall'
)
# Create two accounts
self
.
student
=
'view@test.com'
self
.
instructor
=
'view2@test.com'
self
.
password
=
'foo'
self
.
create_account
(
'u1'
,
self
.
student
,
self
.
password
)
self
.
create_account
(
'u2'
,
self
.
instructor
,
self
.
password
)
self
.
activate_user
(
self
.
student
)
self
.
activate_user
(
self
.
instructor
)
CourseStaffRole
(
self
.
toy
.
id
)
.
add_users
(
User
.
objects
.
get
(
email
=
self
.
instructor
))
self
.
logout
()
self
.
login
(
self
.
instructor
,
self
.
password
)
self
.
enroll
(
self
.
toy
)
def
test_download_grades_csv
(
self
):
course
=
self
.
toy
url
=
reverse
(
'instructor_dashboard_legacy'
,
kwargs
=
{
'course_id'
:
course
.
id
.
to_deprecated_string
()})
msg
=
"url = {0}
\n
"
.
format
(
url
)
response
=
self
.
client
.
post
(
url
,
{
'action'
:
'Download CSV of all student grades for this course'
})
msg
+=
"instructor dashboard download csv grades: response = '{0}'
\n
"
.
format
(
response
)
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/csv'
,
msg
)
cdisp
=
response
[
'Content-Disposition'
]
msg
+=
"Content-Disposition = '
%
s'
\n
"
%
cdisp
self
.
assertEqual
(
cdisp
,
'attachment; filename=grades_{0}.csv'
.
format
(
course
.
id
.
to_deprecated_string
()),
msg
)
body
=
response
.
content
.
replace
(
'
\r
'
,
''
)
msg
+=
"body = '{0}'
\n
"
.
format
(
body
)
# All the not-actually-in-the-course hw and labs come from the
# default grading policy string in graders.py
expected_body
=
'''"ID","Username","Full Name","edX email","External email","HW 01","HW 02","HW 03","HW 04","HW 05","HW 06","HW 07","HW 08","HW 09","HW 10","HW 11","HW 12","HW Avg","Lab 01","Lab 02","Lab 03","Lab 04","Lab 05","Lab 06","Lab 07","Lab 08","Lab 09","Lab 10","Lab 11","Lab 12","Lab Avg","Midterm","Final"
"2","u2","username","view2@test.com","","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"
'''
self
.
assertEqual
(
body
,
expected_body
,
msg
)
lms/djangoapps/instructor/tests/test_legacy_xss.py
View file @
d8904d90
...
@@ -63,6 +63,3 @@ class TestXss(ModuleStoreTestCase):
...
@@ -63,6 +63,3 @@ class TestXss(ModuleStoreTestCase):
def
test_dump_list_of_enrolled
(
self
):
def
test_dump_list_of_enrolled
(
self
):
self
.
_test_action
(
"Dump list of enrolled students"
)
self
.
_test_action
(
"Dump list of enrolled students"
)
def
test_dump_grades
(
self
):
self
.
_test_action
(
"Dump Grades for all students in this course"
)
lms/djangoapps/instructor/views/legacy.py
View file @
d8904d90
...
@@ -227,12 +227,6 @@ def instructor_dashboard(request, course_id):
...
@@ -227,12 +227,6 @@ def instructor_dashboard(request, course_id):
datatable
[
'title'
]
=
_
(
'List of students enrolled in {course_key}'
)
.
format
(
course_key
=
course_key
.
to_deprecated_string
())
datatable
[
'title'
]
=
_
(
'List of students enrolled in {course_key}'
)
.
format
(
course_key
=
course_key
.
to_deprecated_string
())
track
.
views
.
server_track
(
request
,
"list-students"
,
{},
page
=
"idashboard"
)
track
.
views
.
server_track
(
request
,
"list-students"
,
{},
page
=
"idashboard"
)
elif
'Dump Grades'
in
action
:
log
.
debug
(
action
)
datatable
=
get_student_grade_summary_data
(
request
,
course
,
get_grades
=
True
,
use_offline
=
use_offline
)
datatable
[
'title'
]
=
_
(
'Summary Grades of students enrolled in {course_key}'
)
.
format
(
course_key
=
course_key
.
to_deprecated_string
())
track
.
views
.
server_track
(
request
,
"dump-grades"
,
{},
page
=
"idashboard"
)
elif
'Dump all RAW grades'
in
action
:
elif
'Dump all RAW grades'
in
action
:
log
.
debug
(
action
)
log
.
debug
(
action
)
datatable
=
get_student_grade_summary_data
(
request
,
course
,
get_grades
=
True
,
datatable
=
get_student_grade_summary_data
(
request
,
course
,
get_grades
=
True
,
...
@@ -240,11 +234,6 @@ def instructor_dashboard(request, course_id):
...
@@ -240,11 +234,6 @@ def instructor_dashboard(request, course_id):
datatable
[
'title'
]
=
_
(
'Raw Grades of students enrolled in {course_key}'
)
.
format
(
course_key
=
course_key
)
datatable
[
'title'
]
=
_
(
'Raw Grades of students enrolled in {course_key}'
)
.
format
(
course_key
=
course_key
)
track
.
views
.
server_track
(
request
,
"dump-grades-raw"
,
{},
page
=
"idashboard"
)
track
.
views
.
server_track
(
request
,
"dump-grades-raw"
,
{},
page
=
"idashboard"
)
elif
'Download CSV of all student grades'
in
action
:
track
.
views
.
server_track
(
request
,
"dump-grades-csv"
,
{},
page
=
"idashboard"
)
return
return_csv
(
'grades_{0}.csv'
.
format
(
course_key
.
to_deprecated_string
()),
get_student_grade_summary_data
(
request
,
course
,
use_offline
=
use_offline
))
elif
'Download CSV of all RAW grades'
in
action
:
elif
'Download CSV of all RAW grades'
in
action
:
track
.
views
.
server_track
(
request
,
"dump-grades-csv-raw"
,
{},
page
=
"idashboard"
)
track
.
views
.
server_track
(
request
,
"dump-grades-csv-raw"
,
{},
page
=
"idashboard"
)
return
return_csv
(
'grades_{0}_raw.csv'
.
format
(
course_key
.
to_deprecated_string
()),
return
return_csv
(
'grades_{0}_raw.csv'
.
format
(
course_key
.
to_deprecated_string
()),
...
@@ -254,11 +243,6 @@ def instructor_dashboard(request, course_id):
...
@@ -254,11 +243,6 @@ def instructor_dashboard(request, course_id):
track
.
views
.
server_track
(
request
,
"dump-answer-dist-csv"
,
{},
page
=
"idashboard"
)
track
.
views
.
server_track
(
request
,
"dump-answer-dist-csv"
,
{},
page
=
"idashboard"
)
return
return_csv
(
'answer_dist_{0}.csv'
.
format
(
course_key
.
to_deprecated_string
()),
get_answers_distribution
(
request
,
course_key
))
return
return_csv
(
'answer_dist_{0}.csv'
.
format
(
course_key
.
to_deprecated_string
()),
get_answers_distribution
(
request
,
course_key
))
elif
'Dump description of graded assignments configuration'
in
action
:
# what is "graded assignments configuration"?
track
.
views
.
server_track
(
request
,
"dump-graded-assignments-config"
,
{},
page
=
"idashboard"
)
msg
+=
dump_grading_context
(
course
)
#----------------------------------------
#----------------------------------------
# export grades to remote gradebook
# export grades to remote gradebook
...
...
lms/templates/courseware/legacy_instructor_dashboard.html
View file @
d8904d90
...
@@ -202,16 +202,14 @@ function goto( mode)
...
@@ -202,16 +202,14 @@ function goto( mode)
% endif
% endif
<p>
<p>
<a
href=
"${reverse('spoc_gradebook', kwargs=dict(course_id=course.id.to_deprecated_string()))}"
class=
"${'is-disabled' if disable_buttons else ''}"
>
${_("Gradebook")}
</a>
${_("To view the Gradebook (small courses only), please visit the 'Student Admin' section of the instructor dashboard.")}
</p>
</p>
<p>
<p>
<input
type=
"submit"
name=
"action"
value=
"Dump list of enrolled students"
class=
"${'is-disabled' if disable_buttons else ''}"
>
<input
type=
"submit"
name=
"action"
value=
"Dump list of enrolled students"
class=
"${'is-disabled' if disable_buttons else ''}"
>
</p>
</p>
<p>
<p
class=
"is-deprecated"
>
<input
type=
"submit"
name=
"action"
value=
"Dump Grades for all students in this course"
class=
"${'is-disabled' if disable_buttons else ''}"
>
${_("To download student grades, please visit the 'Data Download' section of the instructor dashboard.")}
<input
type=
"submit"
name=
"action"
value=
"Download CSV of all student grades for this course"
class=
"${'is-disabled' if disable_buttons else ''}"
>
</p>
</p>
<p>
<p>
...
@@ -223,7 +221,9 @@ function goto( mode)
...
@@ -223,7 +221,9 @@ function goto( mode)
%if not settings.FEATURES.get('ENABLE_ASYNC_ANSWER_DISTRIBUTION'):
%if not settings.FEATURES.get('ENABLE_ASYNC_ANSWER_DISTRIBUTION'):
<input
type=
"submit"
name=
"action"
value=
"Download CSV of answer distributions"
class=
"${'is-disabled' if disable_buttons else ''}"
>
<input
type=
"submit"
name=
"action"
value=
"Download CSV of answer distributions"
class=
"${'is-disabled' if disable_buttons else ''}"
>
%endif
%endif
<input
type=
"submit"
name=
"action"
value=
"Dump description of graded assignments configuration"
>
<p
class=
"deprecated"
>
${_("To view the graded assignments configuration, please visit the 'Data Download' section of the instructor dashboard.")}
</p>
</p>
</p>
<hr
width=
"40%"
style=
"align:left"
>
<hr
width=
"40%"
style=
"align:left"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment