选择题评测问题

dev_course
daiao 6 years ago
parent 28dbdd03ee
commit 4264679c7b

@ -613,13 +613,10 @@ class GamesController < ApplicationController
end end
# 批量插入评测结果 # 批量插入评测结果
uid_logger("choose_build") uid_logger("#------------chooice score: #{score}")
sql = "INSERT INTO outputs (game_id, test_set_position, actual_output, result, query_index, created_at, updated_at) VALUES" + str sql = "INSERT INTO outputs (game_id, test_set_position, actual_output, result, query_index, created_at, updated_at) VALUES" + str
ActiveRecord::Base.connection.execute sql ActiveRecord::Base.connection.execute sql
had_done = @game.had_done
@myshixun.update_attribute(:status, 1) if had_done == 1
# 没通关或者查看了答案通关的时候经验为0 # 没通关或者查看了答案通关的时候经验为0
# 通关但是查看了答案评测的时候金币显示0避免用户以为重复扣除但是在关卡列表中金币显示负数 # 通关但是查看了答案评测的时候金币显示0避免用户以为重复扣除但是在关卡列表中金币显示负数
experience = 0 experience = 0
@ -638,6 +635,8 @@ class GamesController < ApplicationController
final_score = score final_score = score
RewardExperienceService.call(@myshixun.owner, reward_attrs) RewardExperienceService.call(@myshixun.owner, reward_attrs)
end end
had_done = @game.had_done
@myshixun.update_attribute(:status, 1) if had_done == 1
end end
grade = @myshixun.owner.try(:grade) grade = @myshixun.owner.try(:grade)

Loading…
Cancel
Save