summaryrefslogtreecommitdiff
path: root/testapp/templates
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/templates')
-rw-r--r--testapp/templates/base.html135
-rw-r--r--testapp/templates/exam/add_question.html32
-rw-r--r--testapp/templates/exam/add_quiz.html36
-rw-r--r--testapp/templates/exam/complete.html37
-rw-r--r--testapp/templates/exam/edit_question.html38
-rw-r--r--testapp/templates/exam/edit_quiz.html43
-rw-r--r--testapp/templates/exam/grade_user.html4
-rw-r--r--testapp/templates/exam/intro.html103
-rw-r--r--testapp/templates/exam/login.html76
-rw-r--r--testapp/templates/exam/monitor.html53
-rw-r--r--testapp/templates/exam/question.html190
-rw-r--r--testapp/templates/exam/quit.html39
-rw-r--r--testapp/templates/exam/register.html46
-rw-r--r--testapp/templates/exam/show_quiz.html39
-rw-r--r--testapp/templates/exam/showquestions.html40
-rw-r--r--testapp/templates/exam/user_data.html6
-rw-r--r--testapp/templates/manage.html61
17 files changed, 446 insertions, 532 deletions
diff --git a/testapp/templates/base.html b/testapp/templates/base.html
index 54a2035..49fc7ce 100644
--- a/testapp/templates/base.html
+++ b/testapp/templates/base.html
@@ -2,84 +2,83 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
+ <head>
+ <title>
+ {% block title %}
+ {% endblock %}
+ </title>
-<title>
-{% block title %}
-{% endblock %}
-</title>
+ {% block meta %}
+ <meta charset="utf-8">
+ <meta name="description" content="">
+ <meta name="author" content="">
+ {% endblock %}
-{% block meta %}
-<meta charset="utf-8">
- <meta name="description" content="">
- <meta name="author" content="">
-{% endblock %}
-
-<link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/base.css" type="text/css" />
-
-{% block css %}
-<style type="text/css">
-
- html, body {
- background-color: #eee;
- }
- body {
- padding-top: 9px;
- }
- .container > footer p {
- text-align: center;
- }
- .container {
- width: 820px;
- }
+ <link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/base.css" type="text/css" />
+ {% block css %}
+ <style type="text/css">
- .container > .content {
- background-color: #fff;
- padding: 20px;
- margin: 0 -20px;
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
+ html, body
+ {
+ background-color: #eee;
+ }
+ body
+ {
+ padding-top: 9px;
+ }
+ .container > footer p
+ {
+ text-align: center;
+ }
+ .container
+ {
+ width: 820px;
+ }
+ .container > .content
+ {
+ background-color: #fff;
+ padding: 20px;
+ margin: 0 -20px;
+ -webkit-border-radius: 0 0 6px 6px;
+ -moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+ -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
box-shadow: 0 1px 2px rgba(0,0,0,.15);
- }
-
-
- .page-header {
- background-color: #f5f5f5;
- padding: 20px 20px 10px;
- margin: -20px -20px 20px;
- }
+ }
+ .page-header
+ {
+ background-color: #f5f5f5;
+ padding: 20px 20px 10px;
+ margin: -20px -20px 20px;
+ }
+ .content .span10,
+ .content .span14
+ {
+ min-height: 500px;
+ }
+ .content .span4
+ {
+ margin-left: 0;
+ padding-left: 19px;
+ border-left: 1px solid #eee;
+ }
+ .topbar .btn
+ {
+ border: 0;
+ }
+ </style>
+ {% endblock %}
- .content .span10,
- .content .span14 {
- min-height: 500px;
- }
-
- .content .span4 {
- margin-left: 0;
- padding-left: 19px;
- border-left: 1px solid #eee;
- }
-
- .topbar .btn {
- border: 0;
- }
-
- </style>
-{% endblock %}
-
-{% block script %}
-{% endblock %}
-</head>
+ {% block script %}
+ {% endblock %}
+ </head>
<body {% block onload %}{% endblock %}>
<div class=box>
-{% block content %}
-{% endblock %}
+ {% block content %}
+ {% endblock %}
</div>
-
</body>
</html>
diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html
index 2d42b34..d5503b5 100644
--- a/testapp/templates/exam/add_question.html
+++ b/testapp/templates/exam/add_question.html
@@ -1,27 +1,25 @@
{% extends "manage.html" %}
-{% block subtitle %}
-Add Question
-{% endblock %}
+{% block subtitle %}Add Question{% endblock %}
{% block manage %}
-<style type="text/css">
-
-table th, table td {
- padding: 10px 10px 9px;
- line-height: 18px;
- text-align: left;
-}
-</style>
+ <style type="text/css">
+ table th, table td
+ {
+ padding: 10px 10px 9px;
+ line-height: 18px;
+ text-align: left;
+ }
+ </style>
<form action="" method="post">
-{% csrf_token %}
-<center><table class=span1>
-{{ form.as_table }}
-</table>
-<center><button class="btn" type="submit" name="savequestion">Save</button>
-<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center>
+ {% csrf_token %}
+ <center><table class=span1>
+ {{ form.as_table }}
+ </table>
+ <center><button class="btn" type="submit" name="savequestion">Save</button>
+ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center>
</form>
{% endblock %}
diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html
index d51d129..4dae30b 100644
--- a/testapp/templates/exam/add_quiz.html
+++ b/testapp/templates/exam/add_quiz.html
@@ -1,28 +1,26 @@
{% extends "manage.html" %}
-{% block subtitle %}
-Add Quiz
-{% endblock %}
+{% block subtitle %}Add Quiz{% endblock %}
{% block manage %}
+ <style type='text/css'>
+ table th, table td
+ {
+ padding: 10px 10px 9px;
+ line-height: 18px;
+ text-align: left;
+ }
+ </style>
-<style type='text/css'>
-
-table th, table td {
- padding: 10px 10px 9px;
- line-height: 18px;
- text-align: left;
-}
-</style>
<form name=frm action="" method="post">
-{% csrf_token %}
-<center>
-<table class=span1>
-{{ form.as_table }}
-</table>
-</center>
-<center><button class="btn" type="submit" name="save">Save</button>
-<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showquiz/");'>Cancel</button> </center>
+ {% csrf_token %}
+ <center>
+ <table class=span1>
+ {{ form.as_table }}
+ </table>
+ </center>
+ <center><button class="btn" type="submit" name="save">Save</button>
+ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showquiz/");'>Cancel</button> </center>
</form>
{% endblock %}
diff --git a/testapp/templates/exam/complete.html b/testapp/templates/exam/complete.html
index 6a401a4..f5c658f 100644
--- a/testapp/templates/exam/complete.html
+++ b/testapp/templates/exam/complete.html
@@ -3,26 +3,21 @@
{% block title %}Good bye!{% endblock %}
{% block content %}
-
-
- <div class="container">
- <div class="content">
-<div class="page-header">
-<h1><Strong><center>Online Test</center></strong></h1>
-</div>
- <div class=row>
- <div class=span14>
-
-<center><h2> Good bye! </h2></center>
-
-<center><h4> {{message}} </h4></center>
-
-<center><h4>You may now close the browser.</h4></center>
-
-</div></div></div>
-<footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
- </footer>
+<div class="container">
+ <div class="content">
+ <div class="page-header">
+ <h1><Strong><center>Online Test</center></strong></h1>
+ </div>
+ <div class=row>
+ <div class=span14>
+ <center><h2> Good bye! </h2></center>
+ <center><h4> {{message}} </h4></center>
+ <center><h4>You may now close the browser.</h4></center>
+ </div>
+ </div>
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
</div>
-
{% endblock content %}
diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html
index 04217ab..7613cc6 100644
--- a/testapp/templates/exam/edit_question.html
+++ b/testapp/templates/exam/edit_question.html
@@ -1,29 +1,27 @@
{% extends "manage.html" %}
-{% block subtitle %}
-Edit Question
-{% endblock %}
+{% block subtitle %}Edit Question{% endblock %}
{% block manage %}
-<style type="text/css">
-
-table th, table td {
- padding: 10px 10px 9px;
- line-height: 18px solid;
- text-align: left;
-}
-</style>
+ <style type="text/css">
+ table th, table td
+ {
+ padding: 10px 10px 9px;
+ line-height: 18px solid;
+ text-align: left;
+ }
+ </style>
<form action="{{URL_ROOT}}/exam/manage/editquestion/" method="post">
-{% csrf_token %}
-{% for form in forms %}
-<table>
-{{ form.as_table }}
-</table>
-<hr>
-{% endfor %}
-<center><button class="btn" type="submit" name="savequestion">Save</button>
-<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center>
+ {% csrf_token %}
+ {% for form in forms %}
+ <table>
+ {{ form.as_table }}
+ </table>
+ <hr>
+ {% endfor %}
+ <center><button class="btn" type="submit" name="savequestion">Save</button>
+ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center>
</form>
{% endblock %}
diff --git a/testapp/templates/exam/edit_quiz.html b/testapp/templates/exam/edit_quiz.html
index 7744623..27b179f 100644
--- a/testapp/templates/exam/edit_quiz.html
+++ b/testapp/templates/exam/edit_quiz.html
@@ -1,31 +1,28 @@
{% extends "manage.html" %}
-{% block subtitle %}
-Edit Quiz(zes)
-{% endblock %}
+{% block subtitle %}Edit Quiz(zes){% endblock %}
{% block manage %}
-
-<style type='text/css'>
-
-table th, table td {
- padding: 10px 10px 9px;
- line-height: 18px;
- text-align: left;
-}
-</style>
+ <style type='text/css'>
+ table th, table td
+ {
+ padding: 10px 10px 9px;
+ line-height: 18px;
+ text-align: left;
+ }
+ </style>
<form name=frm action="{{URL_ROOT}}/exam/manage/editquiz/" method="post">
-{% csrf_token %}
-{% for form in forms %}
-<center>
-<table class=span1>
-{{ form.as_table }}
-</table>
-</center>
-<hr>
-{% endfor %}
-<center><button class="btn" type="submit" name="save">Save</button>
-<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showquiz/");'>Cancel</button> </center>
+ {% csrf_token %}
+ {% for form in forms %}
+ <center>
+ <table class=span1>
+ {{ form.as_table }}
+ </table>
+ </center>
+ <hr>
+ {% endfor %}
+ <center><button class="btn" type="submit" name="save">Save</button>
+ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/showquiz/");'>Cancel</button> </center>
</form>
{% endblock %}
diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html
index bad1765..5b0e1a7 100644
--- a/testapp/templates/exam/grade_user.html
+++ b/testapp/templates/exam/grade_user.html
@@ -71,8 +71,7 @@ Marks: <input id="q{{ question.id }}" type="text"
{% endif %} {# if data.papers #}
{% if data.papers.count > 1 %}
-<a href="{{URL_ROOT}}/exam/manage/monitor/">
- Monitor quiz</a>
+<a href="{{URL_ROOT}}/exam/manage/monitor/">Monitor quiz</a>
{% else %}
{% with data.papers.0 as paper %}
<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.quiz.id}}/">
@@ -81,5 +80,4 @@ Marks: <input id="q{{ question.id }}" type="text"
{% endif %}
<br />
<a href="{{URL_ROOT}}/admin/">Admin</a>
-
{% endblock%}
diff --git a/testapp/templates/exam/intro.html b/testapp/templates/exam/intro.html
index 35a6923..167a4b2 100644
--- a/testapp/templates/exam/intro.html
+++ b/testapp/templates/exam/intro.html
@@ -3,68 +3,43 @@
{% block title %}Instructions and Rules {% endblock %}
{% block content %}
-
- <div class="container">
- <div class="content">
-<div class="page-header">
-<h1><Strong><center>Online Test</center></strong></h1>
-</div>
- <div class=row>
- <div class=span14>
-<h3><center>Important instructions & rules</center></h3><br>
-
-<p> Welcome <strong>{{user.first_name.title}} {{user.last_name.title}}</strong>,
-to the programming quiz! </p>
-
-<p>
-This examination system has been developed with the intention of making you
-learn programming and be assessed in an interactive and fun manner.
-You will be presented with a series of programming questions and problems that
-you will answer online and get immediate feedback for.
-</p>
-
-<p> Here are some important instructions and rules that you should understand
-carefully.
-</p>
-
-<ul>
-
- <li>For any programming questions, you can submit solutions as many times as
- you want without a penalty. You may skip questions and solve them later.
- </li>
-
- <li> You <strong>may</strong> use your computer's Python/IPython shell or
- an editor to solve
- the problem and cut/paste the solution to the web interface.
- </li>
-
- <li> <strong>You are <strong>not allowed</strong> to use any internet
- resources, i.e. no google etc.</strong> </li>
-
- <li> Do not copy or share the questions or answers with anyone until the
- exam is complete <strong>for everyone</strong>.</li>
-
- <li> <strong>All</strong> your attempts at the questions are logged.
- Do not try to outsmart and break the testing system. If you do, we know
- who you are and we will expell you from the course. You have been warned.
- </li>
-
-</ul>
-
-<p> We hope you enjoy taking this exam !!!</p>
-
-<form action="{{URL_ROOT}}/exam/start/" method="post" align="center">
-{% csrf_token %}
-<center><button class="btn" type="submit" name="start">Start Exam!</button></center>
-<!--input type="submit" name="start" value="Start Exam!"-->
-</form>
-</div>
- </div>
- </div>
-<footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
- </footer>
-
- </div> <!-- /container -->
-
+ <div class="container">
+ <div class="content">
+ <div class="page-header">
+ <h1><Strong><center>Online Test</center></strong></h1>
+ </div>
+ <div class=row>
+ <div class=span14>
+ <h3><center>Important instructions & rules</center></h3><br>
+ <p> Welcome <strong>{{user.first_name.title}} {{user.last_name.title}}</strong>, to the programming quiz! </p>
+ <p>
+ This examination system has been developed with the intention of making you
+ learn programming and be assessed in an interactive and fun manner.
+ You will be presented with a series of programming questions and problems that
+ you will answer online and get immediate feedback for.
+ </p>
+ <p> Here are some important instructions and rules that you should understand carefully.</p>
+ <ul>
+ <li>For any programming questions, you can submit solutions as many times as you want without a penalty. You may skip questions and solve them later.
+ </li>
+ <li> You <strong>may</strong> use your computer's Python/IPython shell or an editor to solve the problem and cut/paste the solution to the web interface.
+ </li>
+ <li> <strong>You are <strong>not allowed</strong> to use any internet resources, i.e. no google etc.</strong> </li>
+ <li> Do not copy or share the questions or answers with anyone until the exam is complete <strong>for everyone</strong>.</li>
+ <li> <strong>All</strong> your attempts at the questions are logged. Do not try to outsmart and break the testing system. If you do, we know who you are and we will expell you from the course. You have been warned.
+ </li>
+ </ul>
+ <p> We hope you enjoy taking this exam !!!</p>
+
+ <form action="{{URL_ROOT}}/exam/start/" method="post" align="center">
+ {% csrf_token %}
+ <center><button class="btn" type="submit" name="start">Start Exam!</button></center>
+ </form>
+ </div>
+ </div>
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
+ </div>
{% endblock content %}
diff --git a/testapp/templates/exam/login.html b/testapp/templates/exam/login.html
index 62aedcf..07a91fc 100644
--- a/testapp/templates/exam/login.html
+++ b/testapp/templates/exam/login.html
@@ -3,46 +3,40 @@
{% block title %}Login{% endblock title %}
{% block content %}
-
- <div class="container">
- <div class="content">
-<div class="page-header">
-<h1><Strong><center>Online Test</center></strong></h1>
-</div>
- <div class=row>
- <div class=span14>
-<h3><center>Login</center></h3><br>
-<form action="" method="post">
-{% csrf_token %}
-
-<style type="text/css">
- label {
- padding-top: 6px;
- font-size: 15px;
- line-height: 18px;
- float: left;
- width: 80px;
- text-align: center;
- color: #404040;
-/* font-weight : bold;*/
-}
-</style>
-<center><table class=span1>
-{{ form.as_table }}
-</table></center>
-
-<center><button class="btn" type="submit">Login</button>&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn" type="reset">Cancel</button></center>
-<br><center><a href="{{URL_ROOT}}/exam/forgotpassword/">Forgot Password?</a></center><br>
-<center><a href="{{URL_ROOT}}/exam/register/">New User? Sign-Up </a></center>
-</form>
+<div class="container">
+ <div class="content">
+ <div class="page-header">
+ <h1><Strong><center>Online Test</center></strong></h1>
+ </div>
+ <div class=row>
+ <div class=span14>
+ <h3><center>Login</center></h3><br>
+ <form action="" method="post">
+ {% csrf_token %}
+ <style type="text/css">
+ label
+ {
+ padding-top: 6px;
+ font-size: 15px;
+ line-height: 18px;
+ float: left;
+ width: 80px;
+ text-align: center;
+ color: #404040;
+ }
+ </style>
+ <center><table class=span1>
+ {{ form.as_table }}
+ </table></center>
+ <center><button class="btn" type="submit">Login</button>&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn" type="reset">Cancel</button></center>
+ <br><center><a href="{{URL_ROOT}}/exam/forgotpassword/">Forgot Password?</a></center><br>
+ <center><a href="{{URL_ROOT}}/exam/register/">New User? Sign-Up </a></center>
+ </form>
+ </div>
+ </div>
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
</div>
- </div>
- </div>
-<footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
- </footer>
-
- </div> <!-- /container -->
-
-
{% endblock content %}
diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html
index 60814c7..a0287e7 100644
--- a/testapp/templates/exam/monitor.html
+++ b/testapp/templates/exam/monitor.html
@@ -6,18 +6,15 @@
{% block manage %}
-{% if not quizzes and not quiz %}
-<h1><center> Quiz results </center></h1>
-
-<center><h5> No quizzes available. </h5></center>
-
-{% endif %}
+ {% if not quizzes and not quiz %}
+ <h1><center> Quiz results </center></h1>
+ <center><h5> No quizzes available. </h5></center>
+ {% endif %}
{# ############################################################### #}
{# This is rendered when we are just viewing exam/monitor #}
{% if quizzes %}
<center><h1> Available quizzes </h1></center>
-
<ul>
{% for quiz in quizzes %}
<li><a href="{{URL_ROOT}}/exam/manage/monitor/{{quiz.id}}/">{{ quiz.description }}</a></li>
@@ -33,32 +30,32 @@
{% if papers %}
{# <p> Quiz: {{ quiz_name }}</p> #}
<p>Number of papers: {{ papers|length }} </p>
-<style type="text/css">
-table td {
- vertical-align: top;
- border-top: 1px solid #ddd;
-}
-table tbody th {
- border-top: 1px solid #ddd;
- vertical-align: top;
-}
-</style>
+ <style type="text/css">
+ table td
+ {
+ vertical-align: top;
+ border-top: 1px solid #ddd;
+ }
+ table tbody th
+ {
+ border-top: 1px solid #ddd;
+ vertical-align: top;
+ }
+ </style>
<table border="1" cellpadding="3">
<tr>
- <th> Name </th>
- <th> Username </th>
- <th> Roll number </th>
- <th> Institute </th>
- <th> Questions answered </th>
- <th> Total marks </th>
- <th> Attempts </th>
+ <th> Name </th>
+ <th> Username </th>
+ <th> Roll number </th>
+ <th> Institute </th>
+ <th> Questions answered </th>
+ <th> Total marks </th>
+ <th> Attempts </th>
</tr>
{% for paper in papers %}
<tr>
- <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.username}}">
- {{ paper.user.get_full_name.title }}</a> </td>
- <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.username}}">
- {{ paper.user.username }}</a> </td>
+ <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.username}}">{{ paper.user.get_full_name.title }}</a> </td>
+ <td> <a href="{{URL_ROOT}}/exam/manage/user_data/{{paper.user.username}}">{{ paper.user.username }}</a> </td>
<td> {{ paper.profile.roll_number }} </td>
<td> {{ paper.profile.institute }} </td>
<td> {{ paper.get_answered_str }} </td>
diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html
index a02e8c4..113a9ae 100644
--- a/testapp/templates/exam/question.html
+++ b/testapp/templates/exam/question.html
@@ -1,117 +1,103 @@
{% extends "base.html" %}
+
<!DOCTYPE html>
- {% block title %} Answer question {% endblock %}
+{% block title %} Answer question {% endblock %}
{% block script %}
-<script type="text/javascript">
-
-var time_left = {{ time_left }};
-
-function submitCode()
-{
- document.forms["code"].submit();
- var x = document.getElementById("status");
- x.innerHTML = "<strong>Checking answer ...</strong>";
- x = document.getElementById("check");
- x.disabled = true;
- x.value = "Checking Answer ...";
- document.getElementById("skip").disabled = true;
-}
-
-function secs_to_time(secs)
-{
- var h = Math.floor(secs/3600);
- var h_s = (h > 0) ? h+'h:' : '';
- var m = Math.floor((secs%3600)/60);
- var m_s = (m > 0) ? m+'m:' : '';
- var s_s = Math.floor(secs%60) + 's';
- return h_s + m_s + s_s;
-}
-
-function update_time()
-{
- time_left -= 1;
- if (time_left) {
- var elem = document.getElementById("time_left");
- var t_str = secs_to_time(time_left);
- elem.innerHTML = "<strong> Time left: " + t_str + "<strong>" ;
- setTimeout("update_time()", 1000);
- }
- else {
- document.forms["code"].submit();
- }
-}
-
-</script>
+ <script type="text/javascript">
+ var time_left = {{ time_left }};
+ function submitCode()
+ {
+ document.forms["code"].submit();
+ var x = document.getElementById("status");
+ x.innerHTML = "<strong>Checking answer ...</strong>";
+ x = document.getElementById("check");
+ x.disabled = true;
+ x.value = "Checking Answer ...";
+ document.getElementById("skip").disabled = true;
+ }
+
+ function secs_to_time(secs)
+ {
+ var h = Math.floor(secs/3600);
+ var h_s = (h > 0) ? h+'h:' : '';
+ var m = Math.floor((secs%3600)/60);
+ var m_s = (m > 0) ? m+'m:' : '';
+ var s_s = Math.floor(secs%60) + 's';
+ return h_s + m_s + s_s;
+ }
+
+ function update_time()
+ {
+ time_left -= 1;
+ if (time_left)
+ {
+ var elem = document.getElementById("time_left");
+ var t_str = secs_to_time(time_left);
+ elem.innerHTML = "<strong> Time left: " + t_str + "<strong>" ;
+ setTimeout("update_time()", 1000);
+ }
+ else
+ {
+ document.forms["code"].submit();
+ }
+ }
+ </script>
{% endblock script %}
{% block onload %} onload="update_time()" {% endblock onload %}
{% block content %}
-
<div class="topbar">
- <div class="fill">
- <div class="container">
- <h3 class="brand"><strong>Online Test</h3></strong>
- <!--a class="brand" href="#">Project name</a-->
-
- <form id="logout" action="{{URL_ROOT}}/exam/quit/" method="post" class="pull-right">
- {% csrf_token %}
- <button class="btn" type="submit" name="quit">Quit Exam and Logout</button>
- </form>
- </div>
- </div>
- </div>
+ <div class="fill">
+ <div class="container">
+ <h3 class="brand"><strong>Online Test</h3></strong>
+ <form id="logout" action="{{URL_ROOT}}/exam/quit/" method="post" class="pull-right">
+ {% csrf_token %}
+ <button class="btn" type="submit" name="quit">Quit Exam and Logout</button>
+ </form>
+ </div>
+ </div>
+</div>
<div class="container">
- <div class="content">
- <div class="page-header">
- <br><center><h4>Test for {{ user.first_name.title }} {{ user.last_name.title }} </h4></center>
- </div>
- <div class>
- <div class>
-
- <h4><u> {{ question.summary }} </u></h4>
- <h5>{{ question.description|safe }} </h5>
- <h5>(Marks : {{ question.points }}) </h5>
-
-
-{% if error_message %}<h5>ERROR:<h5><pre>{{ error_message }}</pre>{% endif %}
-
-<p id="status"></p>
-
-<form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/" method="post">
-{% csrf_token %}
-{% if question.type == "mcq" %}
-{% for option in question.options.strip.splitlines %}
-<input name="answer" type="radio" value="{{option}}" />{{option}} <br/>
-{% endfor %}
-{% else %}
-<textarea rows="15" style="width:700px;" name="answer">{% if last_attempt %}{{last_attempt.strip}}{% else %}{% if question.type == "bash" %}#!/bin/bash{% else %}# Enter your answer here.{% endif %}{% endif %}</textarea>
-{% endif %}
-
-{% if question.type == "mcq" %}
-<br><button class="btn" type="submit" name="check" id="check">Submit Answer</button>&nbsp;&nbsp;
-<!--input id="check" type="submit" name="check" value="Submit answer"/-->
-{% else %}
-<button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button>&nbsp;&nbsp;
-<!--input id="check" type="submit" name="check" value="Check Answer" onclick="submitCode();"/-->
-{% endif %}
-<button class="btn" type="submit" name="skip" id="skip">Skip Question</button>
-<!--input id="skip" type="submit" name="skip" value="Skip question" /-->
-</form>
-
-<h5> {{ user.first_name.title }} {{ user.last_name.title }}, You have {{ paper.questions_left }} question(s) left in {{ quiz_name }} </h5>
-
-<p id="time_left"><strong> Time left: </strong></p>
-
-<hr/>
-
-</div></div></div>
-<footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
- </footer>
+ <div class="content">
+ <div class="page-header">
+ <br><center><h4>Test for {{ user.first_name.title }} {{ user.last_name.title }} </h4></center>
+ </div>
+ <div class>
+ <div class>
+ <h4><u> {{ question.summary }} </u></h4>
+ <h5>{{ question.description|safe }} </h5>
+ <h5>(Marks : {{ question.points }}) </h5>
+ {% if error_message %}<h5>ERROR:<h5><pre>{{ error_message }}</pre>{% endif %}
+ <p id="status"></p>
+ <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/" method="post">
+ {% csrf_token %}
+ {% if question.type == "mcq" %}
+ {% for option in question.options.strip.splitlines %}
+ <input name="answer" type="radio" value="{{option}}" />{{option}} <br/>
+ {% endfor %}
+ {% else %}
+ <textarea rows="15" style="width:700px;" name="answer">{% if last_attempt %}{{last_attempt.strip}}{% else %}{% if question.type == "bash" %} #!/bin/bash{% else %}# Enter your answer here.{% endif %}{% endif %}</textarea>
+ {% endif %}
+
+ {% if question.type == "mcq" %}
+ <br><button class="btn" type="submit" name="check" id="check">Submit Answer</button>&nbsp;&nbsp;
+ {% else %}
+ <button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button>&nbsp;&nbsp;
+ {% endif %}
+ <button class="btn" type="submit" name="skip" id="skip">Skip Question</button>
+ </form>
+ <h5>{{ user.first_name.title }} {{ user.last_name.title }}, You have {{ paper.questions_left }} question(s) left in {{ quiz_name }} </h5>
+ <p id="time_left"><strong> Time left: </strong></p>
+ <hr/>
+ </div>
+ </div>
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
</div>
-
{% endblock content %}
diff --git a/testapp/templates/exam/quit.html b/testapp/templates/exam/quit.html
index 3ee85db..118ea07 100644
--- a/testapp/templates/exam/quit.html
+++ b/testapp/templates/exam/quit.html
@@ -2,28 +2,25 @@
{% block title %}Quit exam {% endblock %}
-
-
{% block content %}
-
<div class="container">
- <div class="content">
- <div class="page-header">
- <h1><Strong><center>Online Test</center></strong></h1>
- </div>
- <div class=row>
- <div class=span14>
- <center><h4>Your current answers are saved.</h4></center>
- <center><h4> Are you sure you wish to quit the exam?</h4></center>
- <form action="{{URL_ROOT}}/exam/complete/" method="post">
- {% csrf_token %}
- <center><button class="btn" type="submit" name="yes">Yes!</button>&nbsp;<button class="btn" type="submit" name="no">No!</button></center>
- </form>
- </div>
- </div>
-</div>
- <footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
- </footer>
+ <div class="content">
+ <div class="page-header">
+ <h1><Strong><center>Online Test</center></strong></h1>
+ </div>
+ <div class=row>
+ <div class=span14>
+ <center><h4>Your current answers are saved.</h4></center>
+ <center><h4> Are you sure you wish to quit the exam?</h4></center>
+ <form action="{{URL_ROOT}}/exam/complete/" method="post">
+ {% csrf_token %}
+ <center><button class="btn" type="submit" name="yes">Yes!</button>&nbsp;<button class="btn" type="submit" name="no">No!</button></center>
+ </form>
+ </div>
+ </div>
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
</div>
{% endblock content %}
diff --git a/testapp/templates/exam/register.html b/testapp/templates/exam/register.html
index 1555ab3..e416470 100644
--- a/testapp/templates/exam/register.html
+++ b/testapp/templates/exam/register.html
@@ -3,32 +3,26 @@
{% block title %}Registration form {% endblock %}
{% block content %}
-
- <div class="container">
- <div class="content">
- <div class="page-header">
- <h1><center>New User Registration</center></h1>
- </div>
- <div>
- <div>
+<div class="container">
+ <div class="content">
+ <div class="page-header">
+ <h1><center>Online Test</center></h1>
+ </div>
+ <div>
+ <div>
<h3><center>Please fill in the following details</center></h3><br>
-
-<form action="" method="post">
-{% csrf_token %}
-<center><table class=span1>
-{{ form.as_table }}
-</table></center>
-<center><button class="btn" type="submit">Register</button>&nbsp;&nbsp;<button class="btn" type="reset">Cancel</button></center>
-</form>
+ <form action="" method="post">
+ {% csrf_token %}
+ <center><table class=span1>
+ {{ form.as_table }}
+ </table></center>
+ <center><button class="btn" type="submit">Register</button>&nbsp;&nbsp;<button class="btn" type="reset">Cancel</button></center>
+ </form>
+ </div>
+ </div>
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
</div>
- </div>
- </div>
-
- <footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
- </footer>
-
- </div> <!-- /container -->
-
-
{% endblock content %}
diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html
index d546b06..e6aecd6 100644
--- a/testapp/templates/exam/show_quiz.html
+++ b/testapp/templates/exam/show_quiz.html
@@ -3,33 +3,31 @@
{% block title %} Quiz List {% endblock title %}
{% block script %}
-<script type='text/javascript'>
-function my_confirm(frm)
-{
- var r = confirm("Are you Sure ?");
- if(r==false)
- {
+ <script type='text/javascript'>
+ function my_confirm(frm)
+ {
+ var r = confirm("Are you Sure ?");
+ if(r==false)
+ {
for(i=0;i<frm.quiz.length;i++)
{
frm.quiz[i].checked=false;
}
location.replace("{{URL_ROOT}}/exam/manage/showquiz");
- }
-
-}
-function confirm_edit(frm)
-{
- var n = 0;
- for (var i =0;i<frm.quiz.length;i++)
- {
+ }
+ }
+ function confirm_edit(frm)
+ {
+ var n = 0;
+ for (var i =0;i<frm.quiz.length;i++)
+ {
if (frm.quiz[i].checked == false)
n = n + 1 ;
- }
- if(n == frm.quiz.length)
+ }
+ if(n == frm.quiz.length)
location.replace("{{URL_ROOT}}/exam/manage/showquiz");
-}
-
-</script>
+ }
+ </script>
{% endblock %}
{% block manage %}
@@ -46,13 +44,14 @@ function confirm_edit(frm)
{% csrf_token %}
{% for quiz in quizzes %}
-
<input type=checkbox name='quiz' value={{quiz.id}} />&nbsp;&nbsp;<a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br>
{% endfor %}
+
<br><br>
<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>&nbsp;&nbsp;
<button class="btn" type="submit" name='edit' value='edit' onClick="confirm_edit(frm);" >Edit Selected</button>&nbsp;&nbsp;
<button class="btn" type="submit" name="delete" value='delete' onClick="my_confirm(frm);">Delete Selected</button>
</form>
{% endif %}
+
{% endblock %}
diff --git a/testapp/templates/exam/showquestions.html b/testapp/templates/exam/showquestions.html
index edcba6f..116e747 100644
--- a/testapp/templates/exam/showquestions.html
+++ b/testapp/templates/exam/showquestions.html
@@ -1,37 +1,34 @@
{% extends "manage.html" %}
-{% block subtitle %}
-List of Questions
-{% endblock %}
+{% block subtitle %}List of Questions {% endblock %}
{% block script %}
-<script type='text/javascript'>
-function confirm_delete(frm)
-{
- var r = confirm("Are you Sure ?");
- if(r==false)
- {
+ <script type='text/javascript'>
+ function confirm_delete(frm)
+ {
+ var r = confirm("Are you Sure ?");
+ if(r==false)
+ {
for(i=0;i<frm.question.length;i++)
{
frm.question[i].checked=false;
}
location.replace("{{URL_ROOT}}/exam/manage/showquestion");
- }
-}
-function confirm_edit(frm)
-{
- var n = 0;
- for(i=0;i<frm.question.length;i++)
- {
+ }
+ }
+ function confirm_edit(frm)
+ {
+ var n = 0;
+ for(i=0;i<frm.question.length;i++)
+ {
if(frm.question[i].checked==true)
n = n+1;
- }
- if(n==0)
+ }
+ if(n==0)
location.replace("{{URL_ROOT}}/exam/manage/showquestion");
-
-}
-</script>
+ }
+ </script>
{% endblock %}
{% block manage %}
@@ -44,6 +41,5 @@ function confirm_edit(frm)
<button class="btn" type="button" onclick='location.replace("{{URL_ROOT}}/exam/manage/addquestion/");'>Add Question</button>&nbsp;&nbsp;
<button class="btn" type="submit" name='edit' value='edit' onClick="confirm_edit(frm);">Edit Selected</button>&nbsp;&nbsp;
<button class="btn" type="submit" onClick="confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button>
-
</form>
{% endblock %}
diff --git a/testapp/templates/exam/user_data.html b/testapp/templates/exam/user_data.html
index 943dfe8..fad0310 100644
--- a/testapp/templates/exam/user_data.html
+++ b/testapp/templates/exam/user_data.html
@@ -70,12 +70,10 @@ User IP address: {{ paper.user_ip }}
Grade/correct paper</a>
<br/>
{% if data.papers.count > 1 %}
-<a href="{{URL_ROOT}}/exam/manage/monitor/">
- Monitor quiz</a>
+<a href="{{URL_ROOT}}/exam/manage/monitor/">Monitor quiz</a>
{% else %}
{% with data.papers.0 as paper %}
-<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.quiz.id}}/">
- Monitor quiz</a>
+<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.quiz.id}}/">Monitor quiz</a>
{% endwith %}
{% endif %}
diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html
index 10842c3..a2941b0 100644
--- a/testapp/templates/manage.html
+++ b/testapp/templates/manage.html
@@ -3,47 +3,42 @@
{% block title %}Manage{% endblock title %}
{% block content %}
-
<div class="container">
<div class="content">
<div class="page-header">
<font size=6><strong>Online Test</font></strong>
<button class="btn pull-right" type="submit" onClick='location.replace("{{URL_ROOT}}/exam/complete/");'>Log out</button>
-
</div>
<div class=row>
- <div class=span10 style="overflow:auto">
- <h3><center>{% block subtitle %} {% endblock %}</center></h3><br>
- {% block manage %}
- {% endblock %}
- </div>
- <style type='text/css'>
- .content .span4 {
- min-height: 500px;
- }
- .textarea
- {
+ <div class=span10 style="overflow:auto">
+ <h3><center>{% block subtitle %} {% endblock %}</center></h3><br>
+ {% block manage %}
+ {% endblock %}
+ </div>
+ <style type='text/css'>
+ .content .span4
+ {
+ min-height: 500px;
+ }
+ .textarea
+ {
width: 10px;
- }
- </style>
-
- <div class="span4">
- <h5>Manage</h5>
- <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>
- </ul>
- </div>
+ }
+ </style>
+ <div class="span4">
+ <h5>Manage</h5>
+ <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>
+ </ul>
+ </div>
</div>
- </div>
-<footer>
- <p>&copy; FOSSEE group, IIT Bombay</p>
-</footer>
-
- </div> <!-- /container -->
-
-
+ </div>
+ <footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
+</div> <!-- /container -->
{% endblock content %}