|
|
|
@ -316,10 +316,13 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
compelete_status = 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if setting_time.end_time > Time.now
|
|
|
|
|
work.update_attributes(:work_status => 1, :late_penalty => 0, :commit_time => myshixun.updated_at, :update_time => myshixun.updated_at, :myshixun_id => myshixun.id, :compelete_status => compelete_status)
|
|
|
|
|
else
|
|
|
|
|
work.update_attributes(:work_status => ((myshixun.is_complete? && (myshixun.done_time < setting_time.end_time)) ? 1 : 2), :late_penalty => (myshixun.is_complete? && (myshixun.done_time < setting_time.end_time) ? 0 : homework.late_penalty), :commit_time => myshixun.updated_at, :update_time => myshixun.updated_at, :myshixun_id => myshixun.id, :compelete_status => compelete_status)
|
|
|
|
|
games.each do |game|
|
|
|
|
|
unless game.nil?
|
|
|
|
|
pass_consume_time += (game.cost_time / 60.0).to_f
|
|
|
|
|
user_total_score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i
|
|
|
|
|
adjust_score = work.challenge_work_scores.where(:challenge_id => setting.challenge_id).last
|
|
|
|
|
final_score += adjust_score.present? ? adjust_score.score : (homework.homework_detail_manual.answer_open_evaluation ? setting.score : (game.final_score > 0 ? game.real_score(setting.score) : 0))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|