summaryrefslogtreecommitdiff
path: root/testapp/exam/templates
diff options
context:
space:
mode:
authorprathamesh2015-01-20 17:05:41 +0530
committerprathamesh2015-01-20 17:05:41 +0530
commitf2e09edeb2e5b884f0e75ad3747b51e7603d70e1 (patch)
treefac9c70feeff6e1c470097623fd54a6244f786c0 /testapp/exam/templates
parentcbdeb90a756832c71c80bac4dbe9ba1a3aceacb2 (diff)
downloadonline_test-f2e09edeb2e5b884f0e75ad3747b51e7603d70e1.tar.gz
online_test-f2e09edeb2e5b884f0e75ad3747b51e7603d70e1.tar.bz2
online_test-f2e09edeb2e5b884f0e75ad3747b51e7603d70e1.zip
Assignment upload interface implementation
Diffstat (limited to 'testapp/exam/templates')
-rw-r--r--testapp/exam/templates/exam/question.html19
1 files changed, 8 insertions, 11 deletions
diff --git a/testapp/exam/templates/exam/question.html b/testapp/exam/templates/exam/question.html
index f8888b1..03284ce 100644
--- a/testapp/exam/templates/exam/question.html
+++ b/testapp/exam/templates/exam/question.html
@@ -96,23 +96,18 @@ function setSnippetHeight()
<p id="status"></p>
- {% if question.type == "bash assignment" %}
- <form action="{{URL_ROOT}}/exam/submit-assignment/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post">
- <p>Upload assignment file for the said question<p>
- <input type=file id=assignment name=assignment>
- <hr>
- <br><button class="btn" type="submit" name="submitassign" id="submitassign">Upload</button>&nbsp;&nbsp;
- <button class="btn" type="submit" name="skip" id="skip">Skip</button>
- </form>
- {% endif %}
-
- <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ 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 }}
@@ -134,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 %}