Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

schedule_job
杨树明 5 years ago
commit 485478a8fe

@ -993,4 +993,11 @@ module ExercisesHelper
}
exercise_user.update!(commit_option)
end
def has_comment? exercise_user, question_ids
exercise_answer_ids = exercise_user.user.exercise_answers.where(exercise_question_id: question_ids).pluck(:id)
exercise_shixun_answer_ids = exercise_user.user.exercise_shixun_answers.where(exercise_question_id: question_ids).pluck(:id)
exercise_user.commit_status == 1 && (exercise_user.exercise_user_scores.size > 0 || exercise_user.subjective_score >= 0.0 ||
ExerciseAnswerComment.where(exercise_answer_id: exercise_answer_ids).or(ExerciseAnswerComment.where(exercise_shixun_answer_id: exercise_shixun_answer_ids)).exists?)
end
end

@ -15,3 +15,4 @@ if subjective_type == 1
end
json.score ex_user_info[:score]
json.review_status ex_user_info[:teacher_review] #教师是否评阅评阅则为true否则为false
json.has_comment has_comment?(exercise_user, question_ids)

@ -37,7 +37,8 @@ end
if @current_user_ex_answers.present?
json.current_answer_user do
json.partial! "exercises/exercise_user",locals: {exercise_user:@current_user_ex_answers.first, subjective_type:@subjective_type,
user_status:@exercise_current_user_status, exercise:@exercise}
user_status:@exercise_current_user_status, exercise:@exercise,
question_ids: @exercise.exercise_questions.pluck(:id)}
end
end
@ -45,7 +46,8 @@ if @exercise_users_list.present?
json.exercise_users do
json.array! @exercise_users_list.each do |exercise_user|
json.partial! "exercises/exercise_user",locals: {exercise_user:exercise_user, subjective_type:@subjective_type,
user_status:@exercise_current_user_status, exercise:@exercise}
user_status:@exercise_current_user_status, exercise:@exercise,
question_ids: @exercise.exercise_questions.pluck(:id)}
end
end
else

Loading…
Cancel
Save