From 4255f55f5fca8b0599f004bb0da2f232031a937b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 11 Sep 2019 17:33:04 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=B7=B2=E7=BB=8F=E6=98=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/page/main/CodeRepositoryViewContainer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/page/main/CodeRepositoryViewContainer.js b/public/react/src/modules/page/main/CodeRepositoryViewContainer.js index 5d6be306f..333fa1cd7 100644 --- a/public/react/src/modules/page/main/CodeRepositoryViewContainer.js +++ b/public/react/src/modules/page/main/CodeRepositoryViewContainer.js @@ -254,9 +254,12 @@ class CodeRepositoryViewContainer extends Component { } }) } + if (challenge.pathIndex == cur_index) { + showSnackbar(`当前编辑文件已经是${nodePath}`) + } if (isCurrentFile) { onPathChange(cur_index) - showSnackbar(`当前编辑文件已经是${nodePath}`) + // showSnackbar(`当前编辑文件已经是${nodePath}`) } else { onPathChange(-1) } From 0b5f75eea86857db9e6f2984996afcbc7112b671 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 11 Sep 2019 17:37:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=B7=B2=E7=BB=8F=E6=98=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/page/main/CodeRepositoryViewContainer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/page/main/CodeRepositoryViewContainer.js b/public/react/src/modules/page/main/CodeRepositoryViewContainer.js index 333fa1cd7..c6e7ddc79 100644 --- a/public/react/src/modules/page/main/CodeRepositoryViewContainer.js +++ b/public/react/src/modules/page/main/CodeRepositoryViewContainer.js @@ -254,10 +254,11 @@ class CodeRepositoryViewContainer extends Component { } }) } - if (challenge.pathIndex == cur_index) { - showSnackbar(`当前编辑文件已经是${nodePath}`) - } + if (isCurrentFile) { + if (challenge.pathIndex == cur_index) { + showSnackbar(`当前编辑文件已经是${nodePath}`) + } onPathChange(cur_index) // showSnackbar(`当前编辑文件已经是${nodePath}`) } else { From 8e16c8ab5abaccfbf1cdb844e279887be08943b4 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Sep 2019 17:39:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=87=8D=E5=81=9A?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_commons_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index 3e9ad2eaa..cc23d05d6 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -239,7 +239,12 @@ module HomeworkCommonsHelper end def student_redo_work work, homework + status = false publish_time = homework.homework_group_setting(work.user_id)&.publish_time - work.myshixun && publish_time && work.myshixun.games.where("status = 2 and answer_open = 1 and end_time <= '#{publish_time}'").count > 0 ? true : false + if work.myshixun && publish_time && work.myshixun.created_at < publish_time && work.myshixun.games.where("answer_open > 0").count > 0 + min_time = Grade.where(container_type: "Answer", container_id: work.myshixun.games.where("answer_open > 0").pluck(:id)).pluck(:created_at).min + status = min_time && min_time < publish_time + end + status end end From ccdad96eb48d232839c96bdcebf236c04a5207c6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 11 Sep 2019 17:42:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index ccd07c811..8333b080d 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -441,6 +441,7 @@ class SubjectsController < ApplicationController def user_subject_progress challenge_ids pass_games = Game.select(:id, :cost_time, :challenge_id).where(status: 2, user_id: current_user.id, challenge_id: challenge_ids) if current_user.logged? + @all_score = Challenge.where(id: challenge_ids).size # 如果没有通关的,没必要再继续统计了 if pass_games.blank? @my_score = 0 @@ -448,7 +449,6 @@ class SubjectsController < ApplicationController @time = 0 @user_tags = [] else - @all_score = Challenge.where(id: challenge_ids).size pass_challenge_ids = pass_games.map(&:challenge_id).uniq # 按道理是不用去重的,但是历史数据与重复 subject_challenge_count = @subject.shixuns.sum(:challenges_count) # 用户通关获得的标签