diff options
-rw-r--r-- | yaksh/static/yaksh/js/requesthandler.js | 10 | ||||
-rw-r--r-- | yaksh/templates/exam.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/error_template.html | 2 | ||||
-rw-r--r-- | yaksh/views.py | 4 |
4 files changed, 8 insertions, 10 deletions
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js index 5d72241..9421317 100644 --- a/yaksh/static/yaksh/js/requesthandler.js +++ b/yaksh/static/yaksh/js/requesthandler.js @@ -61,9 +61,14 @@ function response_handler(method_type, content_type, data, uid){ } else{ unlock_screen(); + // var notify = document.getElementById("notification"); + if ($("#notification")){ + $("#notification").toggle(); + } + var error_output = document.getElementById("error_panel"); error_output.innerHTML = res.error; - focus_on_error(); + focus_on_error(error_output); } } else { reset_values(); @@ -71,8 +76,7 @@ function response_handler(method_type, content_type, data, uid){ } } -function focus_on_error(){ - var ele = document.getElementById('error_panel') +function focus_on_error(ele){ if (ele) { ele.scrollIntoView(true); window.scrollBy(0, -15); diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index fede185..63c31d6 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -73,11 +73,11 @@ </div> </div> <br/> - </div> {% if question.type == 'code' or question.type == 'upload' %} <div class="row" id="error_panel"></div> {% endif %} </div> + </div> </div> </div> {% endblock %} diff --git a/yaksh/templates/yaksh/error_template.html b/yaksh/templates/yaksh/error_template.html index d42a259..61657ae 100644 --- a/yaksh/templates/yaksh/error_template.html +++ b/yaksh/templates/yaksh/error_template.html @@ -5,7 +5,6 @@ {% load custom_filters %} {% if error_message %} -<div class="col-md-12"> {% for error in error_message %} <div class="panel panel-danger"> @@ -89,5 +88,4 @@ </div> </div> {% endfor %} - </div> {% endif %}
\ No newline at end of file diff --git a/yaksh/views.py b/yaksh/views.py index 29f017e..9d0d9e8 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -653,10 +653,6 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None): @csrf_exempt def get_result(request, uid): result = {} - template_dir = os.path.dirname(os.path.realpath(__file__)) - template_path = os.path.join(*[template_dir, 'templates', - 'yaksh','error_messages.html' - ]) url = 'http://localhost:%s' % SERVER_POOL_PORT result_state = get_result_from_code_server(url, uid) result['status'] = result_state.get('status') |