Merge branches 'dev_aliyun' and 'dev_item_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

yslnewtiku
杨树林 5 years ago
commit 1bc2cef4ff

@ -166,12 +166,12 @@ class HackUserLastestCodesController < ApplicationController
# 通关
if submit_params[:status] == "0"
# 编程题已经发布,且之前未通关奖励积分
@hack.increment!(:pass_num)
if @hack.status == 1 && !@my_hack.passed?
reward_attrs = { container_id: game.id, container_type: 'Hack', score: @hack.score }
RewardGradeService.call(@my_hack.user, reward_attrs)
RewardExperienceService.call(@my_hack.user, reward_attrs)
# 评测完成更新通过数
@hack.increment!(:pass_num)
@my_hack.update_attributes(passed: true, passed_time: Time.now)
end
end

@ -31,6 +31,9 @@ module GradeDecorator
when 'check_ta_answer' then
game = Game.find_by(id: container_id)
game.present? ? "查看实训“#{game.challenge.shixun.name}”第#{game.challenge.position}关的TA人解答消耗的金币" : ''
when 'hack' then
hack = Hack.find_by(id: container_id)
game.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : ''
end
end
end

@ -1338,7 +1338,7 @@ class TPMBanner extends Component {
</Radio>
{this.state.Radiovalue === 4 ?
<TextArea className={this.state.TextAreaintshow===true?"bor-red mt10":"mt10"}
placeholder="请填写fork原因60字以内"
placeholder="请填写fork原因60字以内)"
value={this.state.TextArea}
rows={4} style={{ width: '85%', marginLeft: '30px' }} onInput={this.changeTextArea}
maxlength={60}

Loading…
Cancel
Save