Merge branch 'yuanke' into develop
This commit is contained in:
commit
016177a078
|
@ -107,7 +107,7 @@
|
||||||
<div class="mt10">
|
<div class="mt10">
|
||||||
<a href="javascript:void(0);" class="BlueCirBtn fl" data-homework-id="<%=@homework.id%>" data-student-work-id="<%=@student_work.id%>" id="test-program-btn">测试代码</a>
|
<a href="javascript:void(0);" class="BlueCirBtn fl" data-homework-id="<%=@homework.id%>" data-student-work-id="<%=@student_work.id%>" id="test-program-btn">测试代码</a>
|
||||||
<% if @is_test %>
|
<% if @is_test %>
|
||||||
<%=link_to '返 回',homework_common_index_path(:course => @course.id),:class=>'fr mt6' %>
|
<%=link_to '返 回',homework_common_index_path(:course => @course.id),:class=>'fr mt6',:style =>'line-height:30px;' %>
|
||||||
<% else @is_test %>
|
<% else @is_test %>
|
||||||
<a href="javascript:void(0);" class="BlueCirBtn fr" id="commit-program-work-btn">提交代码</a>
|
<a href="javascript:void(0);" class="BlueCirBtn fr" id="commit-program-work-btn">提交代码</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -22,6 +22,7 @@ $(function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
var test_program = function(cb){
|
var test_program = function(cb){
|
||||||
|
$('#test-program-btn').hide();
|
||||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||||
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
||||||
var src = $('#program-src').val();
|
var src = $('#program-src').val();
|
||||||
|
@ -29,6 +30,7 @@ $(function(){
|
||||||
var is_test = $('input[name=is_test]').val();
|
var is_test = $('input[name=is_test]').val();
|
||||||
|
|
||||||
if(!valid_form()){
|
if(!valid_form()){
|
||||||
|
$('#test-program-btn').show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -78,17 +80,19 @@ $(function(){
|
||||||
$('.ProResult').prepend(html);
|
$('.ProResult').prepend(html);
|
||||||
|
|
||||||
if (data.status==0 && is_test != 'true') {
|
if (data.status==0 && is_test != 'true') {
|
||||||
if (typeof cb == 'function') {cb(data); return;}
|
if (typeof cb == 'function') {cb(data);$('#test-program-btn').show(); return;}
|
||||||
var r=confirm("答题正确,是否立刻提交?");
|
var r=confirm("答题正确,是否立刻提交?");
|
||||||
if (r) {
|
if (r) {
|
||||||
$(".HomeWorkCon form").submit();
|
$(".HomeWorkCon form").submit();
|
||||||
}
|
}
|
||||||
|
$('#test-program-btn').show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//2 超时 -2 编译错误 测试结束
|
//2 超时 -2 编译错误 测试结束
|
||||||
if (data.status == 2 || data.status == -2 || tSeq >= tCount ){
|
if (data.status == 2 || data.status == -2 || tSeq >= tCount ){
|
||||||
if (typeof cb == 'function') {cb(data); return;}
|
if (typeof cb == 'function') {cb(data);$('#test-program-btn').show(); return;}
|
||||||
|
$('#test-program-btn').show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +104,7 @@ $(function(){
|
||||||
} else {
|
} else {
|
||||||
alert("对不起,服务器繁忙请稍后再试!");
|
alert("对不起,服务器繁忙请稍后再试!");
|
||||||
}
|
}
|
||||||
|
$('#test-program-btn').show();
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue