From 6a5b79cf6dbcb543cf206dcea3994331f7a9fcdf Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 31 Mar 2016 09:44:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=9A=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=A1=B5=E9=9D=A2=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/homework.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/admin/homework.html.erb b/app/views/admin/homework.html.erb index 7260d68ff..331806293 100644 --- a/app/views/admin/homework.html.erb +++ b/app/views/admin/homework.html.erb @@ -29,6 +29,7 @@ <%@count=@page*30 %> <% for homework in @homework do %> + <% unless homework.nil? %> <% @count+=1 %> @@ -54,6 +55,7 @@ <%=format_date(homework.end_time) %> + <% end %> <% end %> From 6a8a82e85af36fec491d847a1e4382e333f32001 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 5 Apr 2016 11:23:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=91=A8=E6=B5=B7?= =?UTF-8?q?=E8=8A=B3=E8=80=81=E5=B8=882882=E4=BD=9C=E4=B8=9A=E7=9A=84?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=8C=BF=E8=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160405021915_delete_anonymous_work.rb | 19 +++++++++++++++++++ db/schema.rb | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160405021915_delete_anonymous_work.rb diff --git a/db/migrate/20160405021915_delete_anonymous_work.rb b/db/migrate/20160405021915_delete_anonymous_work.rb new file mode 100644 index 000000000..1677b248a --- /dev/null +++ b/db/migrate/20160405021915_delete_anonymous_work.rb @@ -0,0 +1,19 @@ +class DeleteAnonymousWork < ActiveRecord::Migration + def up + student_works = StudentWork.where("homework_common_id = 2882").map{|work| work.id} unless StudentWork.where("homework_common_id = 2882").empty? + student_work_ids = "(" + student_works.join(",") + ")" + student_work_scores = StudentWorksScore.where("student_work_id in #{student_work_ids}") + unless student_work_scores.empty? + student_work_scores.each do |sscore| + student_work = StudentWork.find sscore.student_work_id + student_work.student_score = 0 unless student_work.nil? + student_work.absence_penalty = 0 + sscore.destroy + student_work.save + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 8041b347b..d6c454cb0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160328022623) do +ActiveRecord::Schema.define(:version => 20160405021915) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1289,6 +1289,7 @@ ActiveRecord::Schema.define(:version => 20160328022623) do t.datetime "updated_at", :null => false t.string "field_type" t.integer "hide", :default => 0 + t.integer "status", :default => 1 end create_table "organizations", :force => true do |t| From c3ee4dadfb92c75e8649cad7e0ed57c2ec02ec00 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 5 Apr 2016 11:24:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=A1=86=E7=9A=84=E9=AB=98=E5=BA=A6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_work_edit_information.html.erb | 4 ++-- app/views/student_work/_work_information.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/student_work/_work_edit_information.html.erb b/app/views/student_work/_work_edit_information.html.erb index 38e7e7c7e..057d305d5 100644 --- a/app/views/student_work/_work_edit_information.html.erb +++ b/app/views/student_work/_work_edit_information.html.erb @@ -4,9 +4,9 @@

作品名称:<%=@student_work.name%>

-
+
作品描述:
-
<%=@student_work.description.html_safe %>
+
<%=@student_work.description.html_safe %>

diff --git a/app/views/student_work/_work_information.html.erb b/app/views/student_work/_work_information.html.erb index 88684263a..1ced6c84c 100644 --- a/app/views/student_work/_work_information.html.erb +++ b/app/views/student_work/_work_information.html.erb @@ -4,9 +4,9 @@

作品名称:<%=@student_work.name%>

-
+
作品描述:
-
<%=@student_work.description.html_safe %>
+
<%=@student_work.description.html_safe %>