diff options
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/add_question.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 346991a..579904b 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -126,8 +126,9 @@ function textareaformat() document.getElementById('my').innerHTML = document.getElementById('id_description').value ; document.getElementById('rend_solution').innerHTML = document.getElementById('id_solution').value ; + var question_type = document.getElementById('id_type').value if (document.getElementById('id_grade_assignment_upload').checked || - document.getElementById('id_type').value == 'upload'){ + question_type == 'upload'){ $("#id_grade_assignment_upload").prop("disabled", false); } else{ @@ -142,6 +143,23 @@ function textareaformat() $("#id_grade_assignment_upload").prop("disabled", true); } }); + + if (document.getElementById('id_shuffle_testcases').checked || + question_type == "mcc" || question_type == "mcq"){ + $("#id_shuffle_testcases").prop("disabled", false); + } + else{ + $("#id_shuffle_testcases").prop("disabled", true); + } + + $('#id_type').change(function() { + if ($(this).val() == "mcc" || $(this).val() == "mcq"){ + $("#id_shuffle_testcases").prop("disabled", false); + } + else{ + $("#id_shuffle_testcases").prop("disabled", true); + } + }); } function autosubmit() |