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

dev_forum
daiao 5 years ago
commit d60b8933ac

@ -97,12 +97,12 @@ class Challenge < ApplicationRecord
# 关卡用户通关数
def user_passed_count
games.select{|game| game.status == 2}.size
games.where(status: 2).count
end
# 关卡用户正在挑战的人数
def playing_count
games.select{|game| game.status == 0 || game.status == 1}.size
games.where(status: [0, 1]).count
end
def last_challenge

@ -54,7 +54,7 @@ json.exercise_questions do
this_ques_status = all_question_status.detect {|f| f[:q_id] == q.id}
json.answer_status this_ques_status[:stand_status]
end
json.user_score user_ques_answers[:user_score].to_s
json.user_score user_ques_answers[:user_score].present? ? user_ques_answers[:user_score].to_s : nil
json.partial! "exercise_questions/exercise_questions",
question: q,
ex_answerer: ex_answerer,

@ -24,7 +24,7 @@ namespace :homework_evaluation do
student_works = homework_common.student_works.has_committed
end
if student_works.size >= 2
if student_works.present? && student_works.length >= 2
HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id)
homework_detail_manual.update_column('comment_status', 3)

Loading…
Cancel
Save