diff options
author | prathamesh | 2016-04-06 16:55:26 +0530 |
---|---|---|
committer | prathamesh | 2016-04-07 14:40:02 +0530 |
commit | b9f96f3edc315fbcab6752cf13c65dd127ab5bd1 (patch) | |
tree | 4650dadd7c00a4bd8930aff86faacbcaf0593d3d /yaksh/templates | |
parent | 69d53a33c77270a9244344d9de676d39502a9f1b (diff) | |
download | online_test-b9f96f3edc315fbcab6752cf13c65dd127ab5bd1.tar.gz online_test-b9f96f3edc315fbcab6752cf13c65dd127ab5bd1.tar.bz2 online_test-b9f96f3edc315fbcab6752cf13c65dd127ab5bd1.zip |
Phase 2 views cleanup
views cleaned further
used model forms
removed unwanted templates
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/automatic_questionpaper.html | 87 | ||||
-rw-r--r-- | yaksh/templates/yaksh/edit_question.html | 61 | ||||
-rw-r--r-- | yaksh/templates/yaksh/edit_quiz.html | 39 | ||||
-rw-r--r-- | yaksh/templates/yaksh/editquestionpaper.html | 15 | ||||
-rw-r--r-- | yaksh/templates/yaksh/manual_questionpaper.html | 79 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 18 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizlist.html | 24 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizzes_user.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_quiz.html | 33 | ||||
-rw-r--r-- | yaksh/templates/yaksh/showquestions.html | 1 |
10 files changed, 20 insertions, 341 deletions
diff --git a/yaksh/templates/yaksh/automatic_questionpaper.html b/yaksh/templates/yaksh/automatic_questionpaper.html deleted file mode 100644 index b9a4ae0..0000000 --- a/yaksh/templates/yaksh/automatic_questionpaper.html +++ /dev/null @@ -1,87 +0,0 @@ -{% extends "manage.html" %} - - -{% block subtitle %}Design Question Paper{% 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/autotaggit.css" /> -<style> -select -{ - width:auto; -} -</style> -{% endblock %} -{% block script %} -<script src="/static/yaksh/js/jquery-1.4.2.min.js" type="text/javascript"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/add_questionpaper.js"></script> -{% endblock %} - -{% block manage %} -<input type=hidden id="url_root" value={{ URL_ROOT }}> -<center><b>Automatic mode to design the Question Paper</center><br> -<form action="" method="post" name=frm> - {% csrf_token %} - <center> - Tag Conditions: - <select name='first_tag'> - <option value="">Select Tag </option> - {% for tag in data.tags %} - <option value={{tag}}>{{tag}}</option> - {% endfor %} - </select> - - <select name='first_condition'> - <option value="or">OR</option> - <option value="and">AND</option> - </select> - - <select name='second_tag'> - <option value="">Select Tag </option> - {% for tag in data.tags %} - <option value={{tag}}>{{tag}}</option> - {% endfor %} - </select> - - <select name='second_condition'> - <option value="or">OR</option> - <option value="and">AND</option> - </select> - - <select name='third_tag'> - <option value="null">Select Tag </option> - {% for tag in data.tags %} - <option value={{tag}}>{{tag}}</option> - {% endfor %} - </select> - </center> - - <br> - - <center>Number of question: <input type=text id=num_questions name='num_questions' style="width:25px;"> <button class=btn type=submit name='fetch' value='fetch'>Fetch Questions</button><br></center> - - <br> - <br> - <p><b>Below is the list of Questions fetched according to the given tag conditions</p> - <hr> - <center><table class=span10> - <th>Summary - <th>Type - <th>Points - <th>Tags - {% for question in data.questions %} - <input type=hidden name='questions' value={{ question.id }} /> - <tr><td>{{ question.summary }} <td>{{ question.type }} <td>{{ question.points }} <td> - {% for tag in question.tags.all %} - {{ tag }} - {% endfor %} - </tr> - <br> - {% endfor %} - </table> - {% if data.msg %}<div class="alert alert-error">{{ data.msg }}</div>{% endif %} - <center><button class=btn type=submit name='save' value='save'>Save Question Paper</button></center> -</form> - -{% endblock %} diff --git a/yaksh/templates/yaksh/edit_question.html b/yaksh/templates/yaksh/edit_question.html deleted file mode 100644 index 9a66250..0000000 --- a/yaksh/templates/yaksh/edit_question.html +++ /dev/null @@ -1,61 +0,0 @@ -{% extends "manage.html" %} - -{% block subtitle %}Edit Question{% 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/autotaggit.css" /> -{% endblock %} -{% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/edit_question.js"></script> -<script src="/static/yaksh/js/jquery-1.4.2.min.js" type="text/javascript"></script> -{% endblock %} - -{% block onload %} onload = 'javascript:textareaformat();' {% endblock %} - -{% block manage %} -<form name='frm' action="{{URL_ROOT}}/exam/manage/editquestion/" method="post" onSubmit="return autosubmit()" onKeyPress='javascript:render_question(frm);'> - {% csrf_token %} -<center><p>Click on the Question links to edit the question.</p></center> - -<table> - - {% for question, test in data_list %} - - <tr><td height=10><a id='a{{forloop.counter}}' onClick="data('contentDiv{{forloop.counter}}','myContent{{forloop.counter}}','a{{forloop.counter}}','{{question.summary.value}}');" style='cursor:pointer;'>{{question.summary.value}}</a> - - <div id="contentDiv{{forloop.counter}}" style="display:none;"> - <div id="myContent{{forloop.counter}}" style="display: none;"> - - <center><table class=span1> - <tr><td><b>Summary:</b> <td>{{ question.summary }}{{ question.summary.errors }} - <tr><td><b> Language: </b><td> {{question.language}}{{question.language.errors}} - <tr><td><b> Active: </b><td> {{ question.active }}{{question.active.errors}} Type: {{ question.type }}{{question.type.errors}} - <tr><td><b>Points:<td><button class="btn-mini" name={{forloop.counter}} type="button" onClick="increase(frm,{{forloop.counter}});">+</button>{{ question.points }}<button class="btn-mini" type="button" onClick="decrease(frm,{{forloop.counter}});">-</button>{{ question.points.errors }} - <tr><td><strong>Rendered: </strong><td><p id='my{{forloop.counter}}'></p> - <tr><td><b>Description: <td>{{ question.description }} - {{question.description.errors}} <tr><td><b>Test: <td> - {{ question.test }}{{question.test.errors}} - <tr><td><b>Snippet: <td>{{ question.snippet }}{{ question.snippet.errors }} - </td></b></td></tr> - <tr><td><b>Tags: </b><td>{{ question.tags }} - <tr><td id='label_option{{forloop.counter}}'><b>Options:<td>{{ question.options }} - {{question.options.errors}} {{question.options.helptext}} - </table></center> - <center><table class=span1> - {{ test }} - </table></center> - </div> - </div> - {% endfor %} -</table></center> - - -{% for i in data %} - <input type=hidden name='questions' value="{{ i }}" /> -{% 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/yaksh/templates/yaksh/edit_quiz.html b/yaksh/templates/yaksh/edit_quiz.html deleted file mode 100644 index fb7df93..0000000 --- a/yaksh/templates/yaksh/edit_quiz.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "manage.html" %} - - -{% block subtitle %}Edit Quiz(zes){% endblock %} - -{% block css %} -<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> -{% endblock %} - -{% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/edit_quiz.js"></script> -{% endblock %} - -{% block onload %} onload = 'javascript:form_load();' {% endblock %} - -{% block manage %} -<form name=frm action="{{URL_ROOT}}/exam/manage/editquiz/" method="post"> - {% csrf_token %} - <center> - <table class=span1> - {% for form in forms %} - <tr><td><b>Start Date: <td>{{ form.start_date}} - <tr><td><b>Duration: <td> {{ form.duration }}<br>{{form.duration.help_text}} - <tr><td><b>Active: <td> {{ form.active }} - <tr><td><b>Description: <td> {{ form.description }} - <tr><td><b>Passing Criteria: <td> {{ form.pass_criteria }}<br>{{form.pass_criteria.help_text}} - <tr><td><b>Language: <td> {{ form.language }} - <tr><td><b>Prerequisite: <td> {{ form.prerequisite }} - <hr> - {% endfor %} - </table> - </center> -{% for i in data %} - <input type=hidden name='quizzes' value="{{ i }}" /> -{% 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/yaksh/templates/yaksh/editquestionpaper.html b/yaksh/templates/yaksh/editquestionpaper.html index 2b7b835..fa6d7d7 100644 --- a/yaksh/templates/yaksh/editquestionpaper.html +++ b/yaksh/templates/yaksh/editquestionpaper.html @@ -10,12 +10,17 @@ {% block manage %} <form name=frm action="" method="post"> {% csrf_token %} - -{% for i in papers.questions %} -<input type="checkbox" name="papers" value="{{ i.id }}"> <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ i.id }}">{{ i.summary}}</a><br> +<p><u> Fixed Questions </u></p> +{% for q in fixed_questions %} +<input type="checkbox" name="papers" value="{{ q.id }}"> <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ q.id }}">{{ q.summary}}</a><br> +{% endfor %} +<p><u> Random Questions </u></p> +{% for random_set in random_questions %} +<p>{{ random_set.num_questions}} question(s) from {{ random_set.questions.all|length }} question(s)</p> +{% for q in random_set.questions.all %} +<input type="checkbox" name="papers" value="{{ q.id }}"> <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ q.id }}">{{ q.summary}}</a><br> +{% endfor %} {% endfor %} <br> -<button class="btn" type="submit" name='add' value=add>Add Question</button> -<button class="btn" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button> </form> {% endblock %} diff --git a/yaksh/templates/yaksh/manual_questionpaper.html b/yaksh/templates/yaksh/manual_questionpaper.html deleted file mode 100644 index 86bfd67..0000000 --- a/yaksh/templates/yaksh/manual_questionpaper.html +++ /dev/null @@ -1,79 +0,0 @@ -{% extends "manage.html" %} - - -{% block subtitle %}Design Question Paper{% 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/autotaggit.css" /> -<style> -select -{ - width:auto; -} -</style> -{% endblock %} -{% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.4.2.min.js" type="text/javascript"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/add_questionpaper.js"></script> -{% endblock %} - -{% block manage %} -<input type=hidden id="url_root" value={{ URL_ROOT }}> -<center><b>Manual mode to design the Question Paper</center><br> - -<form action="" method="post" name=frm> - {% csrf_token %} - <center> - Tag Conditions: - <select name='first_tag'> - <option value="">Select Tag </option> - {% for tag in data.tags %} - <option value={{tag}}>{{tag}}</option> - {% endfor %} - </select> - <select name='first_condition'> - <option value="or">OR</option> - <option value="and">AND</option> - </select> - <select name='second_tag'> - <option value="">Select Tag </option> - {% for tag in data.tags %} - <option value={{tag}}>{{tag}}</option> - {% endfor %} - </select> - <select name='second_condition'> - <option value="or">OR</option> - <option value="and">AND</option> - </select> - <select name='third_tag'> - <option value="null">Select Tag </option> - {% for tag in data.tags %} - <option value={{tag}}>{{tag}}</option> - {% endfor %} - </select> - </center> - <br> - <center><button class=btn type=submit name='fetch' value='fetch'>Fetch Questions</button> - <br><br><b>Below is the list of Questions fetched according to the given tag conditions</b></center> - <hr> - <center><table class=span10> - <th> - <th>Summary - <th>Type - <th>Points - <th>Tags - {% for question in data.questions %} - <tr><td><input type=checkbox name=questions value={{question.id}}> <td> {{ question.summary }} <td>{{ question.type }} <td>{{ question.points }} <td> - {% for tag in question.tags.all %} - {{ tag }} - {% endfor %} - </tr> - <br> - {% endfor %} - </table> - {% if data.msg %}<div class="alert alert-error">{{ data.msg }}</div>{% endif %} - <center><button class=btn type=submit name='save' value='save'>Save Question Paper</button></center> -</form> - -{% endblock %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 0c48167..1fb70b8 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -90,19 +90,19 @@ function call_skip(url) form.action = url form.submit(); } - {% if question.type == 'code' and success == 'True'%} + {% if error_message == 'Correct Output'%} {% if paper.questions_left %} window.setTimeout(function() { {% for qid in paper.questions.all %} - location.href="{{ URL_ROOT }}/exam/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" + location.href="{{ URL_ROOT }}/exam/{{ qid.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" {% endfor %} - }, 1000); + }, 2000); {% else %} window.setTimeout(function() { location.href="{{ URL_ROOT }}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" - }, 1000); + }, 2000); {% endif %} {% endif %} </script> @@ -132,21 +132,19 @@ function call_skip(url) {% for qid in paper.questions.all %} {% if qid in paper.questions_unanswered.all %} {% if qid.id == question.id %} - {{ q.id}} - <li class="active"><a href="#" data-toggle="tooltip" title="{{ qid.description }}" onclick="call_skip('{{ URL_ROOT }}/exam/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li> + <li class="active"><a href="#"data-toggle="tooltip" title="{{ qid.description }}" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li> {% else %} - <li><a href="#" data-toggle="tooltip" title="{{ qid.description }}" onclick="call_skip('{{ URL_ROOT }}/exam/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li> + <li><a href="#" data-toggle="tooltip" title="{{ qid.description }}" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ forloop.counter }}</a></li> {% endif %} {% endif %} {% if qid in paper.questions_answered.all %} - <li class="disabled"><a href="#">{{ forloop.counter }}</a></li> + <li class="disabled"><a href="#" data-toggle="tooltip" title="{{ qid.description }}" >{{ forloop.counter }}</a></li> {% endif %} {% endfor %} </ul> </div> </div> </div> - <div class="span13"> <h4><u> {{ question.summary }} </u><font class=pull-right>(Marks : {{ question.points }}) </font></h4><br> <font size=3 face=arial> {{ question.description|safe }} </font> @@ -204,7 +202,7 @@ function call_skip(url) <button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button> {% endif %} {% if paper.unanswered.all|length != 1 %} - <button class="btn" type="submit" name="skip" id="skip">Attempt Later</button> + <button class="btn" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')" name="skip" id="skip">Attempt Later</button> {% endif %} </form> </div> diff --git a/yaksh/templates/yaksh/quizlist.html b/yaksh/templates/yaksh/quizlist.html deleted file mode 100644 index 9b1fd73..0000000 --- a/yaksh/templates/yaksh/quizlist.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "base.html" %} - -{% block title %} Quiz List {% endblock title %} - -{% block formtitle %} Quiz List {% endblock %} - -{% block pagetitle %} Online Test {% endblock %} - -{% block content %} -{% if not quizzes and not quiz %} -<center><h5> No quizzes available. </h5></center> -{% endif %} - -{% if quizzes %} -<form method="post" action="" name='frm'> -{% csrf_token %} - -{% for quiz in quizzes %} -<a href="{{URL_ROOT}}/exam/start/{{quiz.id}}/">{{ quiz.description }}</a><br> -{% endfor %} -</form> -{% endif %} - -{% endblock %} diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index 69cf3ba..223952e 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -54,11 +54,11 @@ <tr> {% if not quiz.is_expired %} <td> - <a href="{{ URL_ROOT }}/exam/intro/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br> + <a href="{{ URL_ROOT }}/exam/start/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br> </td> {% else %} <td> - <a href="{{ URL_ROOT }}/exam/intro/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br> + <a href="{{ URL_ROOT }}/exam/start/{{quiz.questionpaper_set.get.id}}">{{ quiz.description }}</a><br> {{ quiz.description }} <span class="label important">INACTIVE</span><br> </td> {% endif %} diff --git a/yaksh/templates/yaksh/show_quiz.html b/yaksh/templates/yaksh/show_quiz.html deleted file mode 100644 index 2cd4e11..0000000 --- a/yaksh/templates/yaksh/show_quiz.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "manage.html" %} - -{% block title %} Quiz List {% endblock title %} - -{% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/show_quiz.js"></script> -{% endblock %} - -{% block subtitle %} Quiz List {% endblock %} -{% block manage %} -{% if not quizzes and not quiz %} -<center><h5> No quizzes available. </h5></center> -<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button> -{% endif %} - -{# ############################################################### #} -{# This is rendered when we are just viewing exam/monitor #} -{% if quizzes %} -<form method="post" action="" name='frm'> -{% csrf_token %} - -{% for quiz in quizzes %} -<input type=checkbox name='quiz' value={{quiz.id}} /> <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> -<button class="btn" type="submit" name='edit' value='edit' onClick="return confirm_edit(frm);" >Edit Selected</button> -<button class="btn" type="submit" name="delete" value='delete' onClick="return confirm_delete(frm);">Delete Selected</button> -</form> -{% endif %} - -{% endblock %} diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html index 6222d6d..ca51d1a 100644 --- a/yaksh/templates/yaksh/showquestions.html +++ b/yaksh/templates/yaksh/showquestions.html @@ -38,7 +38,6 @@ </div> <br> <button class="btn" type="button" onclick='location.replace("{{URL_ROOT}}/exam/manage/addquestion/");'>Add Question</button> -<button class="btn" type="submit" name='edit' value='edit' onClick="return confirm_edit(frm);">Edit Selected</button> <button class="btn" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button> </form> {% endblock %} |