From 28ba37e907553aeac3841e221853683b9171f0db Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 18 Mar 2015 12:16:20 +0530 Subject: Changes to Question model, Views, Add-Question UI - ref_code_path is now part of Question model - MCQ/MCC answers checked using solution field in question model - Formset should reload even after errors - add_question page chould display solution field only in MCQ/MCC --- testapp/exam/static/exam/js/add_question.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'testapp/exam/static') diff --git a/testapp/exam/static/exam/js/add_question.js b/testapp/exam/static/exam/js/add_question.js index 267cdb2..5a94f4c 100644 --- a/testapp/exam/static/exam/js/add_question.js +++ b/testapp/exam/static/exam/js/add_question.js @@ -153,13 +153,17 @@ function textareaformat() if(value == 'mcq' || value == 'mcc') { document.getElementById('id_options').style.visibility='visible'; - document.getElementById('label_option').innerHTML="Options :" + document.getElementById('label_option').innerHTML="Options :"; + document.getElementById('id_solution').style.visibility='visible'; + document.getElementById('label_solution').innerHTML="Solutions :"; } else { document.getElementById('id_options').style.visibility='hidden'; document.getElementById('label_option').innerHTML = ""; + document.getElementById('id_solution').style.visibility='hidden'; + document.getElementById('label_solution').innerHTML="" } }); document.getElementById('my').innerHTML = document.getElementById('id_description').value ; @@ -168,12 +172,16 @@ function textareaformat() { document.getElementById('id_options').style.visibility='visible'; document.getElementById('label_option').innerHTML="Options :" + document.getElementById('id_solution').style.visibility='visible'; + document.getElementById('label_solution').innerHTML="Solutions :"; } else { document.getElementById('id_options').style.visibility='hidden'; document.getElementById('label_option').innerHTML = ""; + document.getElementById('id_solution').style.visibility='hidden'; + document.getElementById('label_solution').innerHTML="" } } @@ -189,8 +197,9 @@ function autosubmit() if(type.value == 'select') { type.style.border = 'solid red'; - return false; - } + return false; + } + if (type.value == 'mcq' || type.value == 'mcc') { -- cgit