summaryrefslogtreecommitdiff
path: root/testapp/exam/templates
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/exam/templates')
-rw-r--r--testapp/exam/templates/exam/intro.html2
-rw-r--r--testapp/exam/templates/exam/question.html42
-rw-r--r--testapp/exam/templates/exam/quit.html4
3 files changed, 41 insertions, 7 deletions
diff --git a/testapp/exam/templates/exam/intro.html b/testapp/exam/templates/exam/intro.html
index 58068ed..592937a 100644
--- a/testapp/exam/templates/exam/intro.html
+++ b/testapp/exam/templates/exam/intro.html
@@ -27,7 +27,7 @@
</ul>
<p> We hope you enjoy taking this exam !!!</p>
- <form action="{{URL_ROOT}}/exam/start/{{ attempt_no }}/{{ paper_id }}/" method="post" align="center">
+ <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>
diff --git a/testapp/exam/templates/exam/question.html b/testapp/exam/templates/exam/question.html
index 5d03b37..eac6792 100644
--- a/testapp/exam/templates/exam/question.html
+++ b/testapp/exam/templates/exam/question.html
@@ -10,7 +10,10 @@
{% endblock %}
{% block script %}
+<script src="/static/taggit_autocomplete_modified/jquery.min.js" type="text/javascript"></script>
+<script src="/static/taggit_autocomplete_modified/jquery.autocomplete.js" type="text/javascript"></script>
<script src="{{ URL_ROOT }}/static/exam/js/question.js"></script>
+<script src="{{ URL_ROOT }}/static/exam/js/bootstrap-modal.js"></script>
<script>
var time_left = {{ time_left }}
@@ -48,12 +51,26 @@ function setSnippetHeight()
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 %}
@@ -121,7 +138,7 @@ function call_skip(url)
</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>
@@ -131,7 +148,7 @@ function call_skip(url)
<input name="answer" type="radio" value="{{option}}" />{{option}} <br/>
{% endfor %}
{% endif %}
- {% if question.type == "basgn" %}
+ {% if question.type == "upload" %}
<p>Upload assignment file for the said question<p>
<input type=file id="assignment" name="assignment">
<hr>
@@ -157,8 +174,8 @@ function call_skip(url)
{% 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 == "basgn" %}
- <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;
{% else %}
<button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button>&nbsp;&nbsp;
{% endif %}
@@ -166,4 +183,21 @@ function call_skip(url)
</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/testapp/exam/templates/exam/quit.html b/testapp/exam/templates/exam/quit.html
index 2c347cb..f49b62f 100644
--- a/testapp/exam/templates/exam/quit.html
+++ b/testapp/exam/templates/exam/quit.html
@@ -7,8 +7,8 @@
<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_no }}/{{ id }}/" method="post">
+ <form action="{{URL_ROOT}}/exam/complete/{{ attempt_num }}/{{ id }}/" method="post">
{% csrf_token %}
- <center><button class="btn" type="submit" name="yes">Yes!</button>&nbsp;<button class="btn" type="button" name="no" onClick="window.location='{{ URL_ROOT }}/exam/start/{{ attempt_no }}/{{ id }}/'">No!</button></center>
+ <center><button class="btn" type="submit" name="yes">Yes!</button>&nbsp;<button class="btn" type="button" name="no" onClick="window.location='{{ URL_ROOT }}/exam/start/{{ attempt_num }}/{{ id }}/'">No!</button></center>
</form>
{% endblock content %}