diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 297ee6551..762ac0d2b 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -310,9 +310,9 @@ class HomeworkCommonController < ApplicationController @cur_size = @homework.student_works.where("work_status != 0").size @work_size = @homework.student_works.has_committed.size elsif @homework_detail_manual.comment_status == 2 - @homework.student_works.where("work_status != 0").map { |work| @totle_size += work.student_works_evaluation_distributions.count} + @homework.student_works.has_committed.map { |work| @totle_size += work.student_works_evaluation_distributions.count} @cur_size = 0 - @homework.student_works.where("work_status != 0").map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count} + @homework.student_works.has_committed.map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count} end @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @user_activity_id = params[:user_activity_id].to_i diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index ad22cb42c..fbbca9712 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -975,9 +975,9 @@ class StudentWorkController < ApplicationController homework_detail_programing = @homework.homework_detail_programing unless @homework.late_penalty.to_s == params[:late_penalty].to_s - @homework.late_penalty = params[:late_penalty] + @homework.late_penalty = params[:late_penalty].to_s @homework.student_works.where("commit_time > '#{@homework.end_time} 23:59:59'").each do |student_work| - student_work.late_penalty = @homework.late_penalty + student_work.late_penalty = params[:late_penalty].to_i student_work.save end end @@ -1005,6 +1005,8 @@ class StudentWorkController < ApplicationController homework_detail_manual.save if homework_detail_manual homework_detail_programing.save if homework_detail_programing + @homework.save + @homework = HomeworkCommon.find @homework.id @homework.student_works.each do |student_work| set_final_score @homework,student_work student_work.save diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 33ab33a32..c95366835 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1055,7 +1055,7 @@ class UsersController < ApplicationController end homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1 homework.homework_type = params[:homework_type].to_i || 1 - homework.late_penalty = 10 + homework.late_penalty = 0 homework.teacher_priority = 1 homework.user_id = User.current.id homework.course_id = params[:course_id] @@ -1077,7 +1077,7 @@ class UsersController < ApplicationController homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? homework.end_time + 7 : params[:evaluation_start] homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end] homework_detail_manual.evaluation_num = params[:evaluation_num] || 3 - homework_detail_manual.absence_penalty = 5 + homework_detail_manual.absence_penalty = 0 homework.homework_detail_manual = homework_detail_manual #编程作业相关属性 diff --git a/app/views/applied_project/_applied_join_project.html.erb b/app/views/applied_project/_applied_join_project.html.erb index 2e2f657d6..26d1ee915 100644 --- a/app/views/applied_project/_applied_join_project.html.erb +++ b/app/views/applied_project/_applied_join_project.html.erb @@ -1,3 +1,4 @@ +
\ No newline at end of file diff --git a/app/views/attachments/_show_attachment_history.html.erb b/app/views/attachments/_show_attachment_history.html.erb index 9a1a278fc..69d28b681 100644 --- a/app/views/attachments/_show_attachment_history.html.erb +++ b/app/views/attachments/_show_attachment_history.html.erb @@ -1,11 +1,12 @@ + diff --git a/app/views/attachments/_show_attachment_history_delete.html.erb b/app/views/attachments/_show_attachment_history_delete.html.erb index 6a73f057a..85f46ea72 100644 --- a/app/views/attachments/_show_attachment_history_delete.html.erb +++ b/app/views/attachments/_show_attachment_history_delete.html.erb @@ -1,3 +1,4 @@ + - +