summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorankitjavalkar2017-03-01 17:43:38 +0530
committerankitjavalkar2017-03-01 17:43:38 +0530
commitee3b4a2a081557f510674df489ac7479e31f5e82 (patch)
treef5b315ce2f2c2e1bc121685840e145384be52e22 /yaksh/templates
parentb001bc98db69e1ef1926b0f2103bf5a291682f93 (diff)
downloadonline_test-ee3b4a2a081557f510674df489ac7479e31f5e82.tar.gz
online_test-ee3b4a2a081557f510674df489ac7479e31f5e82.tar.bz2
online_test-ee3b4a2a081557f510674df489ac7479e31f5e82.zip
Fix selenium tests:
- Fix addition of answer to codemirror using selenium - Add custom exception when selenium fails - Add id to logout button on student interface - Fix imports for Python3 support in load_test.py
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/user.html2
-rw-r--r--yaksh/templates/yaksh/question.html15
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>