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

chromesetting
杨树明 5 years ago
commit ed837b1f66

@ -10,9 +10,6 @@ class GamesController < ApplicationController
include GamesHelper
include ApplicationHelper
def show
uid_logger("--games show start")
# 防止评测中途ajaxE被取消;3改成0是为了处理首次进入下一关的问题
@ -91,7 +88,6 @@ class GamesController < ApplicationController
end
end
def jupyter
# Jupyter没有challenge
@myshixun = Myshixun.find_by_identifier params[:identifier]

@ -467,7 +467,13 @@ class ShixunsController < ApplicationController
def update_learn_setting
begin
ActiveRecord::Base.transaction do
@shixun.update_attributes!(shixun_params)
update_params =
if params[:shixun][:vnc]
shixun_params.merge(vnc_evaluate: 1)
else
shixun_params
end
@shixun.update_attributes!(update_params)
end
rescue => e
uid_logger_error("实训学习页面设置失败--------#{e.message}")

@ -33,7 +33,7 @@ module GradeDecorator
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}" : ''
hack.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : ''
end
end
end

@ -226,7 +226,7 @@ module TidingDecorator
end
def discuss_content
I18n.t(locale_format(container_type, container.parent_id.present?)) % message_content_helper(container.content)
I18n.t(locale_format(parent_container_type, container.parent_id.present?)) % message_content_helper(container.content)
end
def grade_content

@ -5,9 +5,11 @@ json.chooses do
json.type choose.category
end
end
json.st @challenge.st
if @tab == 0
# 本关任务tab的编辑模式
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time)
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time, :st)
json.tags @challenge.challenge_tags.map(&:name)
elsif @tab == 1
# 评测设置的编辑模式

@ -1,7 +1,7 @@
json.(@challenge_choose, :challenge_id, :subject, :answer,
:standard_answer, :score, :difficult,
:position, :category)
json.st @challenge.st
# 选项的参数
json.choose_contents @challenge_choose.challenge_questions do |question|
json.(question, :option_name, :position, :right_key)

@ -1,6 +1,6 @@
# 导航栏公共数据
json.partial! "challenges/top_common_data", shixun_identifier: @shixun.identifier
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time)
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time, :st)
json.tags @challenge.challenge_tags.map(&:name)

@ -1,8 +1,12 @@
json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output,
:input, :output, :execute_time, :execute_memory, :created_at, :code)
json.language @hack_user.hack.language
json.name @hack_user.hack.name
json.myproblem_identifier @my_hack.identifier
json.user do
json.partial! 'users/user', user: current_user
end
json.status 0
json.message "返回成功"
json.data do
json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output,
:input, :output, :execute_time, :execute_memory, :created_at, :code)
json.language @hack_user.hack.language
json.name @hack_user.hack.name
json.myproblem_identifier @my_hack.identifier
json.user do
json.partial! 'users/user', user: current_user
end
end

@ -108,7 +108,7 @@
Issue_end: "赞了你发布的项目Issue%s"
Journal_end: "赞了你的回复%s"
Discuss:
Shixun:
Challenge:
true_end: "评论了你的回复:%s"
false_end: "评论了你发布的实训:%s"
Hack:

Loading…
Cancel
Save