24 lines
704 B
JavaScript
24 lines
704 B
JavaScript
|
$(function(){
|
||
|
|
||
|
$('#test-program-btn').on('click', function(){
|
||
|
var homework_id = $(this).attr('data-homework-id');
|
||
|
var student_work_id = $(this).attr('data-student-work-id');
|
||
|
var src = $('#program-src').val();
|
||
|
var title = $('program-title').val();
|
||
|
|
||
|
if (!src) {
|
||
|
alert('请输入正确的代码');
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
$.post(
|
||
|
'/student_work/program_test',
|
||
|
{homework: homework_id, student_work_id: student_work_id, src: src, title: title},
|
||
|
function(data,status){
|
||
|
if(data.status==-2){
|
||
|
alert('编译失败');
|
||
|
}
|
||
|
}
|
||
|
);
|
||
|
});
|
||
|
});
|