summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorprathamesh2016-08-31 01:37:20 +0530
committerprathamesh2016-08-31 01:37:20 +0530
commit24593514378e86cd2f0ef62e11e8a4c9dee0f5ad (patch)
tree686d263a31445a19d6addd4fca13e9bb1041755d /yaksh/templates
parent11dec9deba7120f85d3d2b47cfd31fca8587bbbc (diff)
parentaefc8eed3b0c18520059b4005978f1db9cf5591b (diff)
downloadonline_test-24593514378e86cd2f0ef62e11e8a4c9dee0f5ad.tar.gz
online_test-24593514378e86cd2f0ef62e11e8a4c9dee0f5ad.tar.bz2
online_test-24593514378e86cd2f0ef62e11e8a4c9dee0f5ad.zip
Merge branch 'master' of https://github.com/FOSSEE/online_test into view_answerpaper
Resolved Conflicts: yaksh/views.py
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/user.html2
-rw-r--r--yaksh/templates/yaksh/addteacher.html4
-rw-r--r--yaksh/templates/yaksh/complete.html2
-rw-r--r--yaksh/templates/yaksh/courses.html82
-rw-r--r--yaksh/templates/yaksh/question.html21
-rw-r--r--yaksh/templates/yaksh/user_data.html10
6 files changed, 92 insertions, 29 deletions
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html
index 7f93f00..4805c2d 100644
--- a/yaksh/templates/user.html
+++ b/yaksh/templates/user.html
@@ -35,7 +35,7 @@
<li><a href="{{ URL_ROOT }}/exam/changepassword">Change Password</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>
+ <li><strong><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/complete/");' id='logout'>Log out</a></strong></li>
</ul>
</div>
</div>
diff --git a/yaksh/templates/yaksh/addteacher.html b/yaksh/templates/yaksh/addteacher.html
index 7e04f71..6722a52 100644
--- a/yaksh/templates/yaksh/addteacher.html
+++ b/yaksh/templates/yaksh/addteacher.html
@@ -18,6 +18,7 @@
<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses");'>Cancel</button> </center></form>
</div>
<br><br>
+
<form action="{{ URL_ROOT }}/exam/manage/addteacher/{{ course.id }}/" method="post">
{% csrf_token %}
{% if success == True %}
@@ -56,8 +57,7 @@
</form>
{% if status == True %}
<div class="row">
- <div class="span6 offset4 wrap">
- <center><b><u>Teacher(s) Added</u></b></center><br>
+ <div class="span6 offset4 wrap">
{% if teachers_added %}
{% for teacher in teachers_added %}
<div class="well">
diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html
index 07cbf3a..98adf9b 100644
--- a/yaksh/templates/yaksh/complete.html
+++ b/yaksh/templates/yaksh/complete.html
@@ -29,5 +29,5 @@
<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>
+ <center><a href="{{URL_ROOT}}/exam/" id="login_again"> Login Again </a></center>
{% endblock content %}
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 06c848c..42f49d1 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -9,15 +9,12 @@
{% endblock %}
{% block manage %}
-<a href="{{URL_ROOT}}/exam/manage/allotted_course/">View Allotted Courses</a><br>
+
{% if not courses %}
- <center><h4> No new Courses added </h4></center>
+ <center><h4> No new Courses created </h4></center>
{% else %}
-<center><h3> Course(s) Added</h3></center>
+<center><h3> Course(s) Created</h3></center>
{% for course in courses %}
- {% if user != course.creator %}
- <h4> {{course.creator.get_full_name}} added you to this course</h4>
- {% endif %}
<div class="row show-grid">
<div class="span14">
<div class="row">
@@ -79,7 +76,76 @@
</div>
<br><br>
{% endfor %}
- <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
- <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>
+ {% endif %}
+
+{% if allotted_courses %}
+ <center><h3> Course(s) Allotted </h3></center>
+
+ {% for course in allotted_courses %}
+ <div class="row show-grid">
+ <div class="span14">
+ <div class="row">
+ <div class="span6">
+ <p>
+ <b><u>Course</u></b>
+ {% if course.active %}
+ <span class="label success">Active</span>
+ {% else %}
+ <span class="label important">Closed</span>
+ {% endif %}
+ </p>
+ <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a>
+ </br></br>
+ <div class="row">
+ <div class="span6 wrap">
+ <center><b><u> Course Creator</u></b></center>
+ {{course.creator}}
+ <center><b><u>Teacher(s) Added to {{ course }}</u></b></center>
+ {% if course.get_teachers %}
+ <div align="left">
+ <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post">
+ {% csrf_token %}
+ {% for teacher in course.get_teachers %}
+ <div class="well">
+ <div class="row">
+ <div class="span3" style="width: auto;">
+ <input type="checkbox" name="remove" value="{{ teacher.id }}">&nbsp;{{ teacher.get_full_name }}
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ <button class="btn success" type="submit">Remove Selected</button>
+ </div>
+ {% else %}
+ <center><b>No Teacher(s) Added</b></center>
+ {% endif %}
+ </form>
+ </div>
+ </div>
+ </div>
+ <div class="span6">
+ <p><b><a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher</a></b></p>
+ </div>
+ <div class="span6">
+ <p><b><u>Quiz(zes)</u></b></p>
+ {% if course.get_quizzes %}
+ {% for quiz in course.get_quizzes %}
+ <a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a><br>
+ {% endfor %}
+ {% else %}
+ <p><b>No quiz </b></p>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ <br><br>
+ {% endfor %}
+{% else %}
+ <center><h4> No new Courses allotted </h4></center>
{% endif %}
+<button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
+ {% if courses or allotted_courses %}
+ <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>
+{% endif %}
{% endblock %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 73d851a..9a0f899 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -85,19 +85,6 @@ function call_skip(url)
form.action = url
form.submit();
}
- {% if error_message == 'Correct Output'%}
- {% if paper.questions_left %}
- window.setTimeout(function()
- {
- location.href="{{ URL_ROOT }}/exam/{{ paper.current_question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/"
- }, 2000);
- {% else %}
- window.setTimeout(function()
- {
- location.href="{{ URL_ROOT }}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/"
- }, 2000);
- {% endif %}
- {% endif %}
</script>
{% endblock script %}
@@ -165,11 +152,17 @@ function call_skip(url)
<input type=hidden name="question_id" id="question_id" value={{ question.id }}></input>
{% if question.type == "mcq" %}
+ {% if error_message %}
+ <p>{{ error_message }}</p>
+ {% endif %}
{% for test_case in test_cases %}
<input name="answer" type="radio" value="{{ test_case.options }}" />{{ test_case.options }} <br/>
{% endfor %}
{% endif %}
{% if question.type == "mcc" %}
+ {% if error_message %}
+ <p>{{ error_message }}</p>
+ {% endif %}
{% for test_case in test_cases %}
<input name="answer" type="checkbox" value="{{ test_case.options }}"> {{ test_case.options }}
<br>
@@ -188,7 +181,7 @@ function call_skip(url)
{% endif %}
- {% if question.type == "mcq" or question.type == "mcc "%}
+ {% if question.type == "mcq" or question.type == "mcc"%}
<br><button class="btn" type="submit" name="check" id="check">Submit Answer</button>&nbsp;&nbsp;
{% elif question.type == "upload" %}
<br><button class="btn" type="submit" name="check" id="check" onClick="return validate();">Upload</button>&nbsp;&nbsp;
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 04544f9..2e7db50 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -56,11 +56,15 @@ User IP address: {{ paper.user_ip }}
</p>
<p>Student answer: {{ answers.0 }}</p>
{% else %}{# non-mcq questions #}
-<pre>
-{% for answer in answers %}################################################################################
+{% for answer in answers %}
+{% if not answer.skipped %}
+<pre>
+###############################################################################
{{ answer.answer.strip }}
# Autocheck: {{ answer.error }}
-{% endfor %}</pre>
+</pre>
+{% endif %}
+{% endfor %}
{% endif %}
{% with answers|last as answer %}
<p><em>Marks: {{answer.marks}} </em> </p>