summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-01-08 19:13:49 +0530
committerGitHub2018-01-08 19:13:49 +0530
commitd1cc992eb7dc1a23b866ed89baf602579637244a (patch)
treefb576bab292844f34d4fc5b5389a9a68d2056e52
parentf457585ea62ec76240edb9397c7f08a46f25947c (diff)
parentf0fafed7ba0002369f528a901d9e5590f5bd3bea (diff)
downloadonline_test-d1cc992eb7dc1a23b866ed89baf602579637244a.tar.gz
online_test-d1cc992eb7dc1a23b866ed89baf602579637244a.tar.bz2
online_test-d1cc992eb7dc1a23b866ed89baf602579637244a.zip
Merge pull request #415 from maheshgudi/yaksh_ui_changes
See previous questions in exercise and other bug fixes
-rw-r--r--yaksh/models.py2
-rw-r--r--yaksh/static/yaksh/js/requesthandler.js6
-rw-r--r--yaksh/templates/exam.html4
-rw-r--r--yaksh/templates/yaksh/question.html38
4 files changed, 27 insertions, 23 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 2f616cf..6622067 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -330,7 +330,7 @@ class Quiz(models.Model):
duration=30, active=True,
attempts_allowed=-1, time_between_attempts=0,
description='Yaksh Demo quiz', pass_criteria=0,
- creator=user
+ creator=user, instructions="<b>This is a demo quiz.</b>"
)
return demo_quiz
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js
index f98ab12..ec2391a 100644
--- a/yaksh/static/yaksh/js/requesthandler.js
+++ b/yaksh/static/yaksh/js/requesthandler.js
@@ -37,7 +37,9 @@ function unlock_screen() {
}
function show_solution() {
- document.getElementById("solution").style.display = "block";
+ var solution = document.getElementById("solution");
+ solution.style.display = "block";
+ solution.className ="well well-sm";
document.getElementById("skip_ex").style.visibility = "visible";
}
@@ -164,7 +166,7 @@ if (question_type == 'upload' || question_type == 'code') {
var data = $(this).serializeArray();
}
else if (question_type == "upload"){
- var data = new FormData(getElementById("code"));
+ var data = new FormData(document.getElementById("code"));
}
ajax_check_code($(this).attr("action"), "POST", "html", data, null)
e.preventDefault(); // To stop the default form submission.
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index ce1d3b8..012adbe 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -60,6 +60,10 @@
{% else %}
{% if qid.id == question.id %}
<li class="active"><a style="width:25%" data-toggle="tooltip" title="{{ qid.description|striptags }}">{{ forloop.counter }}</a></li>
+ {% elif qid in paper.get_questions_answered %}
+ <li><a style="background-color:#B4B8BA; width:25%" href="#" data-toggle="tooltip"
+ onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')"
+ title="{{ qid.description }}">{{ forloop.counter }}</a></li>
{% else %}
<li class="disabled"><a style="width:25%" data-toggle="tooltip" title="{{ qid.description|striptags }}">{{ forloop.counter }}</a></li>
{% endif %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index b7251ad..c7e6efb 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -144,21 +144,6 @@ question_type = "{{ question.type }}"
{% endblock %}
{% block main %}
- <p id="status"></p>
- {% if notification %}
- {% if question.type == "code" %}
- <div id="notification" class="alert alert-success" role="alert">
- <strong>Note:</strong> {{ notification }}
- </div>
- {% else %}
- <div id="notification" class="alert alert-warning" role="alert">
- <strong>Note:</strong> {{ notification }}
- </div>
- {% endif %}
- {% else %}
- <div id="notification" role="alert">
- </div>
- {% endif %}
<form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/" method="post" enctype="multipart/form-data">
{% csrf_token %}
<input type=hidden name="question_id" id="question_id" value={{ question.id }}></input>
@@ -197,22 +182,20 @@ question_type = "{{ question.type }}"
<h5><a href="{{f_name.file.url}}">{{f_name.file.name}}</a></h5>
{% endfor %}
{% endif %}
-
+ </div>
+ <br/>
{% if quiz.is_exercise %}
{% if can_skip %}
- <div id="solution">
+ <div class = "well well-sm" id="solution">
{% else %}
<div id="solution" style="display:none">
{% endif %}
{% if question.solution %}
<h4><u> Solution by teacher</u></h4>
- {% else %}
- <h4><u> No solution provided by teacher </u></h4>
{% endif%}
<font size=3 face=arial> {{ question.solution|safe }} </font>
</div>
{% endif %}
- </div>
<div class="panel-body">
{% if question.type == "mcq" %}
{% for test_case in test_cases %}
@@ -304,6 +287,21 @@ question_type = "{{ question.type }}"
</div>
</div>
<br/>
+ <p id="status"></p>
+ {% if notification %}
+ {% if question.type == "code" %}
+ <div id="notification" class="alert alert-success" role="alert">
+ <strong>Note:</strong> {{ notification }}
+ </div>
+ {% else %}
+ <div id="notification" class="alert alert-warning" role="alert">
+ <strong>Note:</strong> {{ notification }}
+ </div>
+ {% endif %}
+ {% else %}
+ <div id="notification" role="alert">
+ </div>
+ {% endif %}
{% if question.type == 'code' or question.type == 'upload' %}
<div class="row" id="error_panel"></div>
{% endif %}