diff options
author | adityacp | 2020-01-30 15:51:35 +0530 |
---|---|---|
committer | adityacp | 2020-01-30 15:51:35 +0530 |
commit | 8d9b3a10e8980284bf70298e44018766ec05de79 (patch) | |
tree | 448b3d134890c6035c4644ab4c3dbc86df5a8874 | |
parent | 723e9e71b1a108e580e38ee73cae90980c33b261 (diff) | |
download | online_test-8d9b3a10e8980284bf70298e44018766ec05de79.tar.gz online_test-8d9b3a10e8980284bf70298e44018766ec05de79.tar.bz2 online_test-8d9b3a10e8980284bf70298e44018766ec05de79.zip |
Change in js, templates
- Replace manual django url pattern in course progress and course js
- Add overflow horizontal scroll in quiz side bar
- Use bootstrap input text style in quiz
-rw-r--r-- | yaksh/static/yaksh/js/course.js | 7 | ||||
-rw-r--r-- | yaksh/templates/base.html | 2 | ||||
-rw-r--r-- | yaksh/templates/exam.html | 12 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_progress.html | 1 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 13 |
5 files changed, 18 insertions, 17 deletions
diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js index 7b3c5d9..a4b5579 100644 --- a/yaksh/static/yaksh/js/course.js +++ b/yaksh/static/yaksh/js/course.js @@ -90,8 +90,7 @@ $(document).ready(function(){ student_id = data.split("+")[1];
var status_div = $("#show_status_"+course_id+"_"+student_id);
if(!status_div.is(":visible")){
- var get_url = window.location.protocol + "//" + window.location.host +
- "/exam/manage/get_user_status/" + course_id + "/" + student_id;
+ var get_url = $("#url-"+student_id).attr("data-url");
$.ajax({
url: get_url,
timeout: 8000,
@@ -99,8 +98,8 @@ $(document).ready(function(){ dataType: "json",
contentType: 'application/json; charset=utf-8',
success: function(data) {
- status_div.toggle();
- status_div.html(data.user_data);
+ status_div.toggle();
+ status_div.html(data.user_data);
},
error: function(jqXHR, textStatus) {
alert("Unable to get user data. Please Try again later.");
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index 0cfe8a3..c70c265 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -49,7 +49,7 @@ <div id="ontop"> <div id="state"> - Checking...<img src="{{ URL_ROOT }}/static/yaksh/images/check_answer.gif"/> + Checking...<img src="{% static 'yaksh/images/check_answer.gif' %}"/> </div></div> diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index 6480cce..d59674c 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -13,8 +13,8 @@ </button> <div class="collapse navbar-collapse" id="navbarColor01"> - <div class="row ml-auto my-lg-0"> - <div class="col-md-4"> + <div class="row ml-auto"> + <div class="col-md-6"> <span class="time-div nav-item" id="time_left"></span> </div> <div class="col-md-6"> @@ -26,7 +26,7 @@ {% else %} Finish {{ quiz_type }} {% endif %} - <span class="fa fa-power-off"></span></button></span> + <i class="fa fa-power-off"></i></button></span> </form> </div> </div> @@ -38,13 +38,13 @@ <div class="container-fluid"> <div class="row"> <!-- Side Component --> - <div class="col-md-3 bg-secondary"> + <div class="col-md-3 bg-secondary" style="overflow-x: scroll;"> <br> <center> <b>{{course.name}}</b><br> {{ paper.question_paper.quiz.description }}</h4> - <hr> </center> + <hr> <center><p>Question Navigator</p></center> <div class="justify-content-center"> {% for qid in paper.get_all_ordered_questions %} @@ -83,7 +83,7 @@ </div> <br> <div> - <table class="table-bordered table-responsive-sm"> + <table class="table table-bordered table-responsive-sm"> <thead> <tr> <th>Category</th> diff --git a/yaksh/templates/yaksh/course_progress.html b/yaksh/templates/yaksh/course_progress.html index 800a975..a833c92 100644 --- a/yaksh/templates/yaksh/course_progress.html +++ b/yaksh/templates/yaksh/course_progress.html @@ -28,6 +28,7 @@ {{ student.profile.roll_number}} </td> <td width="50%"> + <input type="hidden" id="url-{{student.id}}" data-url="{% url 'yaksh:get_user_data' course.id student.id %}"> <a class="user_data" data-item-id="{{course.id}}+{{student.id}}" data-toggle="tooltip" title="Click to view Overall Course progress" data-placement="top"> {{ student.get_full_name|title}} <i class="fa fa-caret-down"></i> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 3ad82ca..9119c70 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -234,21 +234,21 @@ question_type = "{{ question.type }}" <!-- Integer type question --> {% if question.type == "integer" %} Enter Integer:<br/> - <input autofocus name="answer" type="number" id="integer" value="{{ last_attempt|safe }}" /> + <input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|safe }}" /> <br><br> {% endif %} <!-- String type question --> {% if question.type == "string" %} Enter Text:<br/> - <textarea autofocus name="answer" id="string">{{ last_attempt|safe }}</textarea> + <textarea autofocus name="answer" id="string" class="form-control" style="width: 100%">{{ last_attempt|safe }}</textarea> <br/><br/> {% endif %} <!-- Float type question --> {% if question.type == "float" %} Enter Decimal Value :<br/> - <input autofocus name="answer" type="number" step="any" id="float" value="{{ last_attempt|safe }}" /> + <input autofocus class="form-control" name="answer" type="number" step="any" id="float" value="{{ last_attempt|safe }}" /> <br/><br/> {% endif %} @@ -320,15 +320,16 @@ question_type = "{{ question.type }}" {% else %} {% if question in paper.get_questions_unanswered or quiz.is_exercise %} <button class="btn btn-success" type="submit" name="check" id="check" > - Check Answer <span class="glyphicon glyphicon-cog"></span> + Check Answer </button> {% endif %} {% endif %} {% if quiz.is_exercise %} {% if can_skip %} - <button id="skip_ex" class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip"> Next <span class="glyphicon glyphicon-arrow-right"></span></button> + <button id="skip_ex" class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip"> Next <span class="fa fa-step-forward"></span></button> {% else %} - <button id="skip_ex" class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip" style="visibility:hidden"> Next <span class="fa fa-step-forward"></span></button> + <button id="skip_ex" class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip" style="visibility:hidden"> Next <span class="fa fa-step-forward"></span> + </button> {% endif %} {% endif %} |