班级作业的设置和列表变更
This commit is contained in:
parent
cb12147d11
commit
72369ff2fd
|
|
@ -41,18 +41,12 @@ class HomeworkCommonController < ApplicationController
|
|||
case @order
|
||||
when '1'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and end_time > '#{Time.now}'").order("homework_commons.created_at desc")
|
||||
when '2'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and late_time > '#{Time.now}'").order("homework_commons.created_at desc")
|
||||
when '3'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.evaluation_end > '#{Time.now}')
|
||||
or (homework_detail_manuals.comment_status = 1 and end_time < '#{Time.now}' and allow_late = 0 and anonymous_comment = 0 and homework_detail_manuals.evaluation_start >= '#{Time.now}')
|
||||
or (homework_detail_manuals.comment_status = 2 and late_time < '#{Time.now}' and anonymous_comment = 0 and homework_detail_manuals.evaluation_start >= '#{Time.now}')").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.evaluation_end > '#{Time.now}'").order("homework_commons.created_at desc")
|
||||
when '4'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.appeal_time > '#{Time.now}')").order("homework_commons.created_at desc")
|
||||
when '5'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and archive_time > '#{Time.now}')
|
||||
or (homework_detail_manuals.comment_status = 1 and end_time < '#{Time.now}' and (anonymous_comment = 1 or (anonymous_comment = 0 and homework_detail_manuals.evaluation_start < '#{Time.now}')) and archive_time >= '#{Time.now}')
|
||||
or (homework_detail_manuals.comment_status = 2 and late_time < '#{Time.now}' and (anonymous_comment = 1 or (anonymous_comment = 0 and homework_detail_manuals.evaluation_start < '#{Time.now}')) and archive_time >= '#{Time.now}')").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and archive_time > '#{Time.now}')").order("homework_commons.created_at desc")
|
||||
else
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order}").order("homework_commons.created_at desc")
|
||||
end
|
||||
|
|
@ -60,7 +54,7 @@ class HomeworkCommonController < ApplicationController
|
|||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@is_new = params[:is_new]
|
||||
|
||||
@homeworks = paginateHelper @homework_commons,10
|
||||
@homeworks = paginateHelper @homework_commons,15
|
||||
#设置at已读
|
||||
ids = @homeworks.inject([]) do |ids, homework|
|
||||
jids = homework.journals_for_messages.map(&:id)
|
||||
|
|
@ -225,11 +219,11 @@ class HomeworkCommonController < ApplicationController
|
|||
def late_setting
|
||||
if params[:homework_allow_late] == '1'
|
||||
@homework.allow_late = true
|
||||
@homework.late_time = params[:homework_late_time]
|
||||
#@homework.late_time = params[:homework_late_time]
|
||||
@homework.late_penalty = params[:homework_late_penalty].to_i
|
||||
else
|
||||
@homework.allow_late = false
|
||||
@homework.late_time = nil
|
||||
#@homework.late_time = nil
|
||||
@homework.late_penalty = 0
|
||||
end
|
||||
@homework.save
|
||||
|
|
|
|||
|
|
@ -234,7 +234,14 @@ module ApiHelper
|
|||
updateAtValue = timeIntoFormat.to_s + "年"
|
||||
end
|
||||
updateAtValue
|
||||
end
|
||||
|
||||
# 计算到结束还有多长时间 **天**小时**分
|
||||
def how_much_time time
|
||||
result = ""
|
||||
result = ((time - Time.now.to_i).to_i / (24*60*60)).to_s + " 天 "
|
||||
result += (((time - Time.now.to_i).to_i % (24*60*60)) / (60*60)).to_s + " 小时 "
|
||||
result += ((((time - Time.now.to_i).to_i % (24*60*60)) % (60*60)) / 60).to_s + " 分 "
|
||||
end
|
||||
|
||||
#日期转换为时间
|
||||
|
|
|
|||
|
|
@ -321,6 +321,10 @@ module ApplicationHelper
|
|||
style = 'edu-filter-btn-green'
|
||||
when '已结束'
|
||||
style = 'edu-filter-btn'
|
||||
when '已开启补交'
|
||||
style = 'edu-filter-btn-late'
|
||||
when '未开启补交'
|
||||
style = 'edu-filter-btn-no-late'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -352,51 +356,34 @@ module ApplicationHelper
|
|||
case ho_detail_manual.comment_status
|
||||
when 0
|
||||
status = "挂起"
|
||||
if homework_common.publish_time && homework_common.publish_time > Time.now
|
||||
time = time_from_future(homework_common.publish_time).to_s + "后发布"
|
||||
end
|
||||
when 1
|
||||
status = "提交中"
|
||||
if homework_common.end_time && homework_common.end_time >= Time.now
|
||||
time = time_from_future(homework_common.end_time).to_s + "后结束"
|
||||
elsif homework_common.anonymous_comment == 0 && ho_detail_manual.evaluation_start && ho_detail_manual.evaluation_start >= Time.now
|
||||
status = "匿评中"
|
||||
time = time_from_future(ho_detail_manual.evaluation_start).to_s + "后开始"
|
||||
elsif homework_common.archive_time && homework_common.archive_time >= Time.now
|
||||
status = "评阅中"
|
||||
time = time_from_future(homework_common.archive_time).to_s + "后结束"
|
||||
end
|
||||
when 2
|
||||
status = "补交中"
|
||||
if homework_common.late_time && homework_common.late_time >= Time.now
|
||||
time = time_from_future(homework_common.late_time).to_s + "后结束"
|
||||
elsif homework_common.anonymous_comment == 0 && ho_detail_manual.evaluation_start && ho_detail_manual.evaluation_start >= Time.now
|
||||
status = "匿评中"
|
||||
time = time_from_future(ho_detail_manual.evaluation_start).to_s + "后开始"
|
||||
elsif homework_common.archive_time && homework_common.archive_time >= Time.now
|
||||
status = "评阅中"
|
||||
time = time_from_future(homework_common.archive_time).to_s + "后结束"
|
||||
status = "提交中"
|
||||
time = how_much_time(homework_common.end_time)
|
||||
end
|
||||
when 3
|
||||
status = "匿评中"
|
||||
if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now
|
||||
time = time_from_future(ho_detail_manual.evaluation_end).to_s + "后结束"
|
||||
status = "匿评中"
|
||||
time = how_much_time(ho_detail_manual.evaluation_end)
|
||||
end
|
||||
when 4
|
||||
status = "申诉中"
|
||||
if ho_detail_manual.appeal_time && ho_detail_manual.appeal_time > Time.now
|
||||
time = time_from_future(ho_detail_manual.appeal_time).to_s + "后结束"
|
||||
status = "申诉中"
|
||||
time = how_much_time(ho_detail_manual.appeal_time)
|
||||
end
|
||||
when 5
|
||||
status = "评阅中"
|
||||
if homework_common.archive_time && homework_common.archive_time > Time.now
|
||||
time = time_from_future(homework_common.archive_time).to_s + "后结束"
|
||||
status = "评阅中"
|
||||
time = how_much_time(homework_common.archive_time)
|
||||
end
|
||||
when 6
|
||||
status = "已结束"
|
||||
time = format_time homework_common.archive_time
|
||||
end
|
||||
end
|
||||
if status == "" && homework_common.allow_late && homework_common.archive_time > Time.now
|
||||
time = how_much_time homework_common.archive_time
|
||||
end
|
||||
result[:status] = status
|
||||
result[:time] = time
|
||||
result
|
||||
|
|
|
|||
|
|
@ -4,36 +4,32 @@
|
|||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " onclick="setting_cancel_edit('late_cancel_edit');" title="取消"><i class="fa fa-times mr15"></i></a>
|
||||
</div>
|
||||
<div class="ml30 mr30" style="padding-bottom:20px;">
|
||||
<div class="clearfix " >
|
||||
<div class="clearfix">
|
||||
<%= form_tag(late_setting_homework_common_path(@homework), :remote => true, :method => "post", :id => 'late_setting_form') do |f| %>
|
||||
<ul >
|
||||
<li class="clearfix mb20 edu-position">
|
||||
<label class="task-height-40 fl mr10">是否允许在截止日期之后进行补交</label>
|
||||
<span class="fl mr15">
|
||||
<input id="edit_allow_late_1" class="magic-radio" type="radio" name="homework_allow_late" value="1" <%= @homework.allow_late ? 'checked' : '' %>>
|
||||
<label for="edit_allow_late_1">允许</label>
|
||||
</span>
|
||||
<span class="fl mr15">
|
||||
<input id="edit_allow_late_0" class="magic-radio" type="radio" name="homework_allow_late" value="0" <%= @homework.allow_late ? '' : 'checked' %>>
|
||||
<label for="edit_allow_late_0">禁止</label>
|
||||
</span>
|
||||
<label class="panel-form-label fl mr10">作品补交</label>
|
||||
<input id="edit_allow_late_1" class="magic-radio fl mt6" type="radio" name="homework_allow_late" value="1" <%= @homework.allow_late ? 'checked' : '' %>>
|
||||
<label for="edit_allow_late_1" class="fl mr30 mt6">允许补交</label>
|
||||
<input id="edit_allow_late_0" class="magic-radio fl mt6" type="radio" name="homework_allow_late" value="0" <%= @homework.allow_late ? '' : 'checked' %>>
|
||||
<label for="edit_allow_late_0" class="fl mt6">禁止补交</label>
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>允许补交,则在补交截止日期之前,学生可以修改作品和追加附件 <br/>
|
||||
但是在发布截止时间 ~ 补交截止时间内才提交作品的学生,将被扣迟交分
|
||||
</p>
|
||||
<% if @homework.allow_late %>
|
||||
<p id="edit_late_notice">允许补交,则在结束日期之前,学生可以补交作品 <br/>
|
||||
但是在提交截止时间之后才提交作品的学生,将被扣迟交分
|
||||
</p>
|
||||
<% else %>
|
||||
<p id="edit_late_notice">禁止补交,则在提交截止时间之后,学生不能再提交作品
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="<%= @homework.allow_late ? '' : 'none' %>" id="late_relate_setting_ul">
|
||||
<ul id="late_relate_setting_ul">
|
||||
<li class="clearfix mb15">
|
||||
<label class=" panel-form-label fl mr10">截止时间</label>
|
||||
<input type="text" class="fl task-form-15 task-height-40 panel-box-sizing" readonly value="<%= format_time @homework.late_time %>" name="homework_late_time" placeholder="截止时间" />
|
||||
<span class="color-orange fl ml20 mt5 none" id="homework_late_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
</li>
|
||||
<li class="clearfix mb15">
|
||||
<label class=" panel-form-label fl mr10">迟交扣分</label>
|
||||
<label class="panel-form-label fl mr10">迟交扣分</label>
|
||||
<input type="text" class="fl task-form-15 task-height-40 panel-box-sizing" value="<%= @homework.late_penalty %>" name="homework_late_penalty" placeholder="5" />
|
||||
<span class="color-orange fl ml20 mt5 none" id="homework_late_penalty_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
<li class="clearfix mb15 edu-position">
|
||||
<label class="panel-form-label fl mr10">发布时间</label>
|
||||
<input type="text" name="homework_publish_time" readonly value="<%=format_time @homework.publish_time %>" <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 00:00"/>
|
||||
<% if @homework.homework_detail_manual.try(:comment_status) == 0 %>
|
||||
<a href="javascript:void(0);" id="reset_publish_time" class="fl ml15 mt5 <%= @homework.publish_time.nil? ? 'none' : '' %>">清除</a>
|
||||
<% end %>
|
||||
<span class="color-orange fl ml20 mt5 none" id="homework_publish_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
|
||||
|
|
@ -25,9 +22,6 @@
|
|||
<li class="clearfix mb15 edu-position">
|
||||
<label class="panel-form-label fl mr10">截止时间</label>
|
||||
<input type="text" name="homework_end_time" readonly value="<%=format_time @homework.end_time %>" <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 10:00"/>
|
||||
<% if @homework.homework_detail_manual.try(:comment_status) == 0 %>
|
||||
<a href="javascript:void(0);" id="reset_end_time" class="fl ml15 mt5 <%= @homework.end_time.nil? ? 'none' : '' %>">清除</a>
|
||||
<% end %>
|
||||
|
||||
<span class="color-orange fl ml20 mt5 none" id="homework_end_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,13 @@
|
|||
<div class="fl ml15 task-form-90 ">
|
||||
<% homework_curr_status = homework_curr_time(homework_common) %>
|
||||
<%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course), :class => "edu-class-inner-list fl"%>
|
||||
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
|
||||
<% if homework_curr_status[:status] != "" %>
|
||||
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
|
||||
<% end %>
|
||||
<% if homework_common.homework_detail_manual.try(:comment_status) != 0 && homework_common.homework_detail_manual.try(:comment_status) != 6 %>
|
||||
<% allow_late = homework_common.allow_late ? '已开启补交' : '未开启补交' %>
|
||||
<span class="edu-filter-btn <%= homework_status_color allow_late %> ml10 fl mt3"><%= allow_late %></span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p class="color-grey font-12">
|
||||
<span class=""># <%= get_hw_index(homework_common, @is_teacher) + 1 %></span>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 0, :search => @search) %>" class="<%= @order == "0" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">挂起</a>
|
||||
<% end %>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 1, :search => @search) %>" class="<%= @order == "1" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">提交中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 2, :search => @search) %>" class="<%= @order == "2" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">补交中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 3, :search => @search) %>" class="<%= @order == "3" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">匿评中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 4, :search => @search) %>" class="<%= @order == "4" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">申诉中</a>
|
||||
<a href="<%= homework_common_index_path(:course => @course.id, :order => 5, :search => @search) %>" class="<%= @order == "5" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">评阅中</a>
|
||||
|
|
|
|||
|
|
@ -8,29 +8,26 @@
|
|||
<div class="clearfix">
|
||||
<ul>
|
||||
<li class="clearfix mb20 edu-position">
|
||||
<label class="task-height-40 fl mr10">是否允许在截止日期之后进行补交</label>
|
||||
<span class="fl mr15">
|
||||
<input class="magic-radio" type="radio" disabled value="1" <%= @homework.allow_late ? 'checked' : '' %>>
|
||||
<label>允许</label>
|
||||
</span>
|
||||
<span class="fl mr15">
|
||||
<input class="magic-radio" type="radio" disabled value="0" <%= @homework.allow_late ? '' : 'checked' %>>
|
||||
<label>禁止</label>
|
||||
</span>
|
||||
<label class="panel-form-label fl mr10">作品补交</label>
|
||||
<input class="magic-radio fl mt6" type="radio" disabled value="1" <%= @homework.allow_late ? 'checked' : '' %>>
|
||||
<label class="fl mt6 mr30">允许补交</label>
|
||||
<input class="magic-radio fl mt6" type="radio" disabled value="0" <%= @homework.allow_late ? '' : 'checked' %>>
|
||||
<label class="fl mt6">禁止补交</label>
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>允许补交,则在补交截止日期之前,学生可以修改作品和追加附件 <br/>
|
||||
但是在发布截止时间 ~ 补交截止时间内才提交作品的学生,将被扣迟交分
|
||||
</p>
|
||||
<% if @homework.allow_late %>
|
||||
<p>允许补交,则在结束日期之前,学生可以补交作品 <br/>
|
||||
但是在提交截止时间之后才提交作品的学生,将被扣迟交分
|
||||
</p>
|
||||
<% else %>
|
||||
<p>禁止补交,则在提交截止时间之后,学生不能再提交作品
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="<%= @homework.allow_late ? '' : 'none' %>">
|
||||
<li class="clearfix mb15">
|
||||
<label class="panel-form-label fl mr10">截止时间</label>
|
||||
<input type="text" value="<%=format_time @homework.late_time %>" id="show_late_time" disabled class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="选择补交截止时间" />
|
||||
</li>
|
||||
<ul>
|
||||
<li class="clearfix mb15">
|
||||
<label class="panel-form-label fl mr10">迟交扣分</label>
|
||||
<input type="text" value="<%= @homework.late_penalty %>" disabled class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="5" />
|
||||
|
|
@ -44,11 +41,5 @@
|
|||
hideModal();
|
||||
$('#show_late_setting').show();
|
||||
$('#edit_late_setting').html("<%= j(render :partial => 'edit_late_setting') %>").hide();
|
||||
$("input[name='homework_late_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,8 +1,2 @@
|
|||
$("#show_late_setting").html("<%= j(render :partial => 'show_late_setting') %>").show();
|
||||
$("#edit_late_setting").html("<%= j(render :partial => 'edit_late_setting') %>").hide();
|
||||
$("input[name='homework_late_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("#edit_late_setting").html("<%= j(render :partial => 'edit_late_setting') %>").hide();
|
||||
|
|
@ -24,7 +24,13 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% homework_curr_status = homework_curr_time(activity) %>
|
||||
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
|
||||
<% if homework_curr_status[:status] != "" %>
|
||||
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
|
||||
<% end %>
|
||||
<% if activity.homework_detail_manual.try(:comment_status) != 0 && activity.homework_detail_manual.try(:comment_status) != 6 %>
|
||||
<% allow_late = activity.allow_late ? '已开启补交' : '未开启补交' %>
|
||||
<span class="edu-filter-btn <%= homework_status_color allow_late %> ml10 fl mt3"><%= allow_late %></span>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="">
|
||||
<%= user_for_homework_common activity,is_teacher,work %>
|
||||
</div>
|
||||
<% if !is_teacher && work && work.work_status != 0 && work.user == User.current && activity.allow_late && activity.homework_detail_manual.comment_status > 1 %>
|
||||
<% if activity.allow_late && activity.end_time < Time.now && (activity.homework_type == 1 || activity.homework_type == 3) && work && work.work_status != 0 && work.user == User.current && !is_teacher %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
class ModifyHomeworkColumn < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :homework_commons, :allow_late, :boolean, :default => 1
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
|
|
@ -43,13 +43,13 @@ namespace :homework_publishtime do
|
|||
end
|
||||
|
||||
task :end => :environment do
|
||||
Rails.logger.info("log--------------------------------homework_publish_end start")
|
||||
homework_commons = HomeworkCommon.includes(:homework_detail_manual).where("end_time <= '#{Time.now}' and allow_late = 1 and homework_detail_manuals.comment_status = 1")
|
||||
homework_commons.each do |homework|
|
||||
homework_detail_manual = homework.homework_detail_manual
|
||||
homework_detail_manual.update_column('comment_status', 2)
|
||||
end
|
||||
Rails.logger.info("log--------------------------------homework_publish_end end")
|
||||
# Rails.logger.info("log--------------------------------homework_publish_end start")
|
||||
# homework_commons = HomeworkCommon.includes(:homework_detail_manual).where("end_time <= '#{Time.now}' and allow_late = 1 and homework_detail_manuals.comment_status = 1")
|
||||
# homework_commons.each do |homework|
|
||||
# homework_detail_manual = homework.homework_detail_manual
|
||||
# homework_detail_manual.update_column('comment_status', 2)
|
||||
# end
|
||||
# Rails.logger.info("log--------------------------------homework_publish_end end")
|
||||
end
|
||||
|
||||
task :archive => :environment do
|
||||
|
|
|
|||
|
|
@ -133,14 +133,12 @@ $(function(){
|
|||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false,
|
||||
onSelectDate:function() {
|
||||
$("#reset_publish_time").show();
|
||||
if($.trim($("input[name='homework_archive_time']").val()) == ""){
|
||||
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
|
||||
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
|
||||
}
|
||||
},
|
||||
onSelectTime:function() {
|
||||
$("#reset_publish_time").show();
|
||||
if($.trim($("input[name='homework_archive_time']").val()) == ""){
|
||||
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
|
||||
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
|
||||
|
|
@ -152,13 +150,7 @@ $(function(){
|
|||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false,
|
||||
onSelectDate:function() {
|
||||
$("#reset_end_time").show();
|
||||
},
|
||||
onSelectTime:function() {
|
||||
$("#reset_end_time").show();
|
||||
}
|
||||
validateOnBlur:false
|
||||
});
|
||||
|
||||
$("input[name='homework_archive_time']").datetimepicker({
|
||||
|
|
@ -168,15 +160,15 @@ $(function(){
|
|||
validateOnBlur:false
|
||||
});
|
||||
|
||||
$("#reset_publish_time").live('click', function(){
|
||||
$("input[name='homework_publish_time']").val("");
|
||||
$("#reset_publish_time").hide();
|
||||
});
|
||||
// $("#reset_publish_time").live('click', function(){
|
||||
// $("input[name='homework_publish_time']").val("");
|
||||
// $("#reset_publish_time").hide();
|
||||
// });
|
||||
|
||||
$("#reset_end_time").live('click', function(){
|
||||
$("input[name='homework_end_time']").val("");
|
||||
$("#reset_end_time").hide();
|
||||
});
|
||||
// $("#reset_end_time").live('click', function(){
|
||||
// $("input[name='homework_end_time']").val("");
|
||||
// $("#reset_end_time").hide();
|
||||
// });
|
||||
|
||||
$("#publish_setting_form_submit").live('click', function(){
|
||||
var myDate = new Date();
|
||||
|
|
@ -223,15 +215,6 @@ $(function(){
|
|||
} else{
|
||||
$("#homework_archive_time_notice").hide();
|
||||
}
|
||||
} else if($.trim($("#show_late_time").val()) != ""){
|
||||
var end_time = Date.parse($("#show_late_time").val());
|
||||
var archive_time = Date.parse($("input[name='homework_archive_time']").val());
|
||||
if(archive_time <= end_time){
|
||||
$("#homework_archive_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>作业结束时间应晚于匿评结束时间").show();
|
||||
result = false;
|
||||
} else{
|
||||
$("#homework_archive_time_notice").hide();
|
||||
}
|
||||
} else if($.trim($("#show_evaluation_end").val()) != ""){
|
||||
var end_time = Date.parse($("#show_evaluation_end").val());
|
||||
var archive_time = Date.parse($("input[name='homework_archive_time']").val());
|
||||
|
|
@ -267,60 +250,19 @@ $(function(){
|
|||
}
|
||||
});
|
||||
|
||||
$("input[name='homework_late_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
|
||||
$("#edit_allow_late_1").live('click', function(){
|
||||
$("#late_relate_setting_ul").show();
|
||||
var my_date = new Date();
|
||||
var date = new Date(Date.parse($("#show_end_time").val().replace(/-/g, "/")));
|
||||
if(my_date > date){
|
||||
$("input[name='homework_late_time']").val(formate_time(new Date(my_date.setDate(my_date.getDate()+3))));
|
||||
} else{
|
||||
$("input[name='homework_late_time']").val(formate_time(new Date(date.setDate(date.getDate()+3))));
|
||||
}
|
||||
$("#edit_late_notice").html("允许补交,则在结束日期之前,学生可以补交作品 <br/>是在提交截止时间之后才提交作品的学生,将被扣迟交分");
|
||||
$("input[name='homework_late_penalty']").val("5");
|
||||
});
|
||||
|
||||
$("#edit_allow_late_0").live('click', function(){
|
||||
$("#late_relate_setting_ul").hide();
|
||||
$("input[name='homework_late_time']").val("");
|
||||
$("#edit_late_notice").html("禁止补交,则在提交截止时间之后,学生不能再提交作品");
|
||||
$("input[name='homework_late_penalty']").val("0");
|
||||
});
|
||||
|
||||
$("#late_setting_form_submit").live('click', function(){
|
||||
var result = true;
|
||||
if($("input[name='homework_allow_late']:checked").val() == '1'){
|
||||
if($.trim($("input[name='homework_late_time']").val()) == ""){
|
||||
$("#homework_late_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>补交截止时间不能为空").show();
|
||||
result = false;
|
||||
} else{
|
||||
var end_time = Date.parse($("#show_end_time").val());
|
||||
var archive_time = Date.parse($("#show_archive_time").val());
|
||||
var late_time = Date.parse($("input[name='homework_late_time']").val());
|
||||
if(late_time <= end_time){
|
||||
$("#homework_late_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>补交截止时间应晚于提交截止时间").show();
|
||||
result = false;
|
||||
} else if(archive_time <= late_time){
|
||||
$("#homework_late_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>补交截止时间应早于作业结束时间").show();
|
||||
result = false;
|
||||
} else if($.trim($("#show_evaluation_start").val()) != ""){
|
||||
var end_time = Date.parse($("#show_evaluation_start").val());
|
||||
var late_time = Date.parse($("input[name='homework_late_time']").val());
|
||||
if(late_time > end_time){
|
||||
$("#homework_late_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>补交截止时间应早于匿评开始时间").show();
|
||||
result = false;
|
||||
} else{
|
||||
$("#homework_late_time_notice").hide();
|
||||
}
|
||||
} else{
|
||||
$("#homework_late_time_notice").hide();
|
||||
}
|
||||
}
|
||||
if($.trim($("input[name='homework_late_penalty']").val()) == ""){
|
||||
result = false;
|
||||
$("#homework_late_penalty_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>迟交扣分不能为空").show();
|
||||
|
|
@ -378,8 +320,7 @@ $(function(){
|
|||
$("#anon_relate_setting_ul").show();
|
||||
var my_date = new Date();
|
||||
var end_date = new Date(Date.parse($("#show_end_time").val().replace(/-/g, "/")));
|
||||
var late_date = $("#show_late_time").val() == "" ? end_date : (new Date(Date.parse($("#show_late_time").val().replace(/-/g, "/"))));
|
||||
var max_date = my_date > end_date ? (my_date > late_date ? my_date : late_date) : (end_date > late_date ? end_date : late_date);
|
||||
var max_date = my_date > end_date ? my_date : end_date;
|
||||
$("input[name='homework_evaluation_start']").val(formate_time(new Date(max_date.setDate(max_date.getDate()+7))));
|
||||
$("input[name='homework_evaluation_end']").val(formate_time(new Date(max_date.setDate(max_date.getDate()+14))));
|
||||
$("input[name='homework_evaluation_num']").val("3");
|
||||
|
|
@ -426,18 +367,10 @@ $(function(){
|
|||
result = false;
|
||||
} else{
|
||||
var end_time = Date.parse($("#show_end_time").val());
|
||||
var late_time = Date.parse($("#show_late_time").val());
|
||||
var archive_time = Date.parse($("#show_archive_time").val());
|
||||
var eva_start = Date.parse($("input[name='homework_evaluation_start']").val());
|
||||
var eva_end = Date.parse($("input[name='homework_evaluation_end']").val());
|
||||
if($("#show_late_time").val() != ""){
|
||||
if(eva_start <= late_time){
|
||||
$("#homework_evaluation_start_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>匿评开始时间应晚于补交截止时间").show();
|
||||
result = false;
|
||||
} else{
|
||||
$("#homework_evaluation_start_notice").hide();
|
||||
}
|
||||
} else if(eva_start <= end_time){
|
||||
if(eva_start <= end_time){
|
||||
$("#homework_evaluation_start_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>匿评开始时间应晚于提交截止时间").show();
|
||||
result = false;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -207,6 +207,8 @@ a:hover.edu-filter-cir-grey,a.edu-filter-cir-grey.active{ border:1px solid #3498
|
|||
.edu-filter-btn-green{background:#e4f3ec; color:#6fbb9d;}
|
||||
.edu-filter-btn-yellow{background:#fdefde; color:#ef9324;}
|
||||
.edu-filter-btn-danger{background:#d72e36; color:#fff;}
|
||||
.edu-filter-btn-late{background: rgba(186, 205, 215, 0.35); color: #3fbcff;}
|
||||
.edu-filter-btn-no-late{background: rgba(186, 205, 215, 0.35); color: #8c8c8c;}
|
||||
.eud-pointer{ cursor:pointer;}
|
||||
.edu-bg-grey{ background:#f6f6f6; width:90%; min-width:700px; color:#666;}
|
||||
/* table */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
.magic-radio + label:before,
|
||||
.magic-checkbox + label:before {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
top: 5px;
|
||||
left: 0;
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
|
|
|
|||
Loading…
Reference in New Issue