From a29473b7ac933b31368ca163c758e8eadb4c411e Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 22 Dec 2020 12:48:23 +0530 Subject: Fix UI in lesson statistics --- stats/templates/view_lesson_tracking.html | 110 ++++++++++++---------- yaksh/models.py | 2 +- yaksh/templates/yaksh/show_lesson_statistics.html | 71 ++++++++------ 3 files changed, 103 insertions(+), 80 deletions(-) diff --git a/stats/templates/view_lesson_tracking.html b/stats/templates/view_lesson_tracking.html index 75573c0..b59fa7a 100644 --- a/stats/templates/view_lesson_tracking.html +++ b/stats/templates/view_lesson_tracking.html @@ -31,59 +31,65 @@  Back

- {% include "yaksh/paginator.html" %} -
-
-
-
-
+
+
+
+
+
+
- +
+
+
+
+ +
+ {% include "yaksh/paginator.html" %}
diff --git a/yaksh/models.py b/yaksh/models.py index 2978f43..a29e910 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2830,7 +2830,7 @@ class TOCManager(models.Manager): if answers.exists(): answers = answers.values( "student__first_name", "student__last_name", "student__email", - "student_id", "toc_id" + "student_id", "student__profile__roll_number", "toc_id" ) df = pd.DataFrame(answers) answers = df.drop_duplicates().to_dict(orient='records') diff --git a/yaksh/templates/yaksh/show_lesson_statistics.html b/yaksh/templates/yaksh/show_lesson_statistics.html index dfce52c..0da20ee 100644 --- a/yaksh/templates/yaksh/show_lesson_statistics.html +++ b/yaksh/templates/yaksh/show_lesson_statistics.html @@ -81,8 +81,8 @@ {% else %}
- {{question.summary}} -
+ {{question.summary}} +
{% if question.language == "other" %} Topic: {{question.topic}} {% else %} @@ -132,15 +132,21 @@ {{tc.options}} {% if per_tc_ans %} {% get_tc_percent tc.id per_tc_ans as percent %} -
- {% if percent %} -
- {{percent|floatformat}}% +
+
+
+ + {% if percent %} {{percent|floatformat}} {% else %} 0 {% endif %}% + +
+
+
+ {% if percent %} +
+
+ {% endif %}
- {% else %} - 0% - {% endif %}
{% endif %} {% elif question.type == "integer" %} @@ -180,25 +186,36 @@

{% endif %} {% include "yaksh/paginator.html" %} -
- - - - - - - - - {% for data in objects.object_list %} + {% if objects.object_list|length > 10 %} +
+ {% else %} +
+ {% endif %} +
Sr No.Student Name Email Latest Submission 
+ - - - - {% get_answers data.toc_id data.student_id as user_answer %} - + + + + + - {% endfor %} -
{{ forloop.counter }}{{data.student__first_name}} {{data.student__last_name}}{{data.student__email}}{{ user_answer.0 }}Sr No.Student Name Roll No Email Latest Submission 
+ + + {% for data in objects.object_list %} + + {{ forloop.counter }} + {{data.student__first_name}} {{data.student__last_name}} + {{data.student__profile__roll_number}} + {{data.student__email}} + {% get_answers data.toc_id data.student_id as user_answer %} + {{ user_answer.0 }} + + {% endfor %} + + +
+
{% include "yaksh/paginator.html" %} {% endif %}
-- cgit