From ca7de7fbf3eb31a662b1692c593cc4932bb1f391 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 19:20:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 4 ---- app/views/challenges/show.json.jbuilder | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) 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/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) From e5faa5e2783965be016b3ca339a659f297179218 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 19:30:15 +0800 Subject: [PATCH 2/2] 1 --- app/views/challenges/edit.json.jbuilder | 4 +++- app/views/challenges/edit_choose_question.json.jbuilder | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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)