From c04f586f8ac85bf0fd0290b97c8d727e4e21274c Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 9 Jan 2019 15:18:30 +0530 Subject: Multiple changes in new UI: - Deprecate usage of 'course_completion_percent' custom template tag - Replace old code in course_detail.html --- yaksh/templates/yaksh/course_detail.html | 66 +++++++++++++------------------- yaksh/templatetags/custom_filters.py | 5 --- 2 files changed, 26 insertions(+), 45 deletions(-) (limited to 'yaksh') diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index 0fee438..54af854 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -141,61 +141,47 @@ Sr No. - Students - Total + Email + Current Unit + Course Completion Percentage Grade - Modules - - - - - - - {% if modules %} - {% for module in modules %} - - {{module.name}} - ({{module.get_learning_units|length}} Units) -
- - View Units - - {% endfor %} - {% else %} - - {% endif %} - {% for student in students %} + {% for student, grade, percent, unit in student_details %} {{forloop.counter}}. + + + {% if student.email %} + {{ student.email }} + {% else %} + {{ student.get_full_name|title}} + {% endif %} + + + {{ student.get_full_name|title }} + {% if unit %} + {% if unit.type == 'quiz' %} + {{unit.quiz.description}} + {% else %} + {{unit.lesson.name}} + {% endif %} + {% else %} + NA + {% endif%} - {% course_completion_percent course student as c_percent %} - {{c_percent}} % + {{ percent }} % - {% course_grade course student as grade %} - {{grade}} + {{ grade }} - {% if modules %} - {% for module in modules %} - - {% module_completion_percent course module student as m_percent %} - {{m_percent}} % -
- - View Unit Status - - {% endfor %} - {% else %} - ------- - {% endif %} {% endfor %} diff --git a/yaksh/templatetags/custom_filters.py b/yaksh/templatetags/custom_filters.py index b4b189a..dcae7f9 100644 --- a/yaksh/templatetags/custom_filters.py +++ b/yaksh/templatetags/custom_filters.py @@ -60,11 +60,6 @@ def module_completion_percent(course, module, user): return module.get_module_complete_percent(course, user) -@register.simple_tag -def course_completion_percent(course, user): - return course.percent_completed(user) - - @register.simple_tag def get_ordered_testcases(question, answerpaper): return question.get_ordered_test_cases(answerpaper) -- cgit