Index: lams_tool_lamc/web/monitoring/editQuestionBox.jsp =================================================================== diff -u -r9dc619c585fbef88eb9340bd68dd8137298b3129 -r2bd6155d7fad435e1238088f98650b0ec731d0f1 --- lams_tool_lamc/web/monitoring/editQuestionBox.jsp (.../editQuestionBox.jsp) (revision 9dc619c585fbef88eb9340bd68dd8137298b3129) +++ lams_tool_lamc/web/monitoring/editQuestionBox.jsp (.../editQuestionBox.jsp) (revision 2bd6155d7fad435e1238088f98650b0ec731d0f1) @@ -80,7 +80,86 @@ } return true; } + + function validateSingleCorrectAnswer() + { + var singleCorrectEntry = 0; + var radioCorrect=document.McMonitoringForm.correct; + + if ((radioCorrect == 'null') || (radioCorrect == 'undefined')) + { + var msg = ""; + alert(msg); + return false; + } + + var radioGroupSize=radioCorrect.length; + + 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) + { + singleCorrectEntry =1; + } + } + } + } + + if (singleCorrectEntry == 0) + { + var msg = ""; + var msgSetFirst = ""; + alert(msg); + + if ((radioCorrect[0] != 'undefined') && (radioCorrect[0] != null)) + { + radioCorrect[0].checked=true; + alert(msgSetFirst); + } + + return false; + } + return true; + } + + + function validateMinumumCandidateCount() + { + var radioCorrect=document.McMonitoringForm.correct; + + if ((radioCorrect == 'undefined') || (radioCorrect == null)) + { + var msg = ""; + alert(msg); + return false; + } + + + var radioGroupSize=radioCorrect.length; + + if ((radioGroupSize == 'undefined') || (radioGroupSize <= 2)) + { + var msg = ""; + alert(msg); + return false; + } + + return true; + } + @@ -173,7 +252,7 @@
                     -