diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/user.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index 1707305..0d1f980 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -16,7 +16,7 @@ <div class= "collapse navbar-collapse" id="navbar"> <ul class="nav navbar-nav navbar-right"> <li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li> - <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/logout/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li> + <li><a style='cursor:pointer' id='logout' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li> </ul> </div><!-- /.navbar --> </div><!-- /.container --> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 6218b18..1f6e67d 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -89,7 +89,10 @@ function call_skip(url) } </script> <script> - $(document).ready(function(){ + + var init_val = '{{ last_attempt|escape_quotes|safe }}'; + var global_editor = {}; + $(document).ready(function(){ // Codemirror object, language modes and initial content // Get the textarea node var textarea_node = document.querySelector('#answer'); @@ -115,17 +118,15 @@ function call_skip(url) }; // Initialize the codemirror editor - var editor = CodeMirror.fromTextArea(textarea_node, options); + global_editor.editor = CodeMirror.fromTextArea(textarea_node, options); // Setting code editors initial content - editor.setValue('{{ last_attempt|escape_quotes|safe }}') + global_editor.editor.setValue(init_val); function reset_editor() { - editor.setValue('{{ last_attempt|escape_quotes|safe }}'); - editor.clearHistory(); + global_editor.editor.setValue(init_val); + global_editor.editor.clearHistory(); } - - }); </script> |