summaryrefslogtreecommitdiff
path: root/testapp/exam/templates
diff options
context:
space:
mode:
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 %}