summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorprathamesh2020-11-13 15:34:22 +0530
committerprathamesh2020-11-13 15:34:22 +0530
commitb0ab5d93393d191ffbc6e0c4b0cc3ebc2624fc27 (patch)
treecd2d5ee1b055dbeb3ad6b7b1b021d460db3dc20e /yaksh/templates
parent1ad9f3176c2df25df1f8fae601eef657e39f8b46 (diff)
downloadonline_test-b0ab5d93393d191ffbc6e0c4b0cc3ebc2624fc27.tar.gz
online_test-b0ab5d93393d191ffbc6e0c4b0cc3ebc2624fc27.tar.bz2
online_test-b0ab5d93393d191ffbc6e0c4b0cc3ebc2624fc27.zip
Use QRcode to upload a file from any device
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/question.html9
-rw-r--r--yaksh/templates/yaksh/upload_file.html32
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>