summaryrefslogtreecommitdiff
path: root/yaksh/templates/exam.html
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates/exam.html')
-rw-r--r--yaksh/templates/exam.html187
1 files changed, 112 insertions, 75 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index 012adbe..a773076 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -1,86 +1,123 @@
{% extends "base.html" %}
{% load custom_filters %}
-{% block css%}
- <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" />
-{% endblock %}
+{% load static %}
+
+{% block title %}{{ paper.question_paper.quiz.description }}{% endblock %}
+
{% block nav %}
- <nav class="navbar navbar-fixed-top navbar-inverse">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="#">
- <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH" style="margin-top: -3px; margin-left:-15px">
- </img>
- </a>
+<div class="container-fluid">
+ <nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top">
+ <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH">
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+
+ <div class="collapse navbar-collapse" id="navbarColor01">
+ <div class="row ml-auto">
+ <div class="col-md-4">
+ <span class="time-div nav-item" id="time_left"></span>
</div>
- <div class= "collapse navbar-collapse" id="navbar">
- <form id="logout" action="{{URL_ROOT}}/exam/quit/{{ paper.attempt_number }}/{{module.id}}/{{ paper.question_paper.id }}/{{course.id}}/" method="post" class="pull-right">
+ <div class="col-md-7">
+ <form id="logout" action="{% url 'yaksh:quit_quiz' paper.attempt_number module.id paper.question_paper.id course.id %}" method="post" class="ml-auto">
{% csrf_token %}
- <ul class="nav navbar-nav navbar">
- <li style="padding: 10px"><button class="btn btn-danger btn-sm" type="submit" name="quit">
- {% if paper.questions_unanswered.all %}
- Quit {{ quiz_type }}
- {% else %}
- Finish {{ quiz_type }}
- {% endif %}
- <span class="glyphicon glyphicon-off"></span></button></li>
- </ul>
+ <span class="nav-item"><button class="btn btn-danger btn-lg" type="submit" name="quit">
+ {% if paper.questions_unanswered.all %}
+ Quit {{quiz_type}}
+ {% else %}
+ Finish {{quiz_type}}
+ {% endif %}
+ <i class="fa fa-power-off"></i></button></span>
</form>
- <div class="time-div" id="time_left"></div>
- </div><!-- /.navbar -->
- </div><!-- /.container -->
- </nav><!-- /.navbar -->
+ </div>
+ </div>
+ </div>
+ </nav>
+</div>
{% endblock %}
{% block content %}
<div class="container-fluid">
- <div class="col-sm-3 col-md-2 sidebar">
- <p> Question Navigator </p>
- <ul class="pagination pagination-sm">
- {% for qid in paper.get_all_ordered_questions %}
- {%if paper.question_paper.quiz.allow_skip %}
- {% if qid in paper.get_questions_unanswered %}
- {% if qid.id == question.id %}
- <li class="active"><a style="width:25%" href="#"data-toggle="tooltip"
- title="{{ qid.description|striptags }}"
- onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')">{{ forloop.counter }}</a></li>
- {% else %}
- <li><a style="width:25%" href="#" data-toggle="tooltip" title="{{ qid.description|striptags }}"
- onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')">{{ forloop.counter }}</a></li>
- {% endif %}
- {% endif %}
- {% if qid in paper.get_questions_answered %}
- <li><a style="background-color:#B4B8BA; width:25%" href="#" data-toggle="tooltip"
- onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')"
- title="{{ qid.description }}">{{ forloop.counter }}</a></li>
- {% endif %}
- {% else %}
- {% if qid.id == question.id %}
- <li class="active"><a style="width:25%" data-toggle="tooltip" title="{{ qid.description|striptags }}">{{ forloop.counter }}</a></li>
- {% elif qid in paper.get_questions_answered %}
- <li><a style="background-color:#B4B8BA; width:25%" href="#" data-toggle="tooltip"
- onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')"
- title="{{ qid.description }}">{{ forloop.counter }}</a></li>
- {% else %}
- <li class="disabled"><a style="width:25%" data-toggle="tooltip" title="{{ qid.description|striptags }}">{{ forloop.counter }}</a></li>
- {% endif %}
- {% endif %}
- {% endfor %}
- </ul>
- <p>Question(s) left: <b>{{ paper.questions_left }}</b></p>
- <br><br><br>
- {% block learning_units %}
- {% endblock %}
- </div>
- <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
- <div class="row">
- {% block main %}
- {% endblock %}
- </div>
- </div>
- </div>
+ <div class="row">
+ <!-- Side Component -->
+ <div class="col-md-3 bg-secondary" style="overflow-x: scroll;">
+ <br>
+ <center>
+ <b>{{course.name}}</b><br>
+ {{ paper.question_paper.quiz.description }}</h4>
+ </center>
+ <hr>
+ <center><p><b><u>Question Navigator</b></u></p></center>
+ <br>
+ <div class="justify-content-center">
+ {% for qid in paper.get_all_ordered_questions %}
+ {% if paper.question_paper.quiz.allow_skip %}
+ {% if qid in paper.get_questions_unanswered %}
+ {% if qid.id == question.id %}
+ <a class="active btn btn-outline-primary " href="#"data-toggle="tooltip"
+ title="{{ qid.description|striptags|truncatechars:100 }}" style="width: 50px"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')">{{ forloop.counter }}</a>
+ {% else %}
+ <a class=" btn btn-outline-primary " href="#" data-toggle="tooltip" title="{{ qid.description|striptags|truncatechars:100 }}" style="width: 50px"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')">{{ forloop.counter }}</a>
+ {% endif %}
+ {% endif %}
+ {% if qid in paper.get_questions_answered %}
+ <a class="btn btn-success" href="#" data-toggle="tooltip" style="width: 50px"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')"
+ title="{{ qid.description|striptags|truncatechars:100 }}">{{ forloop.counter }}</a>
+ {% endif %}
+ {% else %}
+ {% if qid.id == question.id %}
+ <a class="active btn btn-outline-primary" data-toggle="tooltip" title="{{ qid.description|striptags|truncatechars:100 }}" style="width: 50px">{{ forloop.counter }}</a>
+ {% elif qid in paper.get_questions_answered %}
+ <a class="btn btn-success" href="#" data-toggle="tooltip" style="width: 50px"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')"
+ title="{{ qid.description|striptags|truncatechars:100 }}">{{ forloop.counter }}</a>
+ {% else %}
+ <a class="btn btn-outline-primary" style="width: 50px" data-toggle="tooltip" title="{{ qid.description|striptags|truncatechars:100 }}">{{ forloop.counter }}</a>
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ </div>
+ <br>
+ <p><span class="btn btn-success"></span> Attempted question(s)</p>
+ <p><span class="btn btn-primary"></span> Current question</p>
+ <p><span class="btn btn-outline-primary"></span> Unattempted question(s)</p>
+ <br>
+ <div>
+ <p class="text-center">Question(s) left: <b>{{ paper.questions_left }}</b></p>
+ </div>
+ <br>
+ <div>
+ <table class="table table-bordered table-responsive-sm">
+ <thead>
+ <tr>
+ <th>Category</th>
+ <th>Question No.</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for category, question_number in paper.get_categorized_question_indices.items %}
+ <tr>
+ <td>
+ {{category}}
+ </td>
+ <td>
+ {{question_number| join:", "}}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <br>
+ </div>
+ </div>
+ <!-- Main Component -->
+ <div class="col-md-9">
+ <br>
+ {% block main %}
+ {% endblock %}
+ </div>
+ </div>
+</div>
{% endblock %}