summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2020-02-18 14:15:46 +0530
committeradityacp2020-02-18 14:15:46 +0530
commit4583cdbe0f19c9b133fd2614ec8077fc972182fb (patch)
treeff561aca4c98c954eb143c78ed8387a4b8f151af
parent2db246f7abb2b8781e60673edec9912166621f4c (diff)
downloadonline_test-4583cdbe0f19c9b133fd2614ec8077fc972182fb.tar.gz
online_test-4583cdbe0f19c9b133fd2614ec8077fc972182fb.tar.bz2
online_test-4583cdbe0f19c9b133fd2614ec8077fc972182fb.zip
Preview question description and solution
-rw-r--r--yaksh/static/yaksh/js/add_question.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js
index 310fed5..4d134cd 100644
--- a/yaksh/static/yaksh/js/add_question.js
+++ b/yaksh/static/yaksh/js/add_question.js
@@ -76,6 +76,10 @@ function textareaformat()
document.getElementById('id_tags').setAttribute('class','form-control');
$("[id*="+'test_case_args'+"]").attr('placeholder',
'Command Line arguments for bash only');
+ var desc_preview = "<p id='desc_preview' align='justify'></p>";
+ var sol_preview = "<p id='sol_preview' align='justify'></p>";
+ $(desc_preview).insertBefore("#id_description");
+ $(sol_preview).insertBefore("#id_solution");
$('#id_snippet').bind('keydown', function( event ){
if(navigator.userAgent.match("Gecko"))
@@ -105,11 +109,11 @@ function textareaformat()
});
$('#id_description').bind('keypress', function (event){
- document.getElementById('rendered_text').innerHTML = document.getElementById('id_description').value ;
+ document.getElementById('desc_preview').innerHTML = document.getElementById('id_description').value ;
});
$('#id_solution').bind('keypress', function (event){
- document.getElementById('rend_solution').innerHTML = document.getElementById('id_solution').value ;
+ document.getElementById('sol_preview').innerHTML = document.getElementById('id_solution').value ;
});
$('#id_type').bind('focus', function(event){
@@ -122,6 +126,10 @@ function textareaformat()
language.style.border = '1px solid #ccc';
});
+
+ document.getElementById('desc_preview').innerHTML = document.getElementById('id_description').value ;
+ document.getElementById('sol_preview').innerHTML = document.getElementById('id_solution').value ;
+
var question_type = document.getElementById('id_type').value
if (document.getElementById('id_grade_assignment_upload').checked ||
question_type == 'upload'){