summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
authormahesh2018-01-19 13:13:25 +0530
committermaheshgudi2018-03-16 15:17:20 +0530
commit3b37015f3e9d94b831a5eec8771b833118e6443b (patch)
tree7721d023ad314c4b96a65f170a9ce5520961c9d6 /yaksh/static
parentc290bff7d72e158de4158bf0411226c77eab6b73 (diff)
downloadonline_test-3b37015f3e9d94b831a5eec8771b833118e6443b.tar.gz
online_test-3b37015f3e9d94b831a5eec8771b833118e6443b.tar.bz2
online_test-3b37015f3e9d94b831a5eec8771b833118e6443b.zip
Disable/enable shuffle testcase option based on question type
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/add_question.js20
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()