summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorprathamesh2017-01-04 15:54:19 +0530
committerprathamesh2017-01-04 15:54:19 +0530
commit241ca3c2b8ab1b1824813833237435153e08b0e9 (patch)
tree624c6bb07dfe239c2773f93a6da4ca20376d1c73 /yaksh/templates
parent43f2313d75e24a8c11855fb9718e48c1c06fb26f (diff)
downloadonline_test-241ca3c2b8ab1b1824813833237435153e08b0e9.tar.gz
online_test-241ca3c2b8ab1b1824813833237435153e08b0e9.tar.bz2
online_test-241ca3c2b8ab1b1824813833237435153e08b0e9.zip
Student UI modification.
Added side navigation bar. Edit and view Profile base template set properly. Added a tab "Enrolled Courses" for students to only view the courses they are enrolled in.
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/base.html4
-rw-r--r--yaksh/templates/manage.html4
-rw-r--r--yaksh/templates/user.html30
-rw-r--r--yaksh/templates/yaksh/editprofile.html19
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html120
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html2
-rw-r--r--yaksh/templates/yaksh/view_profile.html13
7 files changed, 73 insertions, 119 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index aade07a..b2560e8 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -42,12 +42,8 @@
<div class="page-header">
<h3><center>{% block pagetitle %}{% endblock pagetitle %}</center></h2>
</div>
- <div class=row>
- <div class=col-md-12>
{% block content %}
{% endblock %}
- </div>
- </div>
</div>
<footer class="footer">
<div class="container">
diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html
index 807a54c..9744594 100644
--- a/yaksh/templates/manage.html
+++ b/yaksh/templates/manage.html
@@ -25,3 +25,7 @@
</div><!-- /.container -->
</nav><!-- /.navbar -->
{% endblock %}
+{% block content %}
+ {% block main %}
+ {% endblock %}
+{% endblock %}
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html
index 9745655..f79eb29 100644
--- a/yaksh/templates/user.html
+++ b/yaksh/templates/user.html
@@ -1,4 +1,7 @@
{% extends "base.html" %}
+{% block css%}
+ <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" />
+{% endblock %}
{% block nav %}
<nav class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
@@ -11,14 +14,29 @@
<a class="navbar-brand" href="{{ URL_ROOT }}/exam/manage/"> Online Test </a>
</div>
<div class= "collapse navbar-collapse" id="navbar">
- <ul class="nav navbar-nav">
- <li><a href="{{ URL_ROOT }}/exam/quizzes">Quizzes</a></li>
- <li><a href="{{ URL_ROOT }}/exam/results">Results</a></li>
- <li><a href="{{ URL_ROOT }}/exam/viewprofile">My Profile</a></li>
- <li><a href="{{ URL_ROOT }}/exam/changepassword">Change Password</a></li>
- <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'>Log out</a></li>
+ <ul class="nav navbar-nav navbar-right">
+ <li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li>
+ <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li>
</ul>
</div><!-- /.navbar -->
</div><!-- /.container -->
</nav><!-- /.navbar -->
{% endblock %}
+{% block content %}
+<div class="row">
+ <div class="col-sm-3 col-md-2 sidebar">
+ <ul class="nav nav-sidebar">
+ <li><a href="{{ URL_ROOT }}/exam/quizzes"> Home </a></li>
+ <li><a href="{{ URL_ROOT }}/exam/quizzes/enrolled/"> Enrolled Courses </a></li>
+ <li><a href="{{ URL_ROOT }}/exam/viewprofile"> Profile </a></li>
+ <li><a href="{{ URL_ROOT }}/exam/changepassword"> Change Password </a></li>
+ </ul>
+ </div>
+ <div class="col-sm-8 col-sm-offset-3 col-md-9 col-md-offset-2 main">
+ <div class="row">
+ {% block main %}
+ {% endblock %}
+ </div>
+ </div>
+</div>
+{% endblock %}
diff --git a/yaksh/templates/yaksh/editprofile.html b/yaksh/templates/yaksh/editprofile.html
index fc8539d..e5191ad 100644
--- a/yaksh/templates/yaksh/editprofile.html
+++ b/yaksh/templates/yaksh/editprofile.html
@@ -1,20 +1,13 @@
-{% extends "manage.html" %}
-
-{% block formtitle %} Please fill in the following details {% endblock %}
-
-{% block content %}
-{% if msg %}
-<center><h5>Your profile does not exist. Please fill in your details</h5></center>
-{% endif %}
+{% extends template %}
+{% block pagetitle %} Please fill in the following details {% endblock %}
+{% block main %}
<form action="{{URL_ROOT}}/exam/editprofile/" method="post" >
{% csrf_token %}
<center>
- <table class="span1">
+ <table class="table table-bordered">
{{ form.as_table }}
</table>
</center>
- <center><button class="btn" type="submit">Save</button>
- <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/");'>Cancel</button> </center>
+ <button class="btn btn-primary pull-right" type="submit">Save Profile</button>
</form>
-
-{% endblock content %}
+{% endblock main %}
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index 4ccbbc0..524d76f 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -1,14 +1,6 @@
{% extends "user.html" %}
-
-
-{% block subtitle %}Hello {{ user.first_name }}, welcome to your dashboard !{% endblock %}
-
-
-{% block pagetitle %} Student's Dashboard {% endblock pagetitle %}
-{% block content %}
-
-<div class="row">
-<center><b><u>Available Courses</u></b></center><br>
+{% block pagetitle %} {{ title }} {% endblock %}
+{% block main %}
{% for course in courses %}
<div class="row well">
<div class="col-md-12">
@@ -31,93 +23,47 @@
</div>
<div class="row">
- {% if user in course.students.all %}
- {% if cannot_attempt %}
- <p>You have not passed the prerequisite & hence you cannot take the quiz.</p>
- {% endif %}
- <h4>List of quizzes available for you</h4>
- {% if not quizzes %}
- <h5>No active quizzes for you</h5>
- {% endif %}
- <table class="table table-bordered">
- <th>Quiz</th>
- <th>View Answer Paper</th>
- <th>Pre requisite quiz</th>
- {% for quiz in quizzes %}
- {% if quiz.course_id == course.id %}
- <tr>
- {% if not quiz.is_expired %}
- <td>
- <a href="{{ URL_ROOT }}/exam/start/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br>
- </td>
- {% else %}
- <td>
- <a href="{{ URL_ROOT }}/exam/start/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br>
- {{ quiz.description }} <span class="label label-danger">INACTIVE</span><br>
- </td>
- {% endif %}
+ {% if user in course.students.all %}
+ <table class="table table-bordered">
+ <th>Quiz</th>
+ <th>View Answer Paper</th>
+ <th>Pre requisite quiz</th>
+ {% for quiz in course.get_quizzes %}
+ {% if quiz.active and quiz.course_id == course.id %}
+ <tr>
+ {% if not quiz.is_expired %}
<td>
- {% if quiz.view_answerpaper %}
- <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ quiz.questionpaper_set.get.id }}/"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a>
- {% else%}
- <a><i class="fa fa-eye-slash" aria-hidden="true"></i> Cannot view now </a>
- {% endif %}
+ <a href="{{ URL_ROOT }}/exam/start/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br>
</td>
+ {% else %}
<td>
- {% if quiz.prerequisite %}
- You have to pass {{ quiz.prerequisite.description }} for taking {{ paper.quiz.description }}
- {% else %}
- No pre requisites for {{ quiz.description }}
- {% endif %}
+ {{ quiz.description }} <span class="label label-danger">INACTIVE</span><br>
</td>
- </tr>
{% endif %}
- {% endfor %}
- </table>
- {% endif %}
+ <td>
+ {% if quiz.view_answerpaper %}
+ <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ quiz.questionpaper_set.get.id }}/"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a>
+ {% else %}
+ <a><i class="fa fa-eye-slash" aria-hidden="true"></i> Cannot view now </a>
+ {% endif %}
+ </td>
+ <td>
+ {% if quiz.prerequisite %}
+ You have to pass {{ quiz.prerequisite.description }} for taking {{ paper.quiz.description }}
+ {% else %}
+ No pre requisites for {{ quiz.description }}
+ {% endif %}
+ </td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
+ {% endif %}
</div>
</div>
</div><!--/row-->
</br>
{% endfor %}
-</div>
-<hr>
-<h4>List of quizzes taken by you so far</h4>
-{% if quizzes_taken %}
- <table class="table table-bordered">
- <th>Quiz</th>
- <th>Result</th>
- <th>Marks Obtained</th>
- <th>Total Marks</th>
- <th>Percentage</th>
- {% for paper in quizzes_taken %}
- <tr>
- <td>
- {{ paper.question_paper.quiz.description }}
- </td>
- <td>
- {% if paper.passed %}
- <p>Pass</p>
- {% else %}
- <p>Fail</p>
- {% endif %}
- </td>
- <td>
- {{ paper.marks_obtained }}
- </td>
- <td>
- {{ paper.question_paper.total_marks }}
- </td>
- <td>
- {{ paper.percent }}
- </td>
- </tr>
- {% endfor %}
- </table>
-{% else %}
- <p>You have not taken any quiz yet !!</p>
-{% endif %}
-
{% endblock %}
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index 9dfbda0..9ad5b49 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -2,7 +2,7 @@
{% block pagetitle %} Answer Paper for {{ quiz.description }}{% endblock pagetitle %}
-{% block content %}
+{% block main %}
{% if not data.papers %}
<p><b> You have not attempted the quiz {{ quiz.description }} </b></p>
diff --git a/yaksh/templates/yaksh/view_profile.html b/yaksh/templates/yaksh/view_profile.html
index becd205..5f06135 100644
--- a/yaksh/templates/yaksh/view_profile.html
+++ b/yaksh/templates/yaksh/view_profile.html
@@ -1,12 +1,8 @@
-{% extends "base.html" %}
+{% extends template %}
-{% block pagetitle %} My Profile {% endblock %}
-{% block content %}
-<ul>
- <a class="btn btn-primary" href="{{ URL_ROOT }}/exam/editprofile/">Edit Profile</a>
- <a class="btn btn-primary" href="{{ URL_ROOT }}/exam/">Back to Home</a>
-</ul>
- <table class="table">
+{% block pagetitle %} Profile {% endblock %}
+{% block main %}
+ <table class="table table-bordered">
<tr>
<th><label for="id_first_name"><h5>First name:</h5></label></th>
<th><label for="id_first_name"><h5>{{ user.first_name }}</h5></label></th>
@@ -36,4 +32,5 @@
<th><label for="id_position"><h5>{{ user.profile.position }}</h5></label></th>
</tr>
</table>
+ <a class="btn btn-primary pull-right" href="{{ URL_ROOT }}/exam/editprofile/">Edit Profile</a>
{% endblock %}