diff options
author | ankitjavalkar | 2015-09-14 12:28:41 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-09-15 11:33:59 +0530 |
commit | 7a60f782995eed0352f3172f445bb35ae8ee6aa9 (patch) | |
tree | 91d6d12b0a494dd9777fd1120e92db5763bf009a /yaksh/templates | |
parent | 32cde26f9807a29eb1fae0833e353212d43d7802 (diff) | |
download | online_test-7a60f782995eed0352f3172f445bb35ae8ee6aa9.tar.gz online_test-7a60f782995eed0352f3172f445bb35ae8ee6aa9.tar.bz2 online_test-7a60f782995eed0352f3172f445bb35ae8ee6aa9.zip |
Remove testapp dir, remove reference to testapp in paths, files
Diffstat (limited to 'yaksh/templates')
33 files changed, 1699 insertions, 0 deletions
diff --git a/yaksh/templates/404.html b/yaksh/templates/404.html new file mode 100644 index 0000000..7d33dd3 --- /dev/null +++ b/yaksh/templates/404.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} +The requested page does not exist. +{% endblock %} diff --git a/yaksh/templates/500.html b/yaksh/templates/500.html new file mode 100644 index 0000000..d02721f --- /dev/null +++ b/yaksh/templates/500.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block content %} +Internal Server error.<br /> +This event will be reported.<br /> +Sorry for the inconvinience. +{% endblock %} diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html new file mode 100644 index 0000000..5284a77 --- /dev/null +++ b/yaksh/templates/base.html @@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title> + {% block title %} + {% endblock %} + </title> + + {% block meta %} + <meta charset="utf-8"> + <meta name="description" content=""> + <meta name="author" content=""> + {% endblock %} + + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css" type="text/css" /> + {% block css %} + {% endblock %} + + {% block script %} + {% endblock %} + </head> + +<body {% block onload %}{% endblock %}> + <div class="container"> + <div class="content"> + <div class="page-header"> + <h1><Strong><center>{% block pagetitle %} {% endblock pagetitle %}</center></strong></h1> + </div> + <div class=row> + <div class=span14> + <h3><center>{% block formtitle %} {% endblock formtitle %}</center></h3><br> + {% block content %} + {% endblock %} + </div> + </div> + </div> + <footer> + <p>© FOSSEE group, IIT Bombay</p> + </footer> + </div> + +</body> +</html> + diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html new file mode 100644 index 0000000..ca2ac65 --- /dev/null +++ b/yaksh/templates/manage.html @@ -0,0 +1,88 @@ +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title> + {% block title %} + {% endblock %} + </title> + + {% block meta %} +<meta charset="utf-8"> + <meta name="description" content=""> +<meta name="author" content=""> + {% endblock %} + + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css" type="text/css" /> + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/manage.css" type="text/css" /> + {% block css %} + {% endblock %} + + {% block script %} + {% endblock %} + </head> + +<body {% block onload %}{% endblock %}> +<div class="topbar"> + <div class="fill"> + <div class="container"> + <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> + </ul> +<ul style="float:right;"> +<li><strong><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'>Log out</a></strong></li> + </ul> + </div> + </div> +</div> + <div class="container"> + <div class="content"> + <div class="page-header"> +<h3><center>{% block subtitle %}Welcome {{ user.first_name.title }} {{user.last_name.title}} !{% endblock %}</center></h3><br> + </div> + <div class=row> + <div class=span14> + {% block manage %} + <center><h4>List of quizzes! Click on the given links to have a look at answer papers for a quiz.</h4></center> + <hr> + <table class="bordered-table zebra-striped"> + <th>Quiz</th> + <th>Taken By</th> + <th>No. of users Passed</th> + <th>No. of users Failed</th> + {% for paper, answer_papers, users_passed, users_failed in users_per_paper %} + <tr> + <td> + <a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.id}}/">{{ paper.quiz.description }}</a> + </td> + <td> + {{ answer_papers|length }} user(s) + </td> + <td> + {{ users_passed }} + </td> + <td> + {{ users_failed }} + </td> + </tr> + {% endfor %} + </table> + <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> + </center> +{% endblock %} + </div> + </div> + </div> + <footer> + <p>© FOSSEE group, IIT Bombay</p> + </footer> + </div> + +</body> +</html> diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html new file mode 100644 index 0000000..00151d2 --- /dev/null +++ b/yaksh/templates/user.html @@ -0,0 +1,58 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title> + {% block title %} + {% endblock %} + </title> + + {% block meta %} + <meta charset="utf-8"> + <meta name="description" content=""> + <meta name="author" content=""> + {% endblock %} + + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css" type="text/css" /> + {% block css %} + {% endblock %} + + {% block script %} + {% endblock %} + </head> + +<body {% block onload %}{% endblock %}> +<div class="topbar"> + <div class="fill"> + <div class="container"> + <h3 class="brand"><strong>Online Test</h3></strong> + <ul> + <li><a href="{{ URL_ROOT }}/exam/quizzes">Quizzes</a></li> + <li><a href="{{ URL_ROOT }}/exam/results">Results</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> + </ul> + </div> + </div> +</div> + <div class="container"> + <div class="content"> + <div class="page-header"> + <h3><center>{% block subtitle %}Welcome {{ user.first_name.title }} {{user.last_name.title}} {% endblock %}</center></h3><br> + </div> + <div class=row> + <div class=span14> + {% block manage %} + {% endblock %} + </div> + </div> + </div> + <footer> + <p>© FOSSEE group, IIT Bombay</p> + </footer> + </div> + +</body> +</html> diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html new file mode 100644 index 0000000..b896081 --- /dev/null +++ b/yaksh/templates/yaksh/add_question.html @@ -0,0 +1,50 @@ +{% extends "manage.html" %} + + +{% block subtitle %}Add 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 type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.4.2.min.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/add_question.js"></script> +{% endblock %} + +{% block onload %} onload='javascript:textareaformat();' {% endblock %} + +{% block manage %} +<form action="" method="post" name=frm onSubmit="return autosubmit();"> + {% csrf_token %} + <center><table class=span1> + <tr><td>Summary: <td>{{ form.summary }}{{ form.summary.errors }} + <tr><td> Language: <td> {{form.language}}{{form.language.errors}} + <tr><td> Active: <td> {{ form.active }}{{form.active.errors}} Type: {{ form.type }}{{form.type.errors}} + <tr><td>Points:<td><button class="btn-mini" type="button" onClick="increase(frm);">+</button>{{ form.points }}<button class="btn-mini" type="button" onClick="decrease(frm);">-</button>{{ form.points.errors }} + <tr><td><strong>Rendered: </strong><td><p id='my'></p> + <tr><td>Description: <td>{{ form.description}} {{form.description.errors}} + <tr><td>Snippet: <td>{{ form.snippet }}{{ form.snippet.errors }}</td></tD></td></tr> + <tr><td>Tags: <td>{{ form.tags }} + <tr><td id='label_option'>Options: <td>{{ form.options }} {{form.options.errors}} + <tr><td id='label_solution'>Test: <td>{{ form.test }} {{form.test.errors}} + <tr><td id='label_ref_code_path'>Reference Code Path: <td>{{ form.ref_code_path }} {{form.ref_code_path.errors}} + + <form method="post" action=""> + {% if formset%} + {{ formset.management_form }} + {% for form in formset %} + {{ form }} + {% endfor %} + {% endif %} + </form> + </table></center> + <center><button class="btn" type="submit" name="add_test">Add Test Case</button> + <button class="btn" type="submit" name="delete_test">Remove Test Case</button> + </center><br> + <center><button class="btn" type="submit" name="save_question">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/add_questionpaper.html b/yaksh/templates/yaksh/add_questionpaper.html new file mode 100644 index 0000000..eaa96bc --- /dev/null +++ b/yaksh/templates/yaksh/add_questionpaper.html @@ -0,0 +1,27 @@ +{% 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" /> +{% 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 }}> +<form> +{% csrf_token %} +Select mode to design Question Paper: +<select name='mode' id='mode' onChange='javascript:load_data();'> + <option>---------</option> + <option>Automatic</option> + <option>Manual</option> +</select> +</form> + +{% endblock %} diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html new file mode 100644 index 0000000..e78023d --- /dev/null +++ b/yaksh/templates/yaksh/add_quiz.html @@ -0,0 +1,25 @@ +{% extends "manage.html" %} + + +{% block subtitle %}Add Quiz{% 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/add_quiz.js"></script> +{% endblock %} +{% block onload %} onload="javascript:test();" {% 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" 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> +</form> +{% endblock %} diff --git a/yaksh/templates/yaksh/ajax_marks.html b/yaksh/templates/yaksh/ajax_marks.html new file mode 100644 index 0000000..716bb88 --- /dev/null +++ b/yaksh/templates/yaksh/ajax_marks.html @@ -0,0 +1,4 @@ +<option value='select'>Select Marks</option> +{% for mark in marks %} +<option value="{{ mark.0 }}"> {{ mark.0 }} </option> +{% endfor %} diff --git a/yaksh/templates/yaksh/ajax_question_filter.html b/yaksh/templates/yaksh/ajax_question_filter.html new file mode 100644 index 0000000..11bf660 --- /dev/null +++ b/yaksh/templates/yaksh/ajax_question_filter.html @@ -0,0 +1,15 @@ +<div id="questions"> + {% if questions %} + <h5 class="highlight"><input type="checkbox" id="checkall" class="ignore"> Select All </h5> + {% endif %} + <ul class="inputs-list"> + + {% for question in questions %} + <li> + <label> + <input type="checkbox" name="question" data-qid="{{question.id}}"> <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{ question }}</a><br> + </label> + </li> + {% endfor %} + </ul> +</div> diff --git a/yaksh/templates/yaksh/ajax_questions.html b/yaksh/templates/yaksh/ajax_questions.html new file mode 100644 index 0000000..e343f9b --- /dev/null +++ b/yaksh/templates/yaksh/ajax_questions.html @@ -0,0 +1,31 @@ +<div id="questions"> + {% if questions %} + <input type="checkbox" id="checkall" class="ignore"> + <span><b> <font size="3"> Select All </font></b></span> + {% endif %} + <ul class="inputs-list"> + + {% for question in questions %} + <li> + <label> + <input type="checkbox" name="questions" data-qid="{{question.id}}"> + <span> {{ question.summary }} </span> + </label> + </li> + {% endfor %} + </ul> +</div> + +<div id="num"> + <select id="numbers"> + <option value="">Number of questions to be picked from the pool</option> + {% for q in questions %} + {% if forloop.counter0 != 0 %} + <option value={{forloop.counter0}}>{{ forloop.counter0}}</option> + {% endif %} + {% if questions|length == 1%} + <option value=1>1</option> + {% endif %} + {% endfor %} + </select> +</div> diff --git a/yaksh/templates/yaksh/automatic_questionpaper.html b/yaksh/templates/yaksh/automatic_questionpaper.html new file mode 100644 index 0000000..b9a4ae0 --- /dev/null +++ b/yaksh/templates/yaksh/automatic_questionpaper.html @@ -0,0 +1,87 @@ +{% 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/complete.html b/yaksh/templates/yaksh/complete.html new file mode 100644 index 0000000..08abe76 --- /dev/null +++ b/yaksh/templates/yaksh/complete.html @@ -0,0 +1,33 @@ +{% extends "base.html" %} + +{% block title %}Good bye!{% endblock %} + +{% block pagetitle %}Online Test{% endblock %} +{% block content %} +{% csrf_token %} + {% if submitted or unattempted %} + <br><center><table class="bordered-table zebra-striped span8" + style="text-align:left;"> + <tr><td><b>Submitted Questions</b></td> + <td> + {% if submitted %} + {{ submitted|join:", " }} + {% else %} + <p><b>No Questions have been Submitted</b></p> + {% endif %} + </td></tr> + <tr><td><b>Unattempted Questions</b></td> + <td> + {% if unattempted %} + {{ unattempted|join:", " }} + {% else %} + <p><b>All Questions have been Submitted</b></p> + {% endif %} + </td></tr> + </table></center> + {% endif %} + <center><h2> Good bye! </h2></center> + <center><h4> {{message}} </h4></center> + <br><center><h4>You may now close the browser.</h4></center><br> + <center><a href="{{URL_ROOT}}/exam/"> Login Again </a></center> +{% endblock content %} diff --git a/yaksh/templates/yaksh/design_questionpaper.html b/yaksh/templates/yaksh/design_questionpaper.html new file mode 100644 index 0000000..2aa169b --- /dev/null +++ b/yaksh/templates/yaksh/design_questionpaper.html @@ -0,0 +1,182 @@ +{% extends "manage.html" %} + +{% block subtitle %}Design Question Paper{% endblock %} + +{% block css %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/base.css" type="text/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" /> +<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/question_paper_creation.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/bootstrap-tabs.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/add_questionpaper.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/question_paper_creation.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap-modal.js"></script> +{% endblock %} + +{% block manage %} +<input type=hidden id="url_root" value={{ URL_ROOT }}> +<center><b>Manual mode to design the {{lang}} Question Paper</center><br> + <ul class="tabs" data-tabs="tabs"> + <li class="active" id="fixed-tab"> + <a href="#fixed-questions" id="fixed"> + STEP 1<br> + Add Fixed Questions + </a> + </li> + <li id="random-tab"> + <a href="#random-questions" id="random"> + STEP 2<br> + Add Random Questions + </a> + </li> + <li id="finish-tab"> + <a href="#finish" id="finished"> + STEP 3<br> + Finish + </a></li> +</ul> + +<form action="{{URL_ROOT}}/exam/manage/designquestionpaper/" method="post" name=frm > {% csrf_token %} + <div> + <h3>Total Marks: <span id="total_marks" class="well">0</span></h3> + </div> +<div class="tab-content"> + <!-- common to fixed and random questions --> + <div class="row" id="selectors"> + <h5 style="padding-left: 20px;">Please select Question type and Marks</h5> + <div class="span4"> + {{ form.question_type }} + </div> <!-- /.span4 --> + <div class="span4"> + {{ form.marks }} + </div> <!-- /.span4 --> + <div class="span4"> + <div class="pull-left" id="number-wrapper"></div> + </div> <!-- /.span4 --> + </div> <!-- /.row --> + <br><br> + + + <div class="tab-pane active" id="fixed-questions"> + <div class="row"> + <div class="span7"> + <div id="fixed-available-wrapper"> + <p><u>Select questions to add:</u></p> + <div id="fixed-available"> + </div> + <a id="add-fixed" class="btn small primary pull-right" href="#">Add to paper</a> + </div> + </div> + <div class="span7"> + <div id="fixed-added-wrapper"> + <p><u>Fixed questions currently in paper:</u></p> + <div id="fixed-added"> + </div> + </div> + </div> + </div> <!-- /.row --> + <br> + <div class="pull-right"> + <a class="btn" id="fixed-next">Next ></a> + </div> + + </div> <!-- /#fixed-questions --> + + + <div class="tab-pane" id="random-questions"> + <div class="row"> + <div class="span7"> + <div id="random-available-wrapper"> + <p><u>Select questions to add to the pool:</u></p> + <div id="random-available"> + </div> + <a id="add-random" class="btn small primary pull-right" href="#">Add to paper</a> + </div> + </div> + <div class="span7"> + <div id="random-added-wrapper"> + <p><u>Pool of questions currently in paper:</u></p> + <div id="random-added"> + </div> + </div> + </div> + </div> <!-- /.row --> + <br> + <div class="pull-left"> + <a class="btn" id="random-prev">< Previous</a> + </div> + <div class="pull-right"> + <a class="btn" id="random-next">Next ></a> + </div> + </div> <!-- /#random-questions --> + + <div class="tab-pane" id="finish"> + <center> + <h5>Almost finished creating your question paper</h5> + <label style="float: none;"> + {{ form.shuffle_questions }} + <span>Auto shuffle.</span> + </label> <br><br> + <input class ="btn primary large" type="button" id="preview" value="Preview question paper"> + <input class ="btn primary large" type="button" id="save" value="Save question paper"> + <br> + <div class="pull-left"> + <a class="btn" id="finish-prev">< Previous</a> + </div> + </center> + </div> <!-- /#finish --> +</div> +<!-- /.tab-content --> +</form> +<br> +<div class="clearfix"></div> + +<!-- Modal --> +<div class="modal fade " id="myModal" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">Question Paper Preview</h4> + </div> + <div id = "modal_body"class="modal-body"> + </div> + <div class="modal-footer"> + <button type="button" class="btn primary close" data-dismiss="modal">OK</button> + </div> + </div> + </div> +</div> + +<div class="modal fade " id="modalSave" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">Cannot Save</h4> + </div> + <div class="modal-body"> + Please select questions for your paper + </div> + <div class="modal-footer"> + <button type="button" class="btn primary close" data-dismiss="modal">OK</button> + </div> + </div> + </div> +</div> +</div> + +<script> + $(function () { + $('.tabs').tabs() + }) +</script> +{% endblock %} diff --git a/yaksh/templates/yaksh/edit_question.html b/yaksh/templates/yaksh/edit_question.html new file mode 100644 index 0000000..9a66250 --- /dev/null +++ b/yaksh/templates/yaksh/edit_question.html @@ -0,0 +1,61 @@ +{% 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 new file mode 100644 index 0000000..fb7df93 --- /dev/null +++ b/yaksh/templates/yaksh/edit_quiz.html @@ -0,0 +1,39 @@ +{% 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 new file mode 100644 index 0000000..2b7b835 --- /dev/null +++ b/yaksh/templates/yaksh/editquestionpaper.html @@ -0,0 +1,21 @@ +{% extends "manage.html" %} + + +{% block subtitle %}Questions in "{{ papers.quiz.description }}"{% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/show_question.js"></script> +{% endblock %} + +{% 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> +{% 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/grade_user.html b/yaksh/templates/yaksh/grade_user.html new file mode 100644 index 0000000..8c094a7 --- /dev/null +++ b/yaksh/templates/yaksh/grade_user.html @@ -0,0 +1,94 @@ +{% extends "manage.html" %} + +{% block title %} Grading papers for {{ data.user.get_full_name.title }} {% endblock title %} + +{% block subtitle %}Grading papers for {{ data.user.get_full_name.title }}{% endblock %} + +{% block css %} + <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/gradeuser.css" type="text/css" /> +{% endblock %} + +{% block script %} +<script src= "{{ URL_ROOT }}/static/yaksh/js/edit_question.js"></script> +{% endblock %} +{% block manage %} + +<p> +Name: {{ data.user.get_full_name.title }} +{% if data.profile %} +(roll number: {{ data.profile.roll_number }}) <br/> +{{ data.profile.position }}, +{{ data.profile.department }}, +{{ data.profile.institute }} +{% endif %} +</p> + +{% if data.papers %} + +{% for paper in data.papers %} + +<h2> Quiz: {{ paper.quiz.description }} </h2> + +<p> +Questions correctly answered: {{ paper.get_answered_str }} <br/> +Total attempts at questions: {{ paper.answers.count }} <br/> +Marks obtained: {{ paper.get_total_marks }} <br/> +Start time: {{ paper.start_time }} <br/> +</p> + +{% if paper.answers.count %} +<h3> Answers </h3><br> +<form name=frm id="q{{ paper.quiz.id }}_form" + action="{{URL_ROOT}}/exam/manage/gradeuser/{{data.user.username}}/" method="post"> +{% csrf_token %} +{% for question, answers in paper.get_question_answers.items %} +<div class="for-question"> +<p><strong> + Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }}) +</strong> +<strong><a href="" onClick="grade_data('myContent{{question.id}}'); return false;" style="cursor:pointer;" />Details</strong></p></a> +<div id="contentDiv"> + <div id="myContent{{question.id}}" style="padding:5px; display:none;"> + <p> Description : {{ question.description }} </p> + <p> Test : {{ question.test }} </p> + </div> +</div> +<div class="question-form"> + +{% if question.type == "mcq" %} +<br> +<p> Choices: +{% for option in question.options.strip.splitlines %} {{option}}, {% endfor %} +</p> +<p>Student answer: {{ answers.0 }}</p> +{% else %}{# non-mcq questions #} +<pre> +{% for answer in answers %}################################################################################ +{{ answer.answer.strip }} +# Autocheck: {{ answer.error }} +{% endfor %}</pre> +{% endif %} {# if question.type #} +{% with answers|last as answer %} +Marks: <input id="q{{ question.id }}" type="text" + name="q{{ question.id }}_marks" size="4" + value="{{ answer.marks }}"><br><br> +{% endwith %} +</div> +</div> +{% endfor %} {# for question, answers ... #} + + +<h3>Teacher comments: </h3> +<textarea id="comments_{{paper.question_paper.id}}" rows="10" cols="80" + name="comments_{{ paper.question_paper.id }}">{{ paper.comments }}</textarea> +<br> +<br><button class="btn" type="submit" name="submit_{{paper.quiz.id}}">Save Marks</button> + +</form> +{% endif %} {# if paper.answers.count #} + +{% endfor %} {# for paper in data.papers #} + +{% endif %} {# if data.papers #} + +{% endblock%} diff --git a/yaksh/templates/yaksh/intro.html b/yaksh/templates/yaksh/intro.html new file mode 100644 index 0000000..9c5c14d --- /dev/null +++ b/yaksh/templates/yaksh/intro.html @@ -0,0 +1,53 @@ +{% extends "base.html" %} + +{% block title %}Instructions and Rules {% endblock %} +{% block pagetitle %}Online Test {% endblock %} +{% block formtitle %}Important instructions & rules {% endblock %} +{% block content %} + + {% if enable_quiz_time or disable_quiz_time %} + {% if quiz_expired %} + <div class="alert alert-error"> + This Quiz has expired. You can no longer attempt this Quiz. + <br/> + </div> + {% else %} + <div class="alert"> + You can attempt this Quiz at any time between {{ enable_quiz_time }} and {{ disable_quiz_time }} + <br/> + You are not allowed to attempt the Quiz before or after this duration + <br/> + </div> + {% endif %} + {% endif %} + <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/quizzes/" method="post" align="center"> + {% csrf_token %} + <center><button class="btn" name="home">Home</button></center> + </form> + {% if not quiz_expired %} + <form action="{{URL_ROOT}}/exam/start/{{ attempt_num }}/{{ paper_id }}/" method="post" align="center"> + {% csrf_token %} + <center><button class="btn" type="submit" name="start">Start Exam!</button></center> + </form> + {% endif %} +{% endblock content %} diff --git a/yaksh/templates/yaksh/login.html b/yaksh/templates/yaksh/login.html new file mode 100644 index 0000000..dfeac1e --- /dev/null +++ b/yaksh/templates/yaksh/login.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} + +{% block title %}Login{% endblock title %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %}Login{% endblock %} +{% block css %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/login.css" type="text/css" /> +{% endblock %} +{% block content %} + + <form action="" method="post"> + {% csrf_token %} + + <center><table class=span1> + {{ form.as_table }} + </table></center> + <center><button class="btn" type="submit">Login</button> <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> + +{% endblock content %} diff --git a/yaksh/templates/yaksh/manual_questionpaper.html b/yaksh/templates/yaksh/manual_questionpaper.html new file mode 100644 index 0000000..86bfd67 --- /dev/null +++ b/yaksh/templates/yaksh/manual_questionpaper.html @@ -0,0 +1,79 @@ +{% 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/monitor.html b/yaksh/templates/yaksh/monitor.html new file mode 100644 index 0000000..52695cb --- /dev/null +++ b/yaksh/templates/yaksh/monitor.html @@ -0,0 +1,69 @@ +{% extends "manage.html" %} + +{% block title %} Quiz results {% endblock title %} + +{% block meta %} <meta http-equiv="refresh" content="30"/> {% endblock meta %} + +{% block css %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> +{% endblock %} +{% block subtitle %} + {% if not quizzes and not quiz %} + Quiz Results + {% endif %} + {% if quizzes %} + Available Quizzes + {% endif %} + {% if quiz %} + {{ quiz.description }} Results + {% endif %} +{% endblock %} +{% block manage %} + {% if not quizzes and not quiz %} + <center><h5> No quizzes available. </h5></center> + {% endif %} + +{# ############################################################### #} +{# This is rendered when we are just viewing exam/monitor #} +{% if quizzes %} +<ul> +{% for q in quizzes %} +<li><a href="{{URL_ROOT}}/exam/manage/monitor/{{q.id}}/">{{ q.quiz.description }}</a></li> +{% endfor %} +</ul> +{% endif %} + +{# ############################################################### #} +{# This is rendered when we are just viewing exam/monitor/quiz_num #} +{% if quiz %} + +{% if papers %} +{# <p> Quiz: {{ quiz_name }}</p> #} +<p>Number of papers: {{ papers|length }} </p> +<table border="1" cellpadding="3"> + <tr> + <th> Name </th> + <th> Username </th> + <th> Roll number </th> + <th> Institute </th> + <th> Questions answered </th> + <th> Marks obtained </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> {{ paper.profile.roll_number }} </td> + <td> {{ paper.profile.institute }} </td> + <td> {{ paper.get_answered_str }} </td> + <td> {{ paper.marks_obtained }} </td> + <td> {{ paper.answers.count }} </td> + </tr> + {% endfor %} +</table> +{% else %} +<p> No answer papers so far. </p> +{% endif %} {# if papers #} +{% endif %} +{% endblock %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html new file mode 100644 index 0000000..e532513 --- /dev/null +++ b/yaksh/templates/yaksh/question.html @@ -0,0 +1,203 @@ +{% extends "base.html" %} + +<!DOCTYPE html> + +{% block title %} Answer question {% endblock %} + +{% block css %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question.css" type="text/css" /> + +{% 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/question.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap-modal.js"></script> + +<script> +var time_left = {{ time_left }} +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>" + t_str + "</strong>"; + setTimeout("update_time()", 1000); + } + else + { + document.forms["code"].submit(); + } +} + +function setSnippetHeight() +{ + var ta = document.getElementById('snippet'); + var height = ta.scrollHeight+'px'; + ta.style.height = 'auto'; + ta.style.height = height; + autoresize(); +} + +function validate(){ + uploaded_file = document.getElementById("assignment").value; + if(uploaded_file == ""){ + $("#upload_alert").modal("show"); + return false; + } + else + { + return true; + } +} + +function call_skip(url) +{ + form = document.forms["code"] + form.action = url + form.submit(); +} + +</script> +{% endblock script %} + + + +{% block onload %} onload="update_time();setSnippetHeight()" {% endblock %} + +{% block pagetitle %} + +<table><h6><div> + <tr><td class=td1-class><h5>You have {{ paper.questions_left }} question(s) left in {{ quiz_name }} </h5> + <td class=td2-class><div class=time-div id="time_left"> + </div> +</div></h6></table> + +{% endblock %} + +{% block content %} +<div class="topbar"> + <div class="fill"> + <div class="container"> + <h3 class="brand"><strong>Online Test</h3></strong> + <ul> + <li> <h5><a> Hi {{user.first_name.title}} {{user.last_name.title}} </a></h5> + </ul> + <form id="logout" action="{{URL_ROOT}}/exam/quit/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" class="pull-right"> + {% csrf_token %} + <button class="btn" type="submit" name="quit">Quit Exam</button> </li> + + </form> + </div> + </div> +</div> +<div class = container> + <div class="sidebar"> + <p>Question Navigator </p> + <div class="pagination"> + <ul> + {% for qid, num in questions.items %} + {% if qid in to_attempt %} + {% if qid == question.id|slugify %} + <li class="active"><a href="#" onclick="call_skip('{{ URL_ROOT }}/exam/{{ qid }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ num }}</a></li> + {% else %} + <li><a href="#" onclick="call_skip('{{ URL_ROOT }}/exam/{{ qid }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')">{{ num }}</a></li> + {% endif %} + {% endif %} + {% if qid in submitted %} + <li class="done"><a href="#">{{ num }}</a></li> + {% endif %} + {% endfor %} + </ul> + </div> + </div> +</div> + + <h4><u> {{ question.summary }} </u><font class=pull-right>(Marks : {{ question.points }}) </font></h4><br> + <font size=3 face=arial> {{ question.description|safe }} </font> + {% if error_message %} + <div class="alert alert-error"> + {% for e in error_message.splitlines %} + {{ e|join:"" }} + <br/> + {% endfor%} + </div>{% endif %} + + <p id="status"></p> + + <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" enctype="multipart/form-data"> + {% csrf_token %} + <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input> + + {% if question.type == "mcq" %} + {% for option in question.options.strip.splitlines %} + <input name="answer" type="radio" value="{{option}}" />{{option}} <br/> + {% endfor %} + {% endif %} + {% if question.type == "upload" %} + <p>Upload assignment file for the said question<p> + <input type=file id="assignment" name="assignment"> + <hr> + {% endif %} + {% if question.type == "mcc" %} + {% for option in question.options.strip.splitlines %} + <input name="answer" type="checkbox" value="{{ option }}"> {{ option }} + <br> + {% endfor %} + {% endif %} + {% if question.type == "code" %} + + <textarea rows="1" style="padding:0;height:auto;width:750px;overflow:hidden;background-color:white;border: 0 none white;" readonly="yes" name="snippet" id="snippet" wrap="off">{% if last_attempt %}{{ question.snippet }}{% else %}{% if question.type == "bash" %} #!/bin/bash {{ question.snippet }}{% else %}{{ question.snippet }}{% endif %}{% endif %}</textarea> + + <textarea tabindex=1 rows="10" style="padding:0;height:auto; box-shadow: none;width:750px;margin-bottom:10px;overflow:hidden;border:none;" name="answer" id="answer" wrap="off" onkeydown="return catchTab(this,event)">{% if last_attempt %}{{last_attempt}}{% else %}{% if question.type == "bash" %}{% else %}{% endif %}{% endif %}</textarea> +<br> + + <script type="text/javascript"> + addLineNumbers('answer'); + </script> + <script>addLineNumbers('snippet');</script> + {% endif %} + + {% if question.type == "mcq" or question.type == "mcc "%} + <br><button class="btn" type="submit" name="check" id="check">Submit Answer</button> + {% elif question.type == "upload" %} + <br><button class="btn" type="submit" name="check" id="check" onClick="return validate();">Upload</button> + {% else %} + <button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button> + {% endif %} + {% if to_attempt|length != 1 %} + <button class="btn" type="submit" name="skip" id="skip">Attempt Later</button> + {% endif %} + </form> + + + <!-- Modal --> + <div class="modal fade " id="upload_alert" > + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">File not selected</h4> + </div> + <div id = "modal_body"class="modal-body"> + <font color="brown"><b>Kindly attach a file and then click upload.</b></font> + </div> + <div class="modal-footer"> + <button type="button" class="btn primary close" data-dismiss="modal">OK</button> + </div> + </div> + </div> + </div> + +{% endblock content %} diff --git a/yaksh/templates/yaksh/quit.html b/yaksh/templates/yaksh/quit.html new file mode 100644 index 0000000..91bce64 --- /dev/null +++ b/yaksh/templates/yaksh/quit.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block title %}Quit exam {% endblock %} +{% block pagetitle %}Online Test {% endblock %} +{% block content %} + {% if submitted or unattempted %} + <br><center><table class="bordered-table zebra-striped span8" + style="text-align:left;"> + <tr><td><b>Submitted Questions</b></td> + <td> + {% if submitted %} + {{ submitted|join:", " }} + {% else %} + <p><b>No Questions have been Submitted</b></p> + {% endif %} + </td></tr> + <tr><td><b>Unattempted Questions</b></td> + <td> + {% if unattempted %} + {{ unattempted|join:", " }} + {% else %} + <p><b>All Questions have been Submitted</b></p> + {% endif %} + </td></tr> + </table></center> + {% endif %} + + <center><h4>Your current answers are saved.</h4></center> + <center><h4> Are you sure you wish to quit the exam?</h4></center> + <center><h4> Be sure, as you won't be able to restart this exam.</h4></center> + <form action="{{URL_ROOT}}/exam/complete/{{ attempt_num }}/{{ id }}/" method="post"> + {% csrf_token %} + <center><button class="btn" type="submit" name="yes">Yes!</button> <button class="btn" type="button" name="no" onClick="window.location='{{ URL_ROOT }}/exam/start/{{ attempt_num }}/{{ id }}/'">No!</button></center> + </form> +{% endblock content %} diff --git a/yaksh/templates/yaksh/quizlist.html b/yaksh/templates/yaksh/quizlist.html new file mode 100644 index 0000000..9b1fd73 --- /dev/null +++ b/yaksh/templates/yaksh/quizlist.html @@ -0,0 +1,24 @@ +{% 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 new file mode 100644 index 0000000..fbd50ce --- /dev/null +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -0,0 +1,87 @@ +{% extends "user.html" %} + + +{% 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" /> +{% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/bootstrap-alert.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/quizzes_user.js"></script> +{% endblock %} + + +{% 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> + {% 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> + {% 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>Mraks 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/register.html b/yaksh/templates/yaksh/register.html new file mode 100644 index 0000000..5ff79cc --- /dev/null +++ b/yaksh/templates/yaksh/register.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% block title %}Registration form {% endblock %} + +{% block pagetitle %}Online Test {% endblock %} +{% block formtitle %}Please fill in the following details {% endblock %} + +{% block content %} + + + +<form action="" method="post"> + {% csrf_token %} + <center><table class=span1> + {{ form.as_table }} + </table></center> + <center><button class="btn" type="submit">Register</button> <button class="btn" type="reset">Cancel</button></center> +</form> + +{% endblock content %} diff --git a/yaksh/templates/yaksh/results_user.html b/yaksh/templates/yaksh/results_user.html new file mode 100644 index 0000000..0f35c0d --- /dev/null +++ b/yaksh/templates/yaksh/results_user.html @@ -0,0 +1,28 @@ +{% extends "user.html" %} + + +{% block subtitle %}Results{% endblock %} + +{% block css %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" /> +{% endblock %} + +{% block manage %} +<form action="" method="post" name=frm> + {% csrf_token %} + <center><table class="span6"> + <th>Quiz Description + <th>Obtained Marks + <th>Maximum Marks + <th>Percentage + {% for paper in papers %} + <tr> + {% for i in paper %} + <td>{{ i }} + {% endfor %} + <br> + {% endfor %} + </table></center> +</form> +{% endblock %} + diff --git a/yaksh/templates/yaksh/show_quiz.html b/yaksh/templates/yaksh/show_quiz.html new file mode 100644 index 0000000..2cd4e11 --- /dev/null +++ b/yaksh/templates/yaksh/show_quiz.html @@ -0,0 +1,33 @@ +{% 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/showquestionpapers.html b/yaksh/templates/yaksh/showquestionpapers.html new file mode 100644 index 0000000..e705ce7 --- /dev/null +++ b/yaksh/templates/yaksh/showquestionpapers.html @@ -0,0 +1,23 @@ +{% extends "manage.html" %} + + +{% block subtitle %}List of Question Papers {% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/show_question.js"></script> +{% endblock %} + +{% block manage %} +{% if papers %} +<form name=frm action="" method="post"> +{% csrf_token %} +{% for i in papers %} +<input type="checkbox" name="papers" value="{{ i.id }}"> <a href="{{URL_ROOT}}/exam/manage/showquestionpapers/{{ i.id }}">{{ i.quiz.description }}</a><br> +{% endfor %} +<br> +<button class="btn" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button> +</form> +{% else %} +<center><h3>No Question Papers available</h3></center> +{% endif %} +{% endblock %} diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html new file mode 100644 index 0000000..6222d6d --- /dev/null +++ b/yaksh/templates/yaksh/showquestions.html @@ -0,0 +1,44 @@ +{% extends "manage.html" %} + + +{% block subtitle %}List of Questions {% endblock %} + +{% block script %} +<script src="{{ URL_ROOT }}/static/yaksh/js/min.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/show_question.js"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/question_filter.js"></script> +{% endblock %} + +{% block manage %} +<form name=frm action="" method="post"> +{% csrf_token %} +<div class="row" id="selectors"> + <h5 style="padding-left: 20px;">Filters</h5> + <div class="span4"> + {{ form.question_type }} + </div> + <div class="span4"> + {{ form.language }} + </div> + <div class="span4"> + {{ form.marks }} + </div> +</div> +<br> +<div class="row"> +<div class="span16"> + <button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}");'>Clear Filters</button> +</div> +</div> +<br> +<div id="filtered-questions"> +{% for i in questions %} +<input type="checkbox" name="question" value="{{ i.id }}"> <a href="{{URL_ROOT}}/exam/manage/addquestion/{{ i.id }}">{{ i }}</a><br> +{% endfor %} +</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 %} diff --git a/yaksh/templates/yaksh/showusers.html b/yaksh/templates/yaksh/showusers.html new file mode 100644 index 0000000..ae91076 --- /dev/null +++ b/yaksh/templates/yaksh/showusers.html @@ -0,0 +1,26 @@ +{% extends "manage.html" %} + + +{% block subtitle %} +List of Users +{% endblock %} + +{% block css %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/showusers.css" type="text/css" /> +{% endblock css %} + + +{% block manage %} +<center><table style="text-align:left;" class=table-class border=3> +<th>Username +<th>First Name +<th>Last Name +<th>Quiz Description +{% for papers in question %} +<tr><td><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{ papers.user.username }}">{{ papers.user.username }}</a><br> + <td >{{ papers.user.first_name.title }} + <td>{{ papers.user.last_name.title }} + <td>{{ papers.question_paper.quiz.description }} +{% endfor %} +</table></center> +{% endblock %} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html new file mode 100644 index 0000000..61a3a97 --- /dev/null +++ b/yaksh/templates/yaksh/user_data.html @@ -0,0 +1,80 @@ +{% extends "manage.html" %} + +{% block title %} Data for user {{ data.user.get_full_name.title }} {% endblock title %} + +{% block manage %} + +{% block subtitle %}Data for user {{ data.user.get_full_name.title }}{% endblock %} +<form action="" method="post"> +<p> +Name: {{ data.user.get_full_name.title }} <br/> +Username: {{ data.user.username }} <br/> +{% if data.profile %} +Roll number: {{ data.profile.roll_number }} <br/> +Position: {{ data.profile.position }} <br/> +Department: {{ data.profile.department }} <br/> +Institute: {{ data.profile.institute }} <br/> +{% endif %} +Email: {{ data.user.email }} <br/> +Date joined: {{ data.user.date_joined }} <br/> +Last login: {{ data.user.last_login }} +</p> + +{% if data.papers %} +<p><a href="{{URL_ROOT}}/exam/manage/gradeuser/{{ data.user.username }}/"> + Grade/correct paper</a> +</p> + +{% for paper in data.papers %} + +<h2> Quiz: {{ paper.quiz.description }} </h2> + +<p> +Questions correctly answered: {{ paper.get_answered_str }} <br/> +Total attempts at questions: {{ paper.answers.count }} <br/> +Marks obtained: {{ paper.get_total_marks }} <br/> +Start time: {{ paper.start_time }} <br/> +User IP address: {{ paper.user_ip }} +</p> + +{% if paper.answers.count %} +<h3> Answers </h3> +{% for question, answers in paper.get_question_answers.items %} +<p><strong> Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})</strong> </p> +{% if question.type == "mcq" %} +<p> Choices: +{% for option in question.options.strip.splitlines %} {{option}}, {% endfor %} +</p> +<p>Student answer: {{ answers.0 }}</p> +{% else %}{# non-mcq questions #} +<pre> +{% for answer in answers %}################################################################################ +{{ answer.answer.strip }} +# Autocheck: {{ answer.error }} +{% endfor %}</pre> +{% endif %} +{% with answers|last as answer %} +<p><em>Marks: {{answer.marks}} </em> </p> +{% endwith %} +{% endfor %} {# for question, answers ... #} +<h3>Teacher comments: </h3> +{{ paper.comments|default:"None" }} +{% endif %} {# if paper.answers.count #} + +{% endfor %} {# for paper in data.papers #} + +{% endif %} {# if data.papers #} +<br /> +<hr /> +<a href="{{URL_ROOT}}/exam/manage/gradeuser/{{ data.user.username }}/"> + Grade/correct paper</a> +<br/> +{% if data.papers.count > 1 %} +<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> +{% endwith %} +{% endif %} + +{% endblock %} |