diff --git a/app/views/admin/homework.html.erb b/app/views/admin/homework.html.erb index a3a64b316..03472d0a0 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 %> @@ -56,6 +57,7 @@ <%=format_date( homework.created_at ) %> + <% end %> <% end %> 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 %>

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 a3fb50eca..4e4201050 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,11 @@ # # It's strongly recommended to check this file into your version control system. +<<<<<<< HEAD ActiveRecord::Schema.define(:version => 20160331063938) do +======= +ActiveRecord::Schema.define(:version => 20160405021915) do +>>>>>>> c3ee4dadfb92c75e8649cad7e0ed57c2ec02ec00 create_table "activities", :force => true do |t| t.integer "act_id", :null => false