diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/question.html | 9 | ||||
-rw-r--r-- | yaksh/templates/yaksh/upload_file.html | 32 |
2 files changed, 40 insertions, 1 deletions
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 2dbfeed..9189324 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -285,6 +285,14 @@ question_type = "{{ question.type }}"; {% endfor %} </ul> {% endif %} + {% if qrcode %} + <img src="{{ qrcode.image.url }}"> + {% else %} + <a class="active btn btn-outline-primary " href="#"data-toggle="tooltip" + title="Upload from any device using the QR Code" + onclick="call_skip('{% url 'yaksh:generate_qrcode' paper.id question.id module.id %}')">Generate QR Code</a> + {% endif %} + <p></p> {% endif %} <!-- Arrange type question --> @@ -365,7 +373,6 @@ question_type = "{{ question.type }}"; {% if question.type == 'code' or question.type == 'upload' %} <div id="error_panel"></div> {% endif %} - <!-- Modal --> <div class="modal" id="upload_alert" > <div class="modal-dialog"> diff --git a/yaksh/templates/yaksh/upload_file.html b/yaksh/templates/yaksh/upload_file.html new file mode 100644 index 0000000..04d8b09 --- /dev/null +++ b/yaksh/templates/yaksh/upload_file.html @@ -0,0 +1,32 @@ +<html> +<title> Upload File </title> + +<script> +function validate(){ + uploaded_file = document.getElementById("assignment").value; + if(uploaded_file == ""){ + $("#upload_alert").modal("show"); + return false; + } + return true; +} +</script> +<style> +div, input, button { + font-size: x-large; + text-align: center; +} +</style> +<div> +{% if success %} + <p> {{ msg }}</p> +{% else %} + <form id="code" action="{% url 'yaksh:upload_file' key %}" method="post" enctype="multipart/form-data"> + {% csrf_token %} + <h3>Upload assignment file for {{ question.summary }}</h3> + <input type=file id="assignment" name="assignment" multiple=""> + <button class="btn btn-success" type="submit" name="check" id="check" onClick="return validate();">Upload</button> + </form> +{% endif %} +</div> +</html> |