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) 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) %> 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 %>