12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- $(function () {
- $("#StudentNum").attr("disabled", true);
- $("#GroupNum").attr("disabled", true);
- $("#IsStudentNo").click(function () {
- $("#IsRandom").attr("checked", false);
- $("#IsManual").attr("checked", false);
- $("#GroupByGroup").attr("disabled", false);
- $("#GroupByStudent").attr("disabled", false);
- });
- $("#IsRandom").click(function () {
- $("#IsStudentNo").attr("checked", false);
- $("#IsManual").attr("checked", false);
- $("#GroupByGroup").attr("disabled", false);
- $("#GroupByStudent").attr("disabled", false);
- });
- $("#IsManual").click(function () {
- $("#IsStudentNo").attr("checked", false);
- $("#IsRandom").attr("checked", false);
- $("#GroupByStudent").attr("checked", false);
- $("#GroupNum").attr("disabled", false);
- $("#GroupByGroup").attr("checked", true);
- $("#StudentNum").attr("disabled", true);
- $("#GroupByStudent").attr("disabled", true);
- });
- // $("#StudentNum").blur(function () {
- // AverageNum(true);
- // });
- // $("#GroupNum").blur(function () {
- // AverageNum(false);
- // });
- $("#GroupByStudent").click(function () {
- $("#GroupByGroup").attr("checked", false);
- $("#GroupNum").attr("disabled", true);
- $("#StudentNum").attr("disabled", false);
- });
- $("#GroupByGroup").click(function () {
- $("#GroupByStudent").attr("checked", false);
- $("#GroupNum").attr("disabled", false);
- $("#StudentNum").attr("disabled", true);
- });
- $("#StudentNum").blur(function () {
- StudentNumChange();
- });
- $("#GroupNum").blur(function () {
- GroupNumChange();
- });
- })
- function StudentNumChange() {
- var totalNum = $("#StudentTotalNum").val() == "NaN" ? "0" : $("#StudentTotalNum").val();
- var studentNum = $("#StudentNum").val() == "NaN" ? "0" : $("#StudentNum").val();
- reg = /^[1-9]\d*$/;
- var num = 0;
- if (reg.test(studentNum)) {
- if (totalNum != 0) {
- num = Math.round(parseInt(totalNum) / parseInt(studentNum));
- }
- $("#GroupNum").val(num);
- }
-
- }
- function GroupNumChange() {
- var totalNum = $("#StudentTotalNum").val() == "NaN" ? "0" : $("#StudentTotalNum").val();
- var groupNum = $("#GroupNum").val() == "NaN" ? "0" : $("#GroupNum").val();
- reg = /^[1-9]\d*$/;
- var num = 0;
- if (reg.test(groupNum)) {
- if (totalNum != 0) {
- num = Math.round(parseInt(totalNum) / parseInt(groupNum));
- }
- $("#StudentNum").val(num);
- }
- }
- function SOCDetailGroupAdd_Confirm() {
- $(document.forms[0]).submit();
- }
|