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.html17
-rw-r--r--testapp/exam/templates/exam/quit.html4
3 files changed, 13 insertions, 10 deletions
diff --git a/testapp/exam/templates/exam/intro.html b/testapp/exam/templates/exam/intro.html
index ec1888a..58068ed 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/{{ paper_id }}/" method="post" align="center">
+ <form action="{{URL_ROOT}}/exam/start/{{ attempt_no }}/{{ 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 a3e8629..03284ce 100644
--- a/testapp/exam/templates/exam/question.html
+++ b/testapp/exam/templates/exam/question.html
@@ -74,7 +74,7 @@ function setSnippetHeight()
<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.question_paper.id }}/" method="post" class="pull-right">
+ <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>
@@ -94,19 +94,20 @@ function setSnippetHeight()
{% endfor%}
</div>{% endif %}
- {% if success_msg %}
- <script type="text/javascript">
- alert("Congratulations, that's correct. Let's go to next question");
- </script>
- {% endif %}
<p id="status"></p>
- <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.question_paper.id }}/" method="post">
+
+ <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 %}
{% 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 == "basgn" %}
+ <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 }}
@@ -128,6 +129,8 @@ function setSnippetHeight()
{% 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;
{% else %}
<button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button>&nbsp;&nbsp;
{% endif %}
diff --git a/testapp/exam/templates/exam/quit.html b/testapp/exam/templates/exam/quit.html
index fee11ed..2c347cb 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/{{ id }}/" method="post">
+ <form action="{{URL_ROOT}}/exam/complete/{{ attempt_no }}/{{ 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/{{ 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_no }}/{{ id }}/'">No!</button></center>
</form>
{% endblock content %}