|
|
|
@ -58,10 +58,10 @@ $(function(){
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$('#test-program-btn').live('click', test_program);
|
|
|
|
|
$('#test-program-btn').on('click', test_program);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#commit-program-work-btn').live('click', function(){
|
|
|
|
|
$('#commit-program-work-btn').on('click', function(){
|
|
|
|
|
if(!valid_form()){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -89,11 +89,10 @@ $(function(){
|
|
|
|
|
$(".HomeWorkCon form").submit();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('form.edit_student_work').live('keydown', '#program-src', function(){
|
|
|
|
|
$('form.edit_student_work').on('keydown', '#program-src', function(){
|
|
|
|
|
tested = false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//发布作业
|
|
|
|
|
|
|
|
|
|
$('#program-src').focus(function(){
|
|
|
|
@ -104,70 +103,74 @@ $(function(){
|
|
|
|
|
|
|
|
|
|
$('input.date-input').datepicker(datepickerOptions);
|
|
|
|
|
|
|
|
|
|
$('a.pic_date').live('click', function(){
|
|
|
|
|
$('a.pic_date').on('click', function(){
|
|
|
|
|
$(this).parent().prev().first().focus();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('a.ProBtn').live('click', function(){
|
|
|
|
|
$("#BluePopupBox").dialog({
|
|
|
|
|
$("#BluePopupBox").dialog({
|
|
|
|
|
modal: true,
|
|
|
|
|
autoOpen: false,
|
|
|
|
|
dialogClass: 'BluePopupBox',
|
|
|
|
|
minWidth: 753
|
|
|
|
|
});
|
|
|
|
|
$(".ui-dialog-titlebar").hide();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("a.CloseBtn").live('click', function(){
|
|
|
|
|
$('a.ProBtn').on('click', function(){
|
|
|
|
|
$("#BluePopupBox").dialog("open");
|
|
|
|
|
$(".ui-dialog-titlebar").hide();
|
|
|
|
|
$("a.CloseBtn").on('click', function(){
|
|
|
|
|
$("#BluePopupBox" ).dialog("close");
|
|
|
|
|
});
|
|
|
|
|
$('#textarea_input_test').focus();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
|
|
|
|
|
var test_numbers = 0;
|
|
|
|
|
var valid = true;
|
|
|
|
|
var input = null;
|
|
|
|
|
var output = null;
|
|
|
|
|
var input_groups = [];
|
|
|
|
|
$.each($('#BluePopupBox textarea.InputBox'), function(i, val){
|
|
|
|
|
if ($(val).val().length<=0) {
|
|
|
|
|
$(val)[0].focus();
|
|
|
|
|
valid =false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (test_numbers %2==0) {
|
|
|
|
|
input = $(val).val();
|
|
|
|
|
} else {
|
|
|
|
|
output = $(val).val();
|
|
|
|
|
input_groups.push({input: input, output: output});
|
|
|
|
|
}
|
|
|
|
|
test_numbers += 1;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var language = $('select.language_type').val() == 1 ? 'C语言' : 'C++语言';
|
|
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
$("input[name=homework_type]").val(2);
|
|
|
|
|
$('span.program_detail_info').text('('+language+','+test_numbers/2+'组测试)');
|
|
|
|
|
//保存js值
|
|
|
|
|
var data = {
|
|
|
|
|
language_type: $('select.language_type').val(),
|
|
|
|
|
input_groups: input_groups
|
|
|
|
|
};
|
|
|
|
|
//构建到form中
|
|
|
|
|
$('.program-input').remove();
|
|
|
|
|
var html=bt('t:program-input-list',data);
|
|
|
|
|
$("input[name=homework_type]").after(html);
|
|
|
|
|
$("#BluePopupBox" ).dialog( "close" );
|
|
|
|
|
$("#BluePopupBox a.BlueCirBtn").on('click', function(){
|
|
|
|
|
var test_numbers = 0;
|
|
|
|
|
var valid = true;
|
|
|
|
|
var input = null;
|
|
|
|
|
var output = null;
|
|
|
|
|
var input_groups = [];
|
|
|
|
|
$.each($('#BluePopupBox textarea.InputBox'), function(i, val){
|
|
|
|
|
if ($(val).val().length<=0) {
|
|
|
|
|
$(val)[0].focus();
|
|
|
|
|
valid =false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (test_numbers %2==0) {
|
|
|
|
|
input = $(val).val();
|
|
|
|
|
} else {
|
|
|
|
|
output = $(val).val();
|
|
|
|
|
input_groups.push({input: input, output: output});
|
|
|
|
|
}
|
|
|
|
|
test_numbers += 1;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var language = $('select.language_type').val() == 1 ? 'C语言' : 'C++语言';
|
|
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
$("input[name=homework_type]").val(2);
|
|
|
|
|
$('span.program_detail_info').text('('+language+','+test_numbers/2+'组测试)');
|
|
|
|
|
//保存js值
|
|
|
|
|
var data = {
|
|
|
|
|
language_type: $('select.language_type').val(),
|
|
|
|
|
input_groups: input_groups
|
|
|
|
|
};
|
|
|
|
|
//构建到form中
|
|
|
|
|
$('.program-input').remove();
|
|
|
|
|
var html=bt('t:program-input-list',data);
|
|
|
|
|
$("input[name=homework_type]").after(html);
|
|
|
|
|
if($( "#BluePopupBox" ).dialog( "isOpen" )){
|
|
|
|
|
$("#BluePopupBox").dialog( "close" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#BluePopupBox").live('click', 'a.icon_add', function(){
|
|
|
|
|
$("#BluePopupBox").on('click', 'a.icon_add', function(){
|
|
|
|
|
var html = bt('t:test-answer-list', null);
|
|
|
|
|
$(this).parent('.mt10').after(html);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
$("#BluePopupBox").live('click', 'a.icon_remove', function(){
|
|
|
|
|
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
|
|
|
|
|
$(this).parent('.mt10').remove();
|
|
|
|
|
});
|
|
|
|
|
});
|