summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-03-09 15:19:21 +0530
committerPrabhu Ramachandran2016-03-09 15:19:21 +0530
commit4874eb1e66c12269fa75849048afd2c9f129d5e3 (patch)
tree444f167c4bf4516b84e0cfeb6e60e921ae8519f8 /yaksh/templates
parent2bff22d61d5d4d6f038c5b368ec437c6bda1dfbe (diff)
parentc974da07d46709d3aa3640ba69c89d1a287ff3c1 (diff)
downloadonline_test-4874eb1e66c12269fa75849048afd2c9f129d5e3.tar.gz
online_test-4874eb1e66c12269fa75849048afd2c9f129d5e3.tar.bz2
online_test-4874eb1e66c12269fa75849048afd2c9f129d5e3.zip
Merge pull request #82 from prathamesh920/courses
Courses
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/manage.html6
-rw-r--r--yaksh/templates/yaksh/add_course.html21
-rw-r--r--yaksh/templates/yaksh/add_quiz.html2
-rw-r--r--yaksh/templates/yaksh/course_detail.html59
-rw-r--r--yaksh/templates/yaksh/courses.html50
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html153
6 files changed, 227 insertions, 64 deletions
diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html
index ca2ac65..11e2187 100644
--- a/yaksh/templates/manage.html
+++ b/yaksh/templates/manage.html
@@ -27,9 +27,9 @@
<a href="{{ URL_ROOT }}/exam/manage/"><h3 class="brand"><strong>Online Test</h3></strong></a>
<ul>
<li><a href="{{ URL_ROOT }}/exam/manage/questions">Questions</a></li>
- <li><a href="{{ URL_ROOT }}/exam/manage/showquiz">Quizzes</a></li>
<li><a href="{{ URL_ROOT }}/exam/manage/gradeuser">Grade User</a></li>
<li><a href="{{ URL_ROOT }}/exam/manage/monitor">Monitor</a></li>
+<li><a href="{{ URL_ROOT }}/exam/manage/courses">Courses</a></li>
</ul>
<ul style="float:right;">
<li><strong><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'>Log out</a></strong></li>
@@ -72,8 +72,8 @@
<hr>
<center>
<h4>Moderator's Dashboard!</h4>
- <h5>Click on the button given below to add a new quiz.</h5>
- <button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>
+ <h5>Click on the button given below to add a new course.</h5>
+ <button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
</center>
{% endblock %}
</div>
diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html
new file mode 100644
index 0000000..0afa27a
--- /dev/null
+++ b/yaksh/templates/yaksh/add_course.html
@@ -0,0 +1,21 @@
+{% extends "manage.html" %}
+
+{% block subtitle %}Add Course{% endblock %}
+
+{% block css %}
+<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" />
+{% endblock %}
+
+{% block manage %}
+<form name=frm id=frm action="" method="post" >
+ {% csrf_token %}
+ <center>
+ <table class=span1>
+ {{ form.as_table }}
+ </table>
+ </center>
+
+ <center><button class="btn primary" type="submit" id="submit" name="questionpaper">Add Course</button>
+ <button class="btn primary" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/");'>Cancel</button> </center>
+</form>
+{% endblock %}
diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html
index e78023d..c47d1f7 100644
--- a/yaksh/templates/yaksh/add_quiz.html
+++ b/yaksh/templates/yaksh/add_quiz.html
@@ -20,6 +20,6 @@
</center>
<center><button class="btn" type="submit" id="submit" name="questionpaper">Design Question Paper</button>
- <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showquiz/");'>Cancel</button> </center>
+ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> </center>
</form>
{% endblock %}
diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html
new file mode 100644
index 0000000..ed56585
--- /dev/null
+++ b/yaksh/templates/yaksh/course_detail.html
@@ -0,0 +1,59 @@
+{% extends "manage.html" %}
+
+{% block title %} Course {% endblock title %}
+
+{% block subtitle %} {{ course.name }} {% endblock %}
+
+{% block css %}
+<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" />
+{% endblock %}
+
+{% block manage %}
+<div class="row">
+ <div class="span6 wrap">
+ <center><b><u>Requests</u></b></center><br>
+ {% for request in course.get_requests %}
+ <div class="well">
+ <div class="row">
+ <div class="span3" style="padding-top:10px">
+ {{ request.username }}
+ </div>
+ <a class="btn success" href="{{URL_ROOT}}/exam/manage/enroll/{{ course.id }}/{{ request.id }}/"> Enroll </a> <a class="btn danger" href="{{URL_ROOT}}/exam/manage/reject/{{ course.id }}/{{ request.id }}/"> Reject </a>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ <div class="span6 wrap">
+ <center><b><u>Rejected</u></b></center><br>
+ {% for rejected in course.get_rejected %}
+ <div class="well">
+ <div class="row">
+ <div class="span4" style="padding-top:10px">
+ {{ rejected.username }}
+ </div>
+ <a class="btn success" href="{{URL_ROOT}}/exam/manage/enroll/rejected/{{ course.id }}/{{ rejected.id }}/"> Enroll </a>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+</div>
+<br>
+<div class="row">
+ <div class="span6 offset4 wrap">
+ <center><b><u>Enrolled</u></b></center><br>
+ {% for enrolled in course.get_enrolled %}
+ <div class="well">
+ <div class="row">
+ <div class="span4" style="padding-top:10px">
+ {{ enrolled.username }}
+ </div>
+ <a class="btn danger" href="{{URL_ROOT}}/exam/manage/enrolled/reject/{{ course.id }}/{{ enrolled.id }}/"> Reject </a>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+</div>
+<div class="pull-right">
+ <a class="btn primary" href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/">{% if course.active %}Deactivate Course {% else %} Activate Course {% endif %}</a>
+</div>
+{% endblock %}
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
new file mode 100644
index 0000000..f8f8273
--- /dev/null
+++ b/yaksh/templates/yaksh/courses.html
@@ -0,0 +1,50 @@
+{% extends "manage.html" %}
+
+{% block title %} Courses {% endblock title %}
+
+{% block subtitle %} Courses {% endblock %}
+
+{% block css %}
+<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" />
+{% endblock %}
+
+{% block manage %}
+{% if not courses %}
+ <center><h5> You have not created any courses </h5></center>
+{% else %}
+ {% for course in courses %}
+ <div class="row show-grid">
+ <div class="span14">
+ <div class="row">
+ <div class="span6">
+ <p>
+ <b><u>Course</u></b>
+ {% if course.active %}
+ <span class="label success">Active</span>
+ {% else %}
+ <span class="label important">Closed</span>
+ {% endif %}
+ </p>
+ <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a>
+ </br>
+ </div>
+ <div class="span6">
+ <p><b><u>Quiz(zes)</u></b></p>
+ {% if course.get_quizzes %}
+ {% for quiz in course.get_quizzes %}
+ <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br>
+ {% endfor %}
+ {% else %}
+ <p><b>No quiz </b></p>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ <br><br>
+ {% endfor %}
+
+ <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
+ <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>
+{% endif %}
+{% endblock %}
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index 1dcd20d..a800e68 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -4,7 +4,7 @@
{% block subtitle %}Hello {{ user.first_name }}, welcome to your dashboard !{% endblock %}
{% block css %}
-<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" />
+<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" />
{% endblock %}
{% block script %}
@@ -14,73 +14,106 @@
{% block manage %}
- {% if cannot_attempt %}
- <p>You have not passed the prerequisite & hence you cannot take the quiz.</p>
- {% endif %}
- <h4>List of quizzes availbale for you</h4>
- {% if not quizzes %}
- <h5>No active quizzes for you</h5>
- {% endif %}
- <table>
- <th>Quiz</th>
- <th>Pre requisite quiz</th>
- {% for paper in quizzes %}
- <tr>
- {% if paper in unexpired_quizzes %}
- <td>
- <a href="{{ URL_ROOT }}/exam/intro/{{paper.id}}">{{ paper.quiz.description }}</a><br>
- </td>
- {% else %}
- <td>
- {{ paper.quiz.description }} <span class="label important">Expired</span><br>
- </td>
+
+<center><b><u>Available Courses</u></b></center><br>
+{% for course in courses %}
+<div class="row show-grid">
+ <div class="span14">
+ <div class="row">
+ <div class="span6">
+ <h4><b><u> {{ course.name }} by {{ course.creator}}</u></b></h4>
+ </div>
+ <div class="span6">
+ {% if user in course.requests.all %} <span class="label warning">Request Pending </span>
+ {% elif user in course.rejected.all %}<span class="label important">Request Rejected</span>
+ {% elif user in course.students.all %}<span class="label notice">Enrolled</span>
+ {% else %}
+ {% if course.is_self_enroll %}
+ <a class="btn success" href="{{ URL_ROOT }}/exam/self_enroll/{{ course.id }}">Enroll</a>
+ {% else %}
+ <a class="btn success" href="{{ URL_ROOT }}/exam/enroll_request/{{ course.id }}">Enroll Request</a>
+ {% endif %}
+ {% endif %}
+ </div>
+ </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 availbale for you</h4>
+ {% if not quizzes %}
+ <h5>No active quizzes for you</h5>
+ {% endif %}
+ <table>
+ <th>Quiz</th>
+ <th>Pre requisite quiz</th>
+ {% for paper in quizzes %}
+ {% if paper.quiz.course_id == course.id %}
+ <tr>
+ {% if paper in unexpired_quizzes %}
+ <td>
+ <a href="{{ URL_ROOT }}/exam/intro/{{paper.id}}">{{ paper.quiz.description }}</a><br>
+ </td>
+ {% else %}
+ <td>
+ {{ paper.quiz.description }} <span class="label important">Expired</span><br>
+ </td>
+ {% endif %}
+ <td>
+ {% if paper.quiz.prerequisite %}
+ You have to pass {{ paper.quiz.prerequisite.description }} for taking {{ paper.quiz.description }}
+ {% else %}
+ No pre requisites for {{ paper.quiz.description }}
+ {% endif %}
+ </td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
{% endif %}
+ </div>
+ </div>
+</div><!--/row show-grid-->
+ </br>
+{% endfor %}
+<hr>
+<h4>List of quizzes taken by you so far</h4>
+{% if quizzes_taken %}
+ <table class="bordered-table zebra-striped">
+ <th>Quiz</th>
+ <th>Result</th>
+ <th>Marks Obtained</th>
+ <th>Total Marks</th>
+ <th>Percentage</th>
+ {% for paper in quizzes_taken %}
+ <tr>
<td>
- {% if paper.quiz.prerequisite %}
- You have to pass {{ paper.quiz.prerequisite.description }} for taking {{ paper.quiz.description }}
+ {{ paper.question_paper.quiz.description }}
+ </td>
+ <td>
+ {% if paper.passed %}
+ <p>Pass</p>
{% else %}
- No pre requisites for {{ paper.quiz.description }}
+ <p>Fail</p>
{% endif %}
</td>
+ <td>
+ {{ paper.marks_obtained }}
+ </td>
+ <td>
+ {{ paper.question_paper.total_marks }}
+ </td>
+ <td>
+ {{ paper.percent }}
+ </td>
</tr>
{% endfor %}
</table>
- <hr>
- <h4>List of quizzes taken by you so far</h4>
- {% if quizzes_taken %}
- <table class="bordered-table zebra-striped">
- <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 %}
+{% else %}
+ <p>You have not taken any quiz yet !!</p>
+{% endif %}
{% endblock %}