|
|
|
@ -80,9 +80,18 @@ function regex_course_class_period()
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if (regex.test(class_period)) {
|
|
|
|
|
$("#course_class_period_notice").html("");
|
|
|
|
|
$("#course_class_period_notice").hide();
|
|
|
|
|
return true;
|
|
|
|
|
if(parseInt(class_period) > 0)
|
|
|
|
|
{
|
|
|
|
|
$("#course_class_period_notice").html("");
|
|
|
|
|
$("#course_class_period_notice").hide();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#course_class_period_notice").html("学时总数必须大于0");
|
|
|
|
|
$("#course_class_period_notice").show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -91,10 +100,33 @@ function regex_course_class_period()
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//验证密码
|
|
|
|
|
function regex_course_password()
|
|
|
|
|
{
|
|
|
|
|
var class_period = $.trim($("#course_course_password").val());
|
|
|
|
|
var regex = /^\w+$/;
|
|
|
|
|
if(class_period.length == 0)
|
|
|
|
|
{
|
|
|
|
|
$("#course_course_password_notice").html("课程密码不能为空");
|
|
|
|
|
$("#course_course_password_notice").show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if (regex.test(class_period)) {
|
|
|
|
|
$("#course_course_password_notice").html("");
|
|
|
|
|
$("#course_course_password_notice").hide();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#course_course_password_notice").html("课程密码有非法字符");
|
|
|
|
|
$("#course_course_password_notice").show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//提交新建课程
|
|
|
|
|
function submit_new_course()
|
|
|
|
|
{
|
|
|
|
|
if(regex_course_name()&®ex_course_class_period())
|
|
|
|
|
if(regex_course_name()&®ex_course_class_period()&®ex_course_password())
|
|
|
|
|
{
|
|
|
|
|
$("#new_course").submit();
|
|
|
|
|
}
|
|
|
|
@ -102,7 +134,7 @@ function submit_new_course()
|
|
|
|
|
|
|
|
|
|
function submit_edit_course(id)
|
|
|
|
|
{
|
|
|
|
|
if(regex_course_name()&®ex_course_class_period())
|
|
|
|
|
if(regex_course_name()&®ex_course_class_period()&®ex_course_password())
|
|
|
|
|
{
|
|
|
|
|
$("#edit_course_"+id).submit();
|
|
|
|
|
}
|
|
|
|
|