From 5adf0bab22948a16df122f8abb0776812633ca44 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 23 Jul 2019 16:52:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E8=AF=84?= =?UTF-8?q?=E6=B5=8B=E6=89=BE=E4=B8=8D=E5=88=B0git=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index e6a592f51..58d7cc9c9 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -556,10 +556,18 @@ class GamesController < ApplicationController msg = @game.run_code_message msg.update_attributes(:status => 0, :message => nil) if msg.present? - # 更新时间是为了TPM端显示的更新,退出实训及访问实训的时候会更新 - @myshixun.update_column(:updated_at, Time.now) - + # 更新时间是为了TPM端显示的更新,退出实训及访问实训的时候会更新,如果版本库地址不存在,重新去版本库中找 + myshixuns_update = + if @myshixun.repo_name.nil? + g = Gitlab.client + repo_name = g.project(@myshixun.gpid).path_with_namespace + {repo_name: repo_name} + else + {updated_at: Time.now} + end + @myshixun.update_attributes!(myshixuns_update) gitUrl = repo_ip_url @myshixun.repo_path + logger.info("#############giturl: ##{gitUrl}") gitUrl = Base64.urlsafe_encode64(gitUrl) From 6545cc57f3b2be45f0b8a184a6eedec38a160df5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 23 Jul 2019 16:54:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 58d7cc9c9..1187ebafa 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -565,6 +565,7 @@ class GamesController < ApplicationController else {updated_at: Time.now} end + logger.info("#############myshixuns_update: ##{myshixuns_update}") @myshixun.update_attributes!(myshixuns_update) gitUrl = repo_ip_url @myshixun.repo_path From fc2c4e9cde1309d37ae03f871a6e7199708e3f38 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 17:17:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/new/SingleDisplay.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index 453cce229..4018fcbbe 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -54,7 +54,7 @@ class SingleDisplay extends Component{ } render() { let { question_title, question_score, question_type, question_choices, standard_answer, - question_id, question_number, index, displayCount + question_id, question_number, index, displayCount, showActionButton } = this.props; // const { getFieldDecorator } = this.props.form; @@ -70,6 +70,9 @@ class SingleDisplay extends Component{ // const answerTagArray = standard_answer.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1); let length = 5; const qName = qNameArray[question_type] + + const isPreviewPage = showActionButton == false + return(