|
|
|
@ -901,24 +901,30 @@ $(function(){
|
|
|
|
|
$('#download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) {
|
|
|
|
|
if(status == 'success'){
|
|
|
|
|
var res = JSON.parse(data.responseText);
|
|
|
|
|
if(res.length<1){
|
|
|
|
|
return;
|
|
|
|
|
if(res.length == null){
|
|
|
|
|
alert("该作业没有任何附件可下载");
|
|
|
|
|
}
|
|
|
|
|
if(res.length==1){
|
|
|
|
|
location.href = '/zipdown/download?file='+res[0].file;return;
|
|
|
|
|
else if(res.length<1){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
document.getElementById('light').style.display='block';
|
|
|
|
|
$container = $('#light .upload_box_ul');
|
|
|
|
|
$container.empty();
|
|
|
|
|
for(var i = 0; i <res.length; ++i){
|
|
|
|
|
var des = '';
|
|
|
|
|
if(res.count > 1){
|
|
|
|
|
des = '第'+res[i].index+'-'+(res[i].count+res[i].index-1)+'个学生的作品下载';
|
|
|
|
|
} else {
|
|
|
|
|
des = '第'+res[i].index+'个学生的作品下载';
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(res.length==1){
|
|
|
|
|
location.href = '/zipdown/download?file='+res[0].file;return;
|
|
|
|
|
}
|
|
|
|
|
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="/zipdown/download?file='+res[i].file+'">'+des+'</a><span class="c_grey"> (共'+res[i].size+'M)</span> </li>').appendTo($container);
|
|
|
|
|
document.getElementById('light').style.display='block';
|
|
|
|
|
$container = $('#light .upload_box_ul');
|
|
|
|
|
$container.empty();
|
|
|
|
|
for(var i = 0; i <res.length; ++i){
|
|
|
|
|
var des = '';
|
|
|
|
|
if(res.count > 1){
|
|
|
|
|
des = '第'+res[i].index+'-'+(res[i].count+res[i].index-1)+'个学生的作品下载';
|
|
|
|
|
} else {
|
|
|
|
|
des = '第'+res[i].index+'个学生的作品下载';
|
|
|
|
|
}
|
|
|
|
|
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="/zipdown/download?file='+res[i].file+'">'+des+'</a><span class="c_grey"> (共'+res[i].size+'M)</span> </li>').appendTo($container);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|