From 0890351ba31dfe3904ff0f064ce9316405473cd3 Mon Sep 17 00:00:00 2001 From: Hardik Ghaghada Date: Thu, 4 Apr 2013 15:13:38 +0530 Subject: Edited JavaScript to resolve a small malfunction --- testapp/static/exam/js/add_question.js | 4 ++-- testapp/static/exam/js/edit_question.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'testapp') diff --git a/testapp/static/exam/js/add_question.js b/testapp/static/exam/js/add_question.js index 1f08c79..24af127 100644 --- a/testapp/static/exam/js/add_question.js +++ b/testapp/static/exam/js/add_question.js @@ -98,9 +98,9 @@ function autosubmit() if (document.getElementById('id_type').value == 'mcq') { var value = document.getElementById('id_options').value; - if(value.split('\n').length != 4) + if(value.split('\n').length < 4) { - alert("Enter 4 options. One option per line."); + alert("Please Enter 4 options. One option per line."); return false; } return true; diff --git a/testapp/static/exam/js/edit_question.js b/testapp/static/exam/js/edit_question.js index 69e0d97..09cd842 100644 --- a/testapp/static/exam/js/edit_question.js +++ b/testapp/static/exam/js/edit_question.js @@ -156,9 +156,11 @@ function autosubmit() } else { + alert("hello") count_mcq = count_mcq + 1; var options = document.getElementById('id_options' + i).value; var total_words = options.split("\n").length ; + alert(total_words) if ( total_words < 4) empty_options = empty_options + 1 ; } -- cgit