Index: lams_tool_lamc/web/authoring/editQuestionBox.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_lamc/web/authoring/editQuestionBox.jsp,v
diff -u -r1.16 -r1.17
--- lams_tool_lamc/web/authoring/editQuestionBox.jsp 24 Jul 2013 18:29:14 -0000 1.16
+++ lams_tool_lamc/web/authoring/editQuestionBox.jsp 26 Jul 2013 16:10:44 -0000 1.17
@@ -72,39 +72,32 @@
var singleCorrectEntry = 0;
var radioCorrect=document.McAuthoringForm.correct;
- if ((radioCorrect == 'null') || (radioCorrect == 'undefined'))
- {
+ if ((radioCorrect == 'null') || (radioCorrect == 'undefined')) {
var msg = "";
alert(msg);
return false;
}
var radioGroupSize=radioCorrect.length;
- if ((radioGroupSize == 'undefined') || (radioGroupSize < 2))
- {
+ if ((radioGroupSize == 'undefined') || (radioGroupSize < 2)) {
var msg = "";
alert(msg);
return false;
}
- for(i = 0; i < 51; i++)
- {
- if (radioCorrect[i] != null)
- {
- if ((typeof(radioCorrect[i]) != 'undefined') && (typeof(radioCorrect[i]) != null))
- {
- if (radioCorrect[i].checked)
- {
+ for(i = 0; i < 51; i++) {
+ if (radioCorrect[i] != null) {
+ if ((typeof(radioCorrect[i]) != 'undefined') && (typeof(radioCorrect[i]) != null)) {
+ if (radioCorrect[i].checked) {
singleCorrectEntry =1;
}
}
}
}
- if (singleCorrectEntry == 0)
- {
+ if (singleCorrectEntry == 0) {
var msg = "";
var msgSetFirst = "";
@@ -118,6 +111,15 @@
return false;
}
+
+ //verify selected radiobutton should not be blank
+ var selectedAnswerIndex = $('input[name=correct]:checked').val();
+ if (!$("textarea[name=ca" + selectedAnswerIndex + "]").val()) {
+ var msg = "";
+ alert(msg);
+ return false;
+ }
+
return true;
}