courseware
cxt 5 years ago
parent d318f9b9d9
commit cd69eaeaaf

@ -712,9 +712,9 @@ module ExercisesHelper
course_group = course.course_groups.by_group_ids(current_user_group_id) course_group = course.course_groups.by_group_ids(current_user_group_id)
current_user_group_name = course_group.first.name if course_group.present? current_user_group_name = course_group.first.name if course_group.present?
end end
exercise_answer_ids = ex_user.user.exercise_answers.where(exercise_question_id: subject_question_ids).pluck(:id)
if ex_user.subjective_score > 0.0 || ex_user.exercise_user_scores.size > 0 || ExerciseAnswerComment.where(exercise_answer_id: exercise_answer_ids).exists? if ex_user.subjective_score > 0.0 || ex_user.exercise_user_scores.size > 0 ||
ExerciseAnswerComment.where(exercise_answer_id: ex_user.user.exercise_answers.where(exercise_question_id: subject_question_ids)).exists?
teacher_review = true teacher_review = true
else else
teacher_review = false teacher_review = false

@ -38,7 +38,8 @@ if @current_user_ex_answers.present?
json.current_answer_user do json.current_answer_user do
json.partial! "exercises/exercise_user",locals: {exercise_user:@current_user_ex_answers.first, subjective_type:@subjective_type, 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)} question_ids: @exercise.exercise_questions.pluck(:id),
subject_question_ids: @exercise.subject_question_ids}
end end
end end

Loading…
Cancel
Save