diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index a5cb1ece3..938d42c2f 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -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] diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 992bd87f8..bb475abcd 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -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}") diff --git a/app/decorators/grade_decorator.rb b/app/decorators/grade_decorator.rb index b89cd99ce..5e2b9deed 100644 --- a/app/decorators/grade_decorator.rb +++ b/app/decorators/grade_decorator.rb @@ -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 \ No newline at end of file diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 8e0c402dd..318167d92 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -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 diff --git a/app/views/challenges/edit.json.jbuilder b/app/views/challenges/edit.json.jbuilder index 3e7f5b425..c0ea68d9c 100644 --- a/app/views/challenges/edit.json.jbuilder +++ b/app/views/challenges/edit.json.jbuilder @@ -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 # 评测设置的编辑模式 diff --git a/app/views/challenges/edit_choose_question.json.jbuilder b/app/views/challenges/edit_choose_question.json.jbuilder index 663f27d7f..0405c0598 100644 --- a/app/views/challenges/edit_choose_question.json.jbuilder +++ b/app/views/challenges/edit_choose_question.json.jbuilder @@ -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) diff --git a/app/views/challenges/show.json.jbuilder b/app/views/challenges/show.json.jbuilder index cffe77ebb..fb86683b4 100644 --- a/app/views/challenges/show.json.jbuilder +++ b/app/views/challenges/show.json.jbuilder @@ -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) diff --git a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder index 8f72014fe..66eedf85e 100644 --- a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder +++ b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder @@ -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 \ No newline at end of file +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 diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index cdde0f97f..1117786c0 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -108,7 +108,7 @@ Issue_end: "赞了你发布的项目Issue:%s" Journal_end: "赞了你的回复%s" Discuss: - Shixun: + Challenge: true_end: "评论了你的回复:%s" false_end: "评论了你发布的实训:%s" Hack: