summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-02-16 18:24:28 +0530
committerGitHub2017-02-16 18:24:28 +0530
commit1e96102fd821e802b370be6e69addd2cfaeb2191 (patch)
tree96a027d225f3a0e096961495a77e41bf72f90e8f
parent3fc351255d48f769641195d0f7b8fb7454992185 (diff)
parent332f8f09f779e614e8e512fa8e9e7ec365b09c1f (diff)
downloadonline_test-1e96102fd821e802b370be6e69addd2cfaeb2191.tar.gz
online_test-1e96102fd821e802b370be6e69addd2cfaeb2191.tar.bz2
online_test-1e96102fd821e802b370be6e69addd2cfaeb2191.zip
Merge pull request #224 from ankitjavalkar/autoscroll
Add smooth scroll to show errors in code questions
-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">