Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lms/djangoapps/instructor/views/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ def return_csv(func, datatable, file_pointer=None):
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
Expand Down
3 changes: 2 additions & 1 deletion lms/djangoapps/instructor_task/tasks_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ def update_task_progress():
# 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']]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this as I was able to trigger a failure in the beta dash by making a "Hómëwørk" section

rows.append(["id", "email", "username", "grade"] + header)

percents = {
Expand Down