summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorprathamesh2020-10-23 03:55:43 +0530
committerprathamesh2020-10-23 03:55:43 +0530
commit054cb7a7d898cab8902dd6c97db4072b01bd2af9 (patch)
tree90e253235fe8a9b551f54553a74b689c2ca0ee38 /yaksh/templates
parent430c8d1480d897e9fc0dc328bad173642d0a2946 (diff)
downloadonline_test-054cb7a7d898cab8902dd6c97db4072b01bd2af9.tar.gz
online_test-054cb7a7d898cab8902dd6c97db4072b01bd2af9.tar.bz2
online_test-054cb7a7d898cab8902dd6c97db4072b01bd2af9.zip
Update marks using CSV file upload
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/monitor.html54
1 files changed, 47 insertions, 7 deletions
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html
index 0a8e3e9..2b43ec1 100644
--- a/yaksh/templates/yaksh/monitor.html
+++ b/yaksh/templates/yaksh/monitor.html
@@ -4,7 +4,7 @@
{% block title %} Monitor {% endblock %}
{% block pagetitle %} Monitor {% endblock pagetitle %}
-{% block meta %} <meta http-equiv="refresh" content="30"/> {% endblock meta %}
+{% block meta %} <meta http-equiv="refresh" content="300"/> {% endblock meta %}
{% block script %}
{% if papers %}
@@ -88,21 +88,57 @@ $(document).ready(function()
<br>
<div class="row">
<div class="col-md-4">
- <a href="{% url 'yaksh:show_statistics' papers.0.question_paper.id course.id %}" class="btn btn-primary">
- <i class="fa fa-line-chart"></i>&nbsp;Question Statistics
- </a>
- </div>
- <div class="col-md-4">
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#csvModal">
<i class="fa fa-download"></i>&nbsp;Download CSV
</button>
</div>
<div class="col-md-4">
+ <a href="{% url 'yaksh:show_statistics' papers.0.question_paper.id course.id %}" class="btn btn-primary">
+ <i class="fa fa-line-chart"></i>&nbsp;Question Statistics
+ </a>
+ </div>
+ <div class="col-md-4">
<div class="badge badge-info">
- Auto-Refreshes every 30 seconds
+ Auto-Refreshes every 5 minutes
</div>
</div>
</div>
+ <hr>
+ <div class="row">
+ <div class="col-md-6">
+ <p>
+ <b>
+ - Download the CSV file from the button above<br />
+ - Edit and upload the same <br />
+ </b>
+ </p>
+ </div>
+ <div class="col-md-6">
+ <form id="upload_users" action="{% url 'yaksh:upload_marks' course.id papers.0.question_paper.id %}" method="POST" enctype="multipart/form-data">
+ {% csrf_token %}
+ <div class="input-group mb-3">
+ <div class="custom-file">
+ <input type="file" class="custom-file-input" name="csv_file" id="upload"/>
+ <label class="custom-file-label" for="upload">Select</label>
+ </div>
+ <div class="input-group-append">
+ <button class="btn btn-outline-primary" type="submit">
+ <i class="fa fa-upload"></i>
+ Upload
+ </button>
+ </div>
+ </div>
+ <script>
+ $('#upload').on('change',function(){
+ //get the file name
+ var fileName = $(this).val();
+ //replace the "Choose a file" label
+ $(this).next('.custom-file-label').html(fileName);
+ })
+ </script>
+ </form>
+ </div>
+ </div>
<br>
<table id="result-table" class="tablesorter table table-striped table-responsive-sm">
<thead>
@@ -172,7 +208,11 @@ $(document).ready(function()
{% for field in csv_fields %}
<div class="form-check form-check-inline">
<label class="form-check-label">
+ {% if field == 'username' or field == 'questions' %}
+ <input class="form-check-input" name="csv_fields" type="checkbox" value="{{ field }}" checked onclick="return false"> {{ field }}
+ {% else %}
<input class="form-check-input" name="csv_fields" type="checkbox" value="{{ field }}" checked> {{ field }}
+ {% endif %}
</label>
</div>
<br>