summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorprathamesh2017-12-27 17:32:21 +0530
committerprathamesh2017-12-27 17:53:50 +0530
commit51a93b42b1d7b3a94e227796aa8d4f6e97de9929 (patch)
treedb35061da2b9891dd597337be78946eb67c5df3c /yaksh/templates
parentb44db042059e69df4c4a948d6dff73604c7abf83 (diff)
downloadonline_test-51a93b42b1d7b3a94e227796aa8d4f6e97de9929.tar.gz
online_test-51a93b42b1d7b3a94e227796aa8d4f6e97de9929.tar.bz2
online_test-51a93b42b1d7b3a94e227796aa8d4f6e97de9929.zip
Exercise feature in video lessons
Exercise is same as quiz except for following differences: - no time limit - no marks weightage - no instruction page - skip denied for a particular time An attribute 'is_exercise' in Quiz determines whether the quiz is exercise or not. Questions contains 'min_time' attribute. For an exercise a question cannot be skipped for an allotted minimum time, after which either django or JavaScript makes Next button available. Implementation is as such due to complexity of our existing views and templates. Also, after min_time, same question with Next button is available to move on, assuming that solution is present in the video.
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/exam.html4
-rw-r--r--yaksh/templates/yaksh/add_exercise.html41
-rw-r--r--yaksh/templates/yaksh/add_question.html1
-rw-r--r--yaksh/templates/yaksh/courses.html7
-rw-r--r--yaksh/templates/yaksh/question.html37
5 files changed, 76 insertions, 14 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index d0812a4..4fd83dd 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -20,9 +20,9 @@
<ul class="nav navbar-nav navbar">
<li style="padding: 10px"><button class="btn btn-danger btn-sm" type="submit" name="quit">
{% if paper.questions_unanswered.all %}
- Quit Exam
+ Quit {{ quiz_type }}
{% else %}
- Finish Exam
+ Finish {{ quiz_type }}
{% endif %}
<span class="glyphicon glyphicon-off"></span></button></li>
</ul>
diff --git a/yaksh/templates/yaksh/add_exercise.html b/yaksh/templates/yaksh/add_exercise.html
new file mode 100644
index 0000000..af3e7b4
--- /dev/null
+++ b/yaksh/templates/yaksh/add_exercise.html
@@ -0,0 +1,41 @@
+{% extends "manage.html" %}
+
+
+{% block subtitle %}Add Exercise{% endblock %}
+
+{% block css %}
+<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/question_quiz.css" type="text/css" />
+<link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/jquery.datetimepicker.css" type="text/css" />
+{% endblock %}
+{% block script %}
+<script src="{{ URL_ROOT }}/static/yaksh/js/jquery-1.9.1.min.js"></script>
+<script src="{{ URL_ROOT }}/static/yaksh/js/add_quiz.js"></script>
+<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.datetimepicker.full.min.js"></script>
+{% endblock %}
+{% block onload %} onload="javascript:test();" {% endblock %}
+{% block content %}
+
+<form name=frm id=frm action="" method="post" >
+ {% csrf_token %}
+ <center>
+ <table class="span1 table">
+ {{ form.as_table }}
+ </table>
+ <script type="text/javascript">
+ $("#id_start_date_time").datetimepicker({format: 'Y-m-d H:i:s'});
+ $("#id_end_date_time").datetimepicker({format: 'Y-m-d H:i:s'});
+ </script>
+ <br/><br/>
+ </center>
+
+ <center><button class="btn" type="submit" id="submit" name="questionpaper"> Save
+ </button>
+
+ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> </center>
+</form>
+ <style type="text/css">
+ #rendered_text{
+ width: 550px;
+ }
+ </style>
+{% endblock %}
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 6ead019..c294d9a 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -25,6 +25,7 @@
<tr><td>Description: <td>{{ qform.description}} {{qform.description.errors}}
<tr><td>Tags: <td>{{ qform.tags }}
<tr><td>Snippet: <td>{{ qform.snippet }}
+ <tr><td>Minimum Time(in minutes):<td> {{ qform.min_time }}
<tr><td>Partial Grading: <td>{{ qform.partial_grading }}
<tr><td>Grade Assignment Upload:<td> {{ qform.grade_assignment_upload }}
<tr><td> File: <td> {{ fileform.file_field }}{{ fileform.file_field.errors }}
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 5daf944..a06ee7e 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -290,7 +290,8 @@
<div id="all_quizzes" >
<div class="col-md-offset-2 main">
{% if type == "quiz" %}
- <a href="{{URL_ROOT}}/exam/manage/addquiz/" class="btn btn-primary">Add new Quiz</a>
+ <a href="{{URL_ROOT}}/exam/manage/addquiz/" class="btn btn-primary">Add New Quiz</a>
+ <a href="{{URL_ROOT}}/exam/manage/add_exercise/" class="btn btn-primary">Add New Exercise</a>
{% if not quizzes %}
<center><h4> No new Quiz Added</h4></center>
<br><br>
@@ -308,7 +309,11 @@
<td>{{forloop.counter}}</td>
<td width="30%">
<ul class="list-group">
+ {% if quiz.is_exercise %}
+ <a href="{{URL_ROOT}}/exam/manage/add_exercise/{{quiz.id}}/">{{ quiz.description }}</a>
+ {% else %}
<a href="{{URL_ROOT}}/exam/manage/addquiz/{{quiz.id}}/">{{ quiz.description }}</a>
+ {% endif %}
{% if quiz.active %}
<span class="label label-success">Active</span>
{% else %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 6adda5b..978d226 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -23,7 +23,18 @@
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script>
+init_val = '{{ last_attempt|escape_quotes|safe }}';
+lang = "{{ question.language }}"
+course_id = "{{course.id}}"
+module_id = "{{module.id}}"
+is_exercise = "{{ quiz.is_exercise }}"
+can_skip = "{{ can_skip }}"
+delay_time = new Number("{{ delay_time }}")
+
var time_left = {{ paper.time_left }}
+{% if quiz.is_exercise %}
+ time_left = {{ delay_time }}
+{% endif %}
function getTimeRemaining(endtime){
var t = Date.parse(endtime) - Date.parse(new Date());
@@ -52,13 +63,15 @@ function updateClock(){
var mm = ('0' + t.minutes).slice(-2);
var ss = ('0' + t.seconds).slice(-2);
- if(t.total<0){
-
+ if(t.total<0 && is_exercise=="False"){
document.forms["code"].submit();
clearInterval(timeinterval);
return null;
}
- if (t.total<=300000){
+ if(t.total<=0 && is_exercise=="True"){
+ clearInterval(timeinterval);
+ }
+ if (t.total<=300000 && t.total > 0){
clock.innerHTML = "<blink><center><span style='color:red'><strong>" + hh + ":" + mm + ":" + ss + "</strong></center></span></blink>";
}
if (t.total>=300000) {
@@ -68,6 +81,7 @@ function updateClock(){
var clock = document.getElementById("time_left");
updateClock();
var timeinterval = setInterval(updateClock,1000);
+
}
function validate(){
@@ -85,13 +99,7 @@ function call_skip(url)
form.action = url
form.submit();
}
-init_val = '{{ last_attempt|escape_quotes|safe }}';
-lang = "{{ question.language }}"
-course_id = "{{course.id}}"
-module_id = "{{module.id}}"
-
</script>
-
{% endblock script %}
{% block onload %} onload="updateTime();" {% endblock %}
@@ -253,16 +261,23 @@ module_id = "{{module.id}}"
<br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return validate();">Upload</button>&nbsp;&nbsp;
{% else %}
- {% if question in paper.get_questions_unanswered %}
+ {% if question in paper.get_questions_unanswered or quiz.is_exercise %}
<button class="btn btn-primary" type="submit" name="check" id="check" >Check Answer <span class="glyphicon glyphicon-cog"></span></button>&nbsp;&nbsp;
{% endif %}
{% endif %}
+ {% if quiz.is_exercise %}
+ {% if can_skip %}
+ <button id="skip_ex" class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip"> Next <span class="glyphicon glyphicon-arrow-right"></span></button>
+ {% else %}
+ <button id="skip_ex" class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip" style="visibility:hidden"> Next <span class="glyphicon glyphicon-arrow-right"></span></button>
+ {% endif %}
+ {% endif %}
{% if paper.question_paper.quiz.allow_skip and not paper.get_questions_unanswered|length_is:"1" %}
{% if question in paper.get_questions_unanswered %}
<button class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip" id="skip">Attempt Later <span class="glyphicon glyphicon-arrow-right"></span></button>
{% endif %}
- {% endif %}
+ {% endif %}
</div>
</form>
</div>