socialforge/public/javascripts/homework.js

24 lines
704 B
JavaScript
Raw Normal View History

2015-08-28 12:04:49 +08:00
$(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('编译失败');
}
}
);
});
});