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
2c2c2382
Commit
2c2c2382
authored
Dec 05, 2013
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1817 from edx/sarina/lms-197
Encode header row (LMS-197)
parents
a040f3f6
0426e51d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lms/djangoapps/instructor/views/legacy.py
+3
-1
lms/djangoapps/instructor_task/tasks_helper.py
+2
-1
No files found.
lms/djangoapps/instructor/views/legacy.py
View file @
2c2c2382
...
...
@@ -133,8 +133,10 @@ def instructor_dashboard(request, course_id):
else
:
response
=
file_pointer
writer
=
csv
.
writer
(
response
,
dialect
=
'excel'
,
quotechar
=
'"'
,
quoting
=
csv
.
QUOTE_ALL
)
writer
.
writerow
(
datatable
[
'header'
])
encoded_row
=
[
unicode
(
s
)
.
encode
(
'utf-8'
)
for
s
in
datatable
[
'header'
]]
writer
.
writerow
(
encoded_row
)
for
datarow
in
datatable
[
'data'
]:
# 's' here may be an integer, float (eg score) or string (eg student name)
encoded_row
=
[
unicode
(
s
)
.
encode
(
'utf-8'
)
for
s
in
datarow
]
writer
.
writerow
(
encoded_row
)
return
response
...
...
lms/djangoapps/instructor_task/tasks_helper.py
View file @
2c2c2382
...
...
@@ -523,7 +523,8 @@ def push_grades_to_s3(_xmodule_instance_args, _entry_id, course_id, _task_input,
# We were able to successfully grade this student for this course.
num_succeeded
+=
1
if
not
header
:
header
=
[
section
[
'label'
]
for
section
in
gradeset
[
u'section_breakdown'
]]
# Encode the header row in utf-8 encoding in case there are unicode characters
header
=
[
section
[
'label'
]
.
encode
(
'utf-8'
)
for
section
in
gradeset
[
u'section_breakdown'
]]
rows
.
append
([
"id"
,
"email"
,
"username"
,
"grade"
]
+
header
)
percents
=
{
...
...
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