diff options
author | ankitjavalkar | 2020-11-04 18:01:19 +0530 |
---|---|---|
committer | GitHub | 2020-11-04 18:01:19 +0530 |
commit | 46da73d199e227c3f7abfa8d720d073496211b5e (patch) | |
tree | 08b4c380986270c06e8ce8c1a14bf91c5239b536 /yaksh/templates | |
parent | 2371058b9cf8fd953e8e089ac51702475a102ff7 (diff) | |
parent | 054cb7a7d898cab8902dd6c97db4072b01bd2af9 (diff) | |
download | online_test-46da73d199e227c3f7abfa8d720d073496211b5e.tar.gz online_test-46da73d199e227c3f7abfa8d720d073496211b5e.tar.bz2 online_test-46da73d199e227c3f7abfa8d720d073496211b5e.zip |
Merge pull request #783 from prathamesh920/upload-marks-csv
Update marks using CSV file upload
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 54 |
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> 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> 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> 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> |