作品补交、补交附件
This commit is contained in:
parent
c604a849ca
commit
cb12147d11
|
|
@ -561,7 +561,7 @@ class StudentWorkController < ApplicationController
|
|||
student_work.homework_common_id = @homework.id
|
||||
student_work.user_id = User.current.id
|
||||
student_work.commit_time = Time.now
|
||||
student_work.late_reason = params[:late_reason] if params[:late_reason]
|
||||
#student_work.late_reason = params[:late_reason] if params[:late_reason]
|
||||
student_work.group_id = @homework.student_works.all_commit.select("distinct group_id").count + 1
|
||||
student_work.save_attachments(params[:attachments])
|
||||
render_attachment_warning_if_needed(student_work)
|
||||
|
|
@ -713,6 +713,7 @@ class StudentWorkController < ApplicationController
|
|||
appeal_message.update_all(:viewed => true)
|
||||
end
|
||||
|
||||
@is_focus = params[:is_focus] if params[:is_focus]
|
||||
@score = student_work_score @work,User.current
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
if (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher && @work.user != User.current
|
||||
|
|
@ -1369,10 +1370,7 @@ class StudentWorkController < ApplicationController
|
|||
CourseMessage.create(:user_id => student_work.homework_common.user_id, :course_id => student_work.homework_common.course_id, :viewed => false,:course_message_id=>attachment.container_id,:course_message_type=>'StudentWork',:status=>2)
|
||||
end
|
||||
@work.update_attributes(:re_commit => 1)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
@homework = @work.homework_common
|
||||
redirect_to student_work_path(@work)
|
||||
end
|
||||
|
||||
def new_student_work_project
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/structure','css/edu-common', 'css/edu-public','css/taskstyle', 'css/font-awesome', 'css/edu-class', 'css/edu-popup', 'css/ketang', 'css/magic-check', "css/edu-admin", "bootstrap/bootstrap-min.css" %>
|
||||
<%= javascript_include_tag "edu/application",'edu/base_edu','baiduTemplate','jquery.datetimepicker.js','edu/course' %>
|
||||
<%= javascript_include_tag "edu/application",'edu/base_edu','baiduTemplate','jquery.datetimepicker.js','edu/course','attachments' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,23 @@
|
|||
<div id="muban_popup_box" style="width:500px;">
|
||||
<div class="muban_popup_top">
|
||||
<h3 class="fl">
|
||||
上传附件
|
||||
</h3>
|
||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||
<div class="cl"></div>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
||||
<div class="task-popup" style="width:500px;">
|
||||
<div class="task-popup-title clearfix">
|
||||
<h3 class="fl color-grey">补交附件</h3>
|
||||
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
|
||||
</div>
|
||||
<div class="muban_popup_con ml50 mt20 mb10 uploadBoxContainer">
|
||||
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||
|
||||
<div class="task-popup-content mt10 mb10 mr20 ml20">
|
||||
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:name=>"upload_form",:id=>'upload_form') do %>
|
||||
<div>
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
</span>
|
||||
</div>
|
||||
<div class="uploadBox" id="uploadReviseBox">
|
||||
<div class="fl mr20" id="uploadReviseBox">
|
||||
<input type="hidden" name="attachment_type" value="7">
|
||||
<a href="javascript:void(0);" class="uploadIcon f14" name="button" id="choose_revise_attach" onclick="_file.click();" style="<%= ie8? ? 'display:none' : ''%>">
|
||||
<span class="chooseFile">选择文件</span></a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue" name="button" id="choose_revise_attach" onclick="_file.click();" style="<%= ie8? ? 'display:none' : ''%>">
|
||||
选择文件</a>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '':'file_selector',
|
||||
|
|
@ -35,27 +37,26 @@
|
|||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
<div class="cl"></div>
|
||||
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
</div>
|
||||
<div class="uploadResourceIntr">
|
||||
<div class="uploadResourceName">最多只能上传一个小于<span class="c_red">50MB</span>的附件</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
<textarea class="reUploadDetail" id="attachment_des" name="description" placeholder="请在此输入您追加附件的理由(必填)"></textarea>
|
||||
<textarea class="reUploadDetail" id="attachment_des" name="description" placeholder="请在此输入您补交附件的理由(必填)"></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p id="hint_message"></p>
|
||||
<div class="cl"></div>
|
||||
<div class="_notice_box text_c none mt5" style="height: 20px; width: 397px; padding: 4px 4px; line-height: 20px;" id="_notice_box">注意:暂不支持IE浏览器的上传,请更换浏览器</div>
|
||||
<div style="margin-top: 10px">
|
||||
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="fl sy_btn_grey mr10" onclick="closeModal();">取消</a>
|
||||
<a href="javascript:void(0);" id="upload_files_submit_btn" class="fl sy_btn_blue" onclick="submit_revise_files();">确定</a>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" id="upload_files_submit_btn" class="task-btn task-btn-blue fr sure" onclick="submit_revise_files();">确定</a>
|
||||
<a href="javascript:void(0);" class="pop_close task-btn fr mr10 cancel">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<div class="">
|
||||
<ul>
|
||||
<li class="clearfix mb5">
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>内容 </label>
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span><%= @homework.homework_detail_manual.comment_status > 1 ? '补交内容' : '内容' %> </label>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl task-textarea-pd undis">请输入作品描述,可以直接粘贴图片</textarea>
|
||||
<%= f.kindeditor :description, :editor_id => 'student_work_description_editor',
|
||||
:owner_id => @student_work.nil? ? 0: @student_work.id,
|
||||
|
|
@ -114,21 +114,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @homework.end_time < Time.now %>
|
||||
<div class="edu-con-bg01 mt15" style="padding:30px 0;">
|
||||
<div class="ml30 mr30">
|
||||
<li class="clearfix mb5">
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>补交原因 </label>
|
||||
<textarea name="late_reason" class="panel-form-width-690 panel-form-height-150 fl task-textarea-pd panel-box-sizing" maxlength="1000" placeholder="请输入补交作品的原因,最多500个字符"><%= @student_work.late_reason %></textarea>
|
||||
</li>
|
||||
<li class="none" id="student_work_reason_notice">
|
||||
<label class="panel-form-label fl"> </label>
|
||||
<span class="color-orange fl"><i class="fa fa-exclamation-circle mr5 color-orange"></i>迟交原因不能为空</span>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="clearfix mt15">
|
||||
<a href="javascript:void(0);" onclick="submit_new_student_work('<%= @homework.homework_type %>')" class="task-btn task-btn-blue fr">提交</a>
|
||||
<%=link_to '取消', student_work_index_path(:homework => @homework.id),:class=>'task-btn fr mr10' %>
|
||||
|
|
|
|||
|
|
@ -16,10 +16,13 @@
|
|||
<% if @homework.homework_type == 1 || @homework.homework_type == 3 %>
|
||||
<div class="edu-con-bg01 mt15">
|
||||
<div class="edu-con-top clearfix">
|
||||
<p class="ml15">内容</p>
|
||||
<p class="ml15 font-bd fl"><%= @work.work_status == 2 ? '补交内容' : "内容" %></p>
|
||||
<% if @work.work_status != 0 && User.current == @work.user && @homework.allow_late && @homework.homework_detail_manual.comment_status > 1 %>
|
||||
<a onclick="show_upload()" id="upload_revise_attachment" href="javascript:void(0);" class="edu-btn fr mr10">补交附件</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="edu-tab-con-box">
|
||||
<%= @work.description.html_safe %>
|
||||
<div id="student_work_img_<%=@work.id %>"><%= @work.description.html_safe %></div>
|
||||
<ul>
|
||||
<% com_attachments = @work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
|
|
@ -27,38 +30,30 @@
|
|||
<% else%>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
<% end%>
|
||||
<li class="color-grey"><span><%= format_time(@work.created_at) %> 提交</span><span class="ml15"><%= format_time(@work.updated_at) %> 更新</span></li>
|
||||
<li class="color-grey"><span><%= format_time(@work.commit_time) %> 提交</span><span class="ml15"><%= format_time(@work.updated_at) %> 更新</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% if @work.work_status == 2 || (@work.work_status == 1 && !@work.attachments.where(:attachtype => 7).blank?) %>
|
||||
<% if !@work.attachments.where(:attachtype => 7).blank? %>
|
||||
<% revise_attachment = @work.attachments.where("attachtype = 7").first %>
|
||||
<div class="edu-con-bg01 mt15" >
|
||||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 font-bd">补交原因</p>
|
||||
<div class="edu-con-top clearfix">
|
||||
<p class="ml15 font-bd">补交附件</p>
|
||||
</div>
|
||||
<div class="edu-tab-con-box ">
|
||||
<% if @work.work_status == 2 %>
|
||||
<%= @work.try(:late_reason) %>
|
||||
<% else %>
|
||||
<%= @work.attachments.where(:attachtype => 7).first.try(:description) %>
|
||||
<% end %>
|
||||
<div class="edu-tab-con-box">
|
||||
补交原因:<%= revise_attachment.description %>
|
||||
<ul>
|
||||
<% com_attachments = @work.attachments.where("attachtype IS NULL OR attachtype = 7") %>
|
||||
<% if com_attachments.empty? %>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
<% end%>
|
||||
<li class="color-grey"><span><%= format_time(@work.created_at) %> 提交</span><span class="ml15"><%= format_time(@work.updated_at) %> 更新</span></li>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @work.attachments.where("attachtype = 7"), :status => @homework.homework_detail_manual.comment_status} %>
|
||||
<li class="color-grey"><span><%= format_time(revise_attachment.created_on) %> 提交</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_type == 2 %>
|
||||
<% unless @work.description.blank? %>
|
||||
<div class="edu-con-bg01 mt15" >
|
||||
<div class="edu-con-bg01 mt15">
|
||||
<div class="edu-con-top clearfix">
|
||||
<p class="ml15 ">内容</p>
|
||||
<p class="ml15 font-bd">内容</p>
|
||||
</div>
|
||||
<div class="edu-tab-con-box ">
|
||||
<textarea id="work-src_<%= @work.id %>" name="content"><%= @work.description if @work.description %></textarea>
|
||||
|
|
@ -157,7 +152,7 @@
|
|||
<p class="ml15 font-bd">其他组员</p>
|
||||
</div>
|
||||
<div class="edu-tab-con-box ">
|
||||
<div class=" clearfix">
|
||||
<div class="clearfix">
|
||||
<% @team_work.each do |team_work| %>
|
||||
<a href="<%= user_path(team_work) %>" class=" fl mr15 link-color-blue"><%= team_work.try(:show_name) %></a>
|
||||
<% end %>
|
||||
|
|
@ -233,6 +228,10 @@
|
|||
<script>
|
||||
$(function(){
|
||||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
showNormalImage('student_work_img_<%=@work.id %>');
|
||||
<% if defined?(@is_focus) && @is_focus.to_i == 1 %>
|
||||
$("#upload_revise_attachment").click();
|
||||
<% end %>
|
||||
});
|
||||
var first_click_score = true;
|
||||
function score_submit(id){
|
||||
|
|
@ -277,4 +276,24 @@
|
|||
hideModal();
|
||||
}
|
||||
}
|
||||
function show_upload(){
|
||||
var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>@work})%>";
|
||||
pop_box_new(htmlvalue, 500, 230);
|
||||
}
|
||||
function regex_des() {
|
||||
if ($.trim($("#attachment_des").val()) == "") {
|
||||
$("#hint_message").text("补交理由不能为空");
|
||||
$("#hint_message").css('color','#ff0000');
|
||||
return false;
|
||||
} else {
|
||||
$("#hint_message").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function submit_revise_files(){
|
||||
if (regex_des()) {
|
||||
$("#upload_form").submit();
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
<div class="">
|
||||
<%= user_for_homework_common activity,is_teacher,work %>
|
||||
</div>
|
||||
<% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Time.now %>
|
||||
<% if !is_teacher && work && work.work_status != 0 && work.user == User.current && activity.allow_late && activity.homework_detail_manual.comment_status > 1 %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
<%=link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 2 && is_teacher%>
|
||||
|
|
|
|||
|
|
@ -204,12 +204,16 @@ function addReviseFile(inputEl, file, eagerUpload,btnId) {
|
|||
'class': 'attachment'
|
||||
});
|
||||
|
||||
fileSpan.append(
|
||||
fileSpan.append($('<i></i>').attr({
|
||||
'class': 'fa fa-folder mr5 color-light-grey',
|
||||
'aria-hidden': true
|
||||
}),
|
||||
$('<input>', {
|
||||
'type': 'text',
|
||||
'class': 'upload_filename readonly',
|
||||
'class': 'upload_filename readonly hidden',
|
||||
'name': 'attachments[' + attachmentId + '][filename]',
|
||||
'readonly': 'readonly'
|
||||
'readonly': 'readonly',
|
||||
'style': 'border:none; max-width:980px;white-space: nowrap; text-overflow:ellipsis;'
|
||||
}).val(file.name),
|
||||
// $('<input>', {
|
||||
// 'type': 'text',
|
||||
|
|
@ -228,9 +232,10 @@ function addReviseFile(inputEl, file, eagerUpload,btnId) {
|
|||
// 'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
|
||||
// checked: 'checked'
|
||||
// }).toggle(!eagerUpload),
|
||||
$('<a> </a>').attr({
|
||||
$('<a><i class="fa fa-trash-o mr5"></i></a>').attr({
|
||||
'href': "#",
|
||||
'class': 'remove-upload'
|
||||
'class': 'remove-upload',
|
||||
'style': 'vertical-align:top;'
|
||||
}).click(function() {
|
||||
if (confirm($(inputEl).data('areYouSure'))) {
|
||||
removeReviseFile();
|
||||
|
|
|
|||
|
|
@ -354,3 +354,18 @@ a:hover.edu-class-inner-list{color:#3498db;}
|
|||
a.task-btn-line{display: inline-block;font-weight: bold;padding: 0 12px;color: #666;background: #fff;letter-spacing: 1px;text-align: center;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px; border:1px solid #ccc;}
|
||||
a:hover.task-btn-line{ border:1px solid #3498db;background:#3498db;color: #fff;}
|
||||
|
||||
/* 补交附件 */
|
||||
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative}
|
||||
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#3498db; border-radius:3px; float:left; margin-right:12px;}
|
||||
a.uploadBoxIcon {background:url(../images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;}
|
||||
a.uploadIcon {width:100px; height:33px;color:#ffffff;}
|
||||
.chooseFile {color:#ffffff; display:block; margin-left:32px;}
|
||||
.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;}
|
||||
.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;}
|
||||
.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;}
|
||||
.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;}
|
||||
.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;}
|
||||
.mb10 {margin-bottom: 10px}
|
||||
.mb15 {margin-bottom: 15px}
|
||||
.disable_link a {background-color: #c1c1c1 !important;}
|
||||
.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:428px; height:80px; overflow-y:auto;outline: none;}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ a:hover.task_icons_close{background: url(../images/popup/sy_icons_close.png) -40
|
|||
.upload_select_box li{ height: 30px; line-height:30px;}
|
||||
.upload_select_box li div.mt5{ margin-top:0px;}
|
||||
.upload_select_box li:hover{ background:#e4eaf6;}
|
||||
.task-popup-submit02{ margin:15px auto; width:110px;}
|
||||
.task-popup-submit02{ margin:15px auto; width:120px;}
|
||||
.task-popup-submit03{ margin:15px auto; width:70px;}
|
||||
.task-popup-submit04{ margin:15px auto; width:85px;}
|
||||
/*智能课堂弹框tab 20170428byLB*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue