From 0090c89dd170e5f077726dd1b1c19e40e29adb16 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Mar 2016 10:53:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/schema.rb b/db/schema.rb index a7ffc23b1..76dd8e19c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1387,6 +1387,7 @@ ActiveRecord::Schema.define(:version => 20160304234903) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 + t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end From cff5e9171f606bdbb7fdf99a9d55513b2739a101 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Mar 2016 11:21:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=90=8E=E9=A1=B5=E9=9D=A2=E4=B8=8D=E5=BA=94=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E8=A2=AB=E5=AF=BC=E5=85=A5=E7=9A=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1d328c1e9..61f6118ad 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -764,8 +764,8 @@ class UsersController < ApplicationController homework_detail_programing.save if homework_detail_programing homework_detail_group.save if homework_detail_group if params[:quotes] && !params[:quotes].blank? - homework = HomeworkCommon.find params[:quotes].to_i - homework.update_attribute(:quotes, homework.quotes+1) + quotes_homework = HomeworkCommon.find params[:quotes].to_i + quotes_homework.update_attribute(:quotes, quotes_homework.quotes+1) end if params[:is_in_course] == "1" redirect_to homework_common_index_path(:course => homework.course_id) From fcae91ecc1d2a1ffe2f050234821f1f7b66a769d Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Mar 2016 11:27:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E2=80=9C=E8=AF=BE=E7=A8=8B=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E2=80=9D=E6=94=B9=E4=B8=BA=E2=80=9C=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_tool_expand.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index aedeec5ef..52a971826 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -8,7 +8,7 @@ <% end %> <% if show_nav?(@course.news.count) %> <% end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 14ed8a93b..2a44f2980 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -85,7 +85,7 @@ <% end %> <% unless show_nav?(@course.news.count) %> From e30c26aa09d556aa878bade562b0410c48e0dea7 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Mar 2016 13:56:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_course_homework.html.erb | 2 +- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_user_homework_detail.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 51cede682..0e056c972 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -158,7 +158,7 @@ <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> -

分数:<%=format("%.1f",score<0 ? 0 : score) %>分

+

分数:<%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分

<% if i == 4 %> <% break %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 7c5aa5e4f..d42dc152d 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -157,7 +157,7 @@ <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> -

分数:<%=format("%.1f",score<0 ? 0 : score) %>分

+

分数:<%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分

<% if i == 4 %> <% break %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 8329e8432..0c2856c89 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -161,7 +161,7 @@ <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> -

分数:<%=format("%.1f",score<0 ? 0 : score) %>分

+

分数:<%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分

<% if i == 4 %> <% break %>