diff options
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 4c1b7f7..1ba9890 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -175,11 +175,14 @@ def quizlist_user(request, enrolled=None, msg=None): ).order_by('-id') title = 'All Courses' - for c in courses: - _percent = c.get_completion_percent(user) if user in c.students.all() else None + for course in courses: + if user in course.students.all(): + _percent = course.get_completion_percent(user) + else: + _percent = None courses_data.append( { - 'data': c, + 'data': course, 'completion_percentage': _percent, } ) |