diff options
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/add_question.js | 4 | ||||
-rw-r--r-- | yaksh/static/yaksh/js/requesthandler.js | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 5bec8c6..346991a 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -110,6 +110,9 @@ function textareaformat() document.getElementById('my').innerHTML = document.getElementById('id_description').value ; }); + $('#id_solution').bind('keypress', function (event){ + document.getElementById('rend_solution').innerHTML = document.getElementById('id_solution').value ; + }); $('#id_type').bind('focus', function(event){ var type = document.getElementById('id_type'); @@ -121,6 +124,7 @@ function textareaformat() language.style.border = '1px solid #ccc'; }); document.getElementById('my').innerHTML = document.getElementById('id_description').value ; + document.getElementById('rend_solution').innerHTML = document.getElementById('id_solution').value ; if (document.getElementById('id_grade_assignment_upload').checked || document.getElementById('id_type').value == 'upload'){ diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js index f50570b..a24c1f1 100644 --- a/yaksh/static/yaksh/js/requesthandler.js +++ b/yaksh/static/yaksh/js/requesthandler.js @@ -36,7 +36,8 @@ function unlock_screen() { document.getElementById("ontop").style.display = "none"; } -function show_skip() { +function show_solution() { + document.getElementById("solution").style.display = "block"; document.getElementById("skip_ex").style.visibility = "visible"; } @@ -109,7 +110,7 @@ var global_editor = {}; $(document).ready(function(){ if(is_exercise == "True" && can_skip == "False"){ - setTimeout(function() {show_skip();}, delay_time*1000); + setTimeout(function() {show_solution();}, delay_time*1000); } // Codemirror object, language modes and initial content // Get the textarea node |