Commit 3caf14e3 by wwj718

variable name error

The variable name --- `dist` error
`dist` = {}  will cover `dist = grades.answer_distributions(course.id)`
parent 8a685cec
...@@ -1082,14 +1082,14 @@ def get_answers_distribution(request, course_key): ...@@ -1082,14 +1082,14 @@ def get_answers_distribution(request, course_key):
""" """
course = get_course_with_access(request.user, 'staff', course_key) course = get_course_with_access(request.user, 'staff', course_key)
dist = grades.answer_distributions(course.id) course_answer_distributions = grades.answer_distributions(course.id)
dist = {} dist = {}
dist['header'] = ['url_name', 'display name', 'answer id', 'answer', 'count'] dist['header'] = ['url_name', 'display name', 'answer id', 'answer', 'count']
dist['data'] = [ dist['data'] = [
[url_name, display_name, answer_id, a, answers[a]] [url_name, display_name, answer_id, a, answers[a]]
for (url_name, display_name, answer_id), answers in sorted(dist.items()) for (url_name, display_name, answer_id), answers in sorted(course_answer_distributions.items())
for a in answers for a in answers
] ]
return dist return dist
......
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