Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
杨树林 5 years ago
commit e08defbfa1

@ -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)
# 用户通关获得的标签

@ -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

@ -254,9 +254,13 @@ class CodeRepositoryViewContainer extends Component {
}
})
}
if (isCurrentFile) {
onPathChange(cur_index)
if (challenge.pathIndex == cur_index) {
showSnackbar(`当前编辑文件已经是${nodePath}`)
}
onPathChange(cur_index)
// showSnackbar(`当前编辑文件已经是${nodePath}`)
} else {
onPathChange(-1)
}

Loading…
Cancel
Save