Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_hs
杨树明 6 years ago
commit 3d9bcb3029

@ -361,13 +361,15 @@ class ExerciseQuestionsController < ApplicationController
if ex_users_committed.size > 0
ex_users_committed.each do |ex_user|
update_objective_score = update_single_score(@exercise_question,ex_user.user_id,standard_answer)
Rails.logger.info("#####_________update_objective_score___________##############{update_objective_score}")
if update_objective_score != 0
objective_score = ex_user.objective_score
subjective_score = ex_user.subjective_score
total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score
total_score = objective_score + update_objective_score + total_score_subjective_score
ex_user.update_attributes(objective_score:objective_score,score:total_score)
new_objective_score = objective_score + update_objective_score
total_score = ex_user.score + update_objective_score
total_score = total_score < 0.0 ? 0.0 : total_score
ex_user.update_attributes(objective_score:new_objective_score,score:total_score)
end
Rails.logger.info("#####_________ex_user.score___________##############{ex_user.score}")
# user = ex_user.user
# objective_score = calculate_student_score(@exercise,user)[:total_score]
end

Loading…
Cancel
Save