|
|
|
@ -36,6 +36,14 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
unless student_work.save
|
|
|
|
|
resultObj[:status] = 200
|
|
|
|
|
else
|
|
|
|
|
student_work.name = params[:title]
|
|
|
|
|
student_work.description = params[:src]
|
|
|
|
|
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
|
|
|
|
student_work.late_penalty = @homework.late_penalty
|
|
|
|
|
else
|
|
|
|
|
student_work.late_penalty = 0
|
|
|
|
|
end
|
|
|
|
|
student_work.save
|
|
|
|
|
resultObj[:status] = result["status"].to_i
|
|
|
|
|
resultObj[:time] = student_work_test.created_at.to_s(:db)
|
|
|
|
|
resultObj[:index] = student_work.student_work_tests.count
|
|
|
|
|