From cc441826ee7b4740970298c92adc52b0d14f1038 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 10 Mar 2016 11:15:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81=E5=8D=B3?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=BE=97=E5=88=86=E4=B8=BA=E5=BD=93=E6=AC=A1=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 8 ++++++++ app/views/student_work/_evaluation_un_work.html.erb | 4 ++-- app/views/student_work/_evaluation_work.html.erb | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 1d4611e81..e297bc3cd 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -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 diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index bf022f64c..8ed5f077b 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -15,10 +15,10 @@
  • <% if @homework.homework_type != 3 %> diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index cc346361e..f97a8dd2d 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -21,10 +21,10 @@
  • <% if @homework.homework_type != 3 %>