diff options
author | adityacp | 2021-01-27 16:36:51 +0530 |
---|---|---|
committer | adityacp | 2021-01-27 16:36:51 +0530 |
commit | fa8020b9f39b4e75a0a5d8b26653cc61cb9ae981 (patch) | |
tree | 082a278c82f55a9a48f71901cd734364e6aab869 /yaksh/templates | |
parent | 7f28b418b616823f542faea8311e881faf6286c2 (diff) | |
download | online_test-fa8020b9f39b4e75a0a5d8b26653cc61cb9ae981.tar.gz online_test-fa8020b9f39b4e75a0a5d8b26653cc61cb9ae981.tar.bz2 online_test-fa8020b9f39b4e75a0a5d8b26653cc61cb9ae981.zip |
Refactor monitor for a quiz
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 88 |
2 files changed, 50 insertions, 42 deletions
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 86b7c47..4e1db2b 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -2,9 +2,9 @@ {% load custom_filters %} {% load static %} -{% block title %} Grader {% endblock %} +{% block title %} Quizzes {% endblock %} -{% block pagetitle %} Grader {% endblock pagetitle %} +{% block pagetitle %} Quizzes {% endblock pagetitle %} {% block script %} <script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index 5e8fdc3..ca5a7fc 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -39,9 +39,20 @@ $(document).ready(function() {% block content %} <div class="container-fluid"> + {% if messages %} + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + {% endif %} {% if quiz %} {% if papers %} - <div class="card"> + <div class="row"> + <div class="card col"> <div class="table-responsive"> <table id="course-detail" class="table"> <tr> @@ -52,40 +63,32 @@ $(document).ready(function() <td><b>Quiz Name: </b></td> <td>{{quiz.description}}</td> </tr> - <tr> - <td><b>Number of papers:  </b></td> - <td>{{papers|length}}</td> - </tr> - <tr> - <td><b>Papers Completed:  </b></td> - <td> - {% completed papers as completed_papers %} - <b>{{completed_papers}}</b> - </td> - </tr> - <tr> - <td><b>Papers in progress:  </b></td> - <td> - {% inprogress papers as inprogress_papers %} - <b>{{ inprogress_papers }}</b> - </td> - </tr> </table> </div> </div> - <br> - <br> - {% if messages %} - {% for message in messages %} - <div class="alert alert-dismissible alert-{{ message.tags }}"> - <button type="button" class="close" data-dismiss="alert"> - <i class="fa fa-close"></i> - </button> - <strong>{{ message }}</strong> - </div> - {% endfor %} - {% endif %} - <br> + <div class="card col"> + <div class="table-responsive"> + <table id="course-detail" class="table"> + <tr> + <td><b>Number of papers:  </b></td> + <td>{{total_papers}}</td> + </tr> + <tr> + <td><b>Papers Completed:  </b></td> + <td> + <b>{{completed_papers}}</b> + </td> + </tr> + <tr> + <td><b>Papers in progress:  </b></td> + <td> + <b>{{ inprogress_papers }}</b> + </td> + </tr> + </table> + </div> + </div> + </div> <div class="row"> <div class="col-md-4"> <button type="button" class="btn btn-info" data-toggle="modal" data-target="#csvModal"> @@ -133,7 +136,7 @@ $(document).ready(function() </div> <br> <div class="card"> - {% if latest_attempts|length > 10 %} + {% if total_papers > 10 %} <div class="table-responsive" style="height: 800px"> {% else %} <div class="table-responsive"> @@ -145,7 +148,7 @@ $(document).ready(function() <th> Name <i class="fa fa-sort"></i> </th> <th> Roll No <i class="fa fa-sort"></i> </th> <th> Marks <i class="fa fa-sort"></i> </th> - <th> Attempts <i class="fa fa-sort"></i> </th> + <th> Questions Attempted <i class="fa fa-sort"></i> </th> <th> Time Left <i class="fa fa-sort"></i> </th> <th> Status <i class="fa fa-sort"></i> </th> <th> Extend time <i class="fa fa-sort"></i> </th> @@ -153,14 +156,19 @@ $(document).ready(function() </tr> </thead> <tbody class="list"> - {% for paper in latest_attempts %} + {% for paper in papers %} <tr> <td>{{forloop.counter}}</td> - <td> <a href="{% url 'yaksh:user_data' paper.user.id paper.question_paper.id course.id %}"> - {{ paper.user.get_full_name.title }}</a> </td> - <td> {{ paper.user.profile.roll_number }} </td> + {% with paper.user as student %} + <td> <a href="{% url 'yaksh:user_data' paper.user_id paper.question_paper_id course.id %}"> + {{ student.get_full_name.title }}</a> </td> + <td> {{ student.profile.roll_number }} </td> + {% endwith %} <td> {{ paper.marks_obtained }} </td> - <td> {{ paper.answers.count }} </td> + <td> + {% get_dict_value questions_attempted paper.id as que_attempt %} + {{que_attempt}} out of {{questions_count}} + </td> <td id="time_left{{forloop.counter0}}"> {{ paper.time_left }} </td> <td> {% if paper.is_attempt_inprogress %} <span class="badge badge-warning"> Inprogress </span> @@ -229,7 +237,7 @@ $(document).ready(function() <div class="col-md-12"> <div class="alert alert-warning"> <center> - <h4>No Users Found for {{ quiz.description }}</h4> + <p>No Users Found for {{ quiz.description }}</p> </center> </div> </div> |