测试集解锁功能

dev_forum
daiao 6 years ago
parent a58bd2552a
commit bab042a7a5

@ -270,6 +270,7 @@ class GamesController < ApplicationController
if @game.status == 2
@game.update_attributes!(:answer_open => @answer.level)
else
# 扣除总分计算
answer_deduction = challenge.challenge_answers.where("level <= #{@answer.level}").sum(:score)
@game.update_attributes!(:answer_open => @answer.level, :answer_deduction => answer_deduction)
end

@ -117,6 +117,7 @@ Rails.application.routes.draw do
get :close_webssh
get :get_answer_info
get :unlock_answer
get :check_test_sets
end
collection do

Loading…
Cancel
Save