diff options
author | Prabhu Ramachandran | 2014-06-23 10:34:59 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2014-06-23 10:34:59 +0530 |
commit | fa402a2c9a34a1728f863ddcbab62fa8e030099e (patch) | |
tree | 7e29521a61b1717bb011275c8e38a9ab5d23ac22 /testapp/static/exam/js/add_question.js | |
parent | e50eb8426d5f22fd35a2575cd3f4617226bc1a01 (diff) | |
parent | c525c8f26b8e926733d5e4e3d415e19250e54e72 (diff) | |
download | online_test-fa402a2c9a34a1728f863ddcbab62fa8e030099e.tar.gz online_test-fa402a2c9a34a1728f863ddcbab62fa8e030099e.tar.bz2 online_test-fa402a2c9a34a1728f863ddcbab62fa8e030099e.zip |
Merge pull request #25 from prathamesh920/question_paper_generator
Question paper generator
Diffstat (limited to 'testapp/static/exam/js/add_question.js')
-rw-r--r-- | testapp/static/exam/js/add_question.js | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/testapp/static/exam/js/add_question.js b/testapp/static/exam/js/add_question.js index ba17492..56fdd1f 100644 --- a/testapp/static/exam/js/add_question.js +++ b/testapp/static/exam/js/add_question.js @@ -135,7 +135,19 @@ function textareaformat() $('#id_snippet').bind('blur', function( event ){ document.getElementById("id_snippet").rows=1; document.getElementById("id_snippet").cols=40; - }); + }); + + + $('#id_type').bind('focus', function(event){ + var type = document.getElementById('id_type'); + type.style.border = '1px solid #ccc'; + }); + + $('#id_language').bind('focus', function(event){ + var language = document.getElementById('id_language'); + language.style.border = '1px solid #ccc'; + }); + $('#id_type').bind('change',function(event){ var value = document.getElementById('id_type').value; if(value == 'mcq') @@ -167,7 +179,20 @@ function textareaformat() function autosubmit() { - if (document.getElementById('id_type').value == 'mcq') + var language = document.getElementById('id_language'); + if(language.value == 'select') + { + language.style.border="solid red"; + return false; + } + var type = document.getElementById('id_type'); + if(type.value == 'select') + { + type.style.border = 'solid red'; + return false; + } + + if (type.value == 'mcq') { var value = document.getElementById('id_options').value; if(value.split('\n').length < 4) |