summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorankitjavalkar2017-02-13 17:20:29 +0530
committerankitjavalkar2017-02-16 18:06:05 +0530
commit332f8f09f779e614e8e512fa8e9e7ec365b09c1f (patch)
tree96a027d225f3a0e096961495a77e41bf72f90e8f /yaksh
parent3fc351255d48f769641195d0f7b8fb7454992185 (diff)
downloadonline_test-332f8f09f779e614e8e512fa8e9e7ec365b09c1f.tar.gz
online_test-332f8f09f779e614e8e512fa8e9e7ec365b09c1f.tar.bz2
online_test-332f8f09f779e614e8e512fa8e9e7ec365b09c1f.zip
Add auto scroll to show errors in code questions
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/exam.html11
1 files changed, 10 insertions, 1 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index dfcaf2d..b497cc0 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -26,6 +26,15 @@
</nav><!-- /.navbar -->
{% endblock %}
{% block content %}
+ <script>
+ $(document).ready(function() {
+ var ele = document.getElementById('error_panel')
+ if (ele) {
+ ele.scrollIntoView(true);
+ window.scrollBy(0, -15);
+ }
+ });
+ </script>
<div class="container-fluid">
<div class="col-sm-3 col-md-2 sidebar">
<p> Question Navigator </p>
@@ -64,7 +73,7 @@
</div>
{% if question.type == 'code' %}
{% if error_message %}
- <div class="row">
+ <div class="row" id="error_panel">
{% for error in error_message %}
{% if error == "Correct answer" %}
<div class="panel panel-success">