From 8c1c1f6c8b1de16fba5f93e58a0cd3cb751e02d7 Mon Sep 17 00:00:00 2001 From: adityacp Date: Wed, 10 Feb 2021 19:02:29 +0530 Subject: Change in templates, views - Revamp UI in course page - Fix a bug where a trial module is created without setting is_trial in models - Fix a bug in question statistics where only completed answerpaper data is needed --- yaksh/models.py | 2 +- yaksh/static/yaksh/css/custom.css | 2 + yaksh/templates/yaksh/courses.html | 227 ++++++++++------------ yaksh/templates/yaksh/micromonitor.html | 6 +- yaksh/templates/yaksh/monitor.html | 333 ++++++++++++++++---------------- yaksh/views.py | 12 +- 6 files changed, 284 insertions(+), 298 deletions(-) diff --git a/yaksh/models.py b/yaksh/models.py index b4d0f76..5934ae2 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -2027,7 +2027,7 @@ class AnswerPaperManager(models.Manager): que_ids = [que.id for que in all_questions] papers = self.filter( question_paper_id=questionpaper_id, course_id=course_id, - attempt_number=attempt_number + attempt_number=attempt_number, status=status ).values_list("id", flat=True) answers = Answer.objects.filter( answerpaper__id__in=papers, question_id__in=que_ids diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index 78eaba4..c722197 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -211,3 +211,5 @@ iframe { width: 100%; text-align: center; } + +.dropdown:hover .dropdown-menu {display: block;} \ No newline at end of file diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index 02cbad9..b9e48d6 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -101,9 +101,14 @@
{% for course in courses %}
-
+
- {{course.name}} + + +   + {{course.name}} + +
{% if user.id != course.creator.id %} @@ -115,86 +120,70 @@ {% endif %}
-
-
-
-
- Starts On: - {{course.start_enroll_time}} -
- Ends On: - {{course.end_enroll_time}} -
-
-
-
-
- {% if course.active %} - - Active - - {% else %} - - Inactive - - {% endif %} -
-
- + +
+
+
+ Status: + {% if course.active %} + + Active + + {% else %} + + Inactive + + {% endif %} +
+ Creator: + {{course.creator.get_full_name}} +
+ Starts On: + {{course.start_enroll_time}} +
+ Ends On: + {{course.end_enroll_time}}
-
{% endfor %}
@@ -207,8 +196,13 @@
- +
+
+
+ Status: {% if course.active %} Active @@ -231,21 +267,10 @@ Inactive {% endif %} -
- -
-
-
-
-
+
+ Creator: + {{course.creator.get_full_name}} +
Starts On: {{course.start_enroll_time}}
@@ -253,46 +278,6 @@ {{course.end_enroll_time}}
-
-
- - - -
-
- - -
-
-

diff --git a/yaksh/templates/yaksh/micromonitor.html b/yaksh/templates/yaksh/micromonitor.html index cc059aa..bc64469 100644 --- a/yaksh/templates/yaksh/micromonitor.html +++ b/yaksh/templates/yaksh/micromonitor.html @@ -1,9 +1,9 @@ {% if micromanager %} {% if micromanager.can_student_attempt %} - Revoke + Revoke {% else %} - Allow + Allow {% endif %} {% else %} - Allow + Allow {% endif %} diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index ca5a7fc..9b10b58 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -52,8 +52,9 @@ $(document).ready(function() {% if quiz %} {% if papers %}
-
-
+
+
+
@@ -63,186 +64,180 @@ $(document).ready(function() -
Course Name: Quiz Name:  {{quiz.description}}
-
-
-
-
- - + - - - - - - - - - -
Number of papers:   {{total_papers}}
Papers Completed:   - {{completed_papers}} -
Papers in progress:   - {{ inprogress_papers }} -
+ + + Papers Completed:   + + {{completed_papers}} + + + + Papers in progress:   + + {{ inprogress_papers }} + + + +
-
-
-
- -
-
- -  Question Statistics - +
+
+
+ +
+ +
+
+ Auto-Refreshes every 5 minutes +
+
-
-
- Auto-Refreshes every 5 minutes +
+
+
+

+ + - Download the CSV file from the button above
+ - Edit and upload the same
+
+

+
+
+
+ {% csrf_token %} + + +
-
-
-
-
-

- - - Download the CSV file from the button above
- - Edit and upload the same
-
-

+
+
+ {% if total_papers > 10 %} +
+ {% else %} +
+ {% endif %} + + + + + + + + + + + + + + + + {% for paper in papers %} + + + {% with paper.user as student %} + + + {% endwith %} + + + + + + + + {% endfor %} + +
Sr No. Name  Roll No  Marks  Questions Attempted  Time Left  Status  Time Extension  Special Attempt 
{{forloop.counter}} + + + {{ student.get_full_name.title }} + + {{ student.profile.roll_number }} {{ paper.marks_obtained }} + {% get_dict_value questions_attempted paper.id as que_attempt %} + {{que_attempt}} out of {{questions_count}} + {{ paper.time_left }} {% if paper.is_attempt_inprogress %} + Inprogress + {% else %} + Completed + {% endif %} + +
+ {% csrf_token %} +
+ +
+ +
+
+
+
{% specail_attempt_monitor paper.user.id course.id quiz.id %}
+
-
-
+ +