迟交扣分记录
This commit is contained in:
parent
acc3f6dadf
commit
08c9d5a498
|
@ -73,6 +73,11 @@ class StudentWorkController < ApplicationController
|
|||
stundet_work.homework_common_id = @homework.id
|
||||
stundet_work.user_id = User.current.id
|
||||
stundet_work.save_attachments(params[:attachments])
|
||||
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||
stundet_work.late_penalty = @homework.late_penalty
|
||||
else
|
||||
stundet_work.late_penalty = 0
|
||||
end
|
||||
render_attachment_warning_if_needed(stundet_work)
|
||||
if stundet_work.save
|
||||
respond_to do |format|
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20150630031857) do
|
||||
ActiveRecord::Schema.define(:version => 20150702073308) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -1231,6 +1231,8 @@ ActiveRecord::Schema.define(:version => 20150630031857) do
|
|||
t.integer "project_id", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "late_penalty", :default => 0
|
||||
t.integer "absence_penalty", :default => 0
|
||||
end
|
||||
|
||||
create_table "student_works_evaluation_distributions", :force => true do |t|
|
||||
|
|
Loading…
Reference in New Issue