实训作业得分bug

This commit is contained in:
cxt 2017-10-13 19:31:14 +08:00
parent 3f027ea05c
commit 7ff96b64ad
2 changed files with 6 additions and 6 deletions

View File

@ -335,11 +335,11 @@ class HomeworkCommonController < ApplicationController
if @homework.homework_type == 4
if @homework_detail_manual.answer_open_evaluation != params[:answer_open_evaluation].to_i
@homework_detail_manual.answer_open_evaluation = params[:answer_open_evaluation].to_i
# if @homework.end_time < Time.now
# @homework.student_works.each do |student_work|
# set_shixun_final_score @homework, student_work, @homework_detail_manual.answer_open_evaluation
# end
# end
if @homework.end_time < Time.now
@homework.student_works.each do |student_work|
set_shixun_final_score @homework, student_work, @homework_detail_manual.answer_open_evaluation
end
end
end
@homework.score_open = params[:homework_score_open] ? 1 : 0
else

View File

@ -14,7 +14,7 @@ namespace :homework_publishtime do
if myshixun.nil?
0
else
myshixun.games.select{|game| game.status == 2 && game.answer_open == 0}.count
myshixun.games.select{|game| game.status == 2 && !game.answer_open}.count
end
end