|
|
|
@ -8,13 +8,14 @@ module ExercisesHelper
|
|
|
|
|
exercise_obj_status = exercise_questions.find_objective_questions
|
|
|
|
|
@ex_obj_array = []
|
|
|
|
|
exercise_obj_status.each do |q|
|
|
|
|
|
if q.question_type == 5
|
|
|
|
|
q_type = q.question_type
|
|
|
|
|
if q_type == Exercise::PRACTICAL
|
|
|
|
|
answers_content = q.exercise_shixun_answers.search_shixun_answers("user_id",user_id)
|
|
|
|
|
else
|
|
|
|
|
answers_content = q.exercise_answers.search_answer_users("user_id",user_id)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if q.question_type <= 2
|
|
|
|
|
if q_type <= Exercise::JUDGMENT
|
|
|
|
|
if answers_content.present? #学生有回答时
|
|
|
|
|
answer_choice_array = []
|
|
|
|
|
answers_content.each do |a|
|
|
|
|
@ -52,7 +53,7 @@ module ExercisesHelper
|
|
|
|
|
}
|
|
|
|
|
@ex_obj_array.push(ques_option)
|
|
|
|
|
end
|
|
|
|
|
exercise_sub_status = exercise_questions.find_by_custom("question_type",4) #主观题
|
|
|
|
|
exercise_sub_status = exercise_questions.find_by_custom("question_type",Exercise::SUBJECTIVE) #主观题
|
|
|
|
|
@ex_sub_array = [] #主观题的已答/未答
|
|
|
|
|
exercise_sub_status.each do |s|
|
|
|
|
|
sub_answer = s.exercise_answers.search_answer_users("user_id",user_id) #主观题只有一个回答
|
|
|
|
@ -63,7 +64,6 @@ module ExercisesHelper
|
|
|
|
|
else
|
|
|
|
|
stand_status = 2
|
|
|
|
|
end
|
|
|
|
|
# stand_status = 1
|
|
|
|
|
sub_answer_score = sub_answer.first.score
|
|
|
|
|
else
|
|
|
|
|
stand_status = 0
|
|
|
|
|