Merge branch 'educoder' of http://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into educoder

dev_SaaS
jingquan huang 6 years ago
commit c8e7166d02

@ -510,7 +510,7 @@ class MyshixunsController < ApplicationController
challenge.path.split("").each do |path| challenge.path.split("").each do |path|
game_passed_code(game.id, path, myshixun.try(:gpid), 1) game_passed_code(game.id, path, myshixun.try(:gpid), 1)
end end
if !game.answer_open == 1 && (challenge.shixun.try(:status) > 1) # 如果没有查看答案,则获得该关卡得分 if game.answer_open == 0 && (challenge.shixun.try(:status) > 1) # 如果没有查看答案,则获得该关卡得分
reward_grade(game.user, game.id, 'Game', challenge.score) reward_grade(game.user, game.id, 'Game', challenge.score)
reward_experience(game.user, game.id, 'Game', challenge.score) reward_experience(game.user, game.id, 'Game', challenge.score)
game.update_attributes!(:final_score => challenge.score) game.update_attributes!(:final_score => challenge.score)

@ -796,7 +796,7 @@ class GamesService
if game_status == 2 # 通关 if game_status == 2 # 通关
if shixun.status > 1 if shixun.status > 1
score = game.final_score # 查看答案的时候有对最终获得金币进行处理 score = game.final_score # 查看答案的时候有对最终获得金币进行处理
experience = game.answer_open ? 0 : game_challenge.score.to_i experience = game.answer_open > 0 ? 0 : game_challenge.score.to_i
else else
score = 0 score = 0
experience = 0 experience = 0

Loading…
Cancel
Save