|
|
|
@ -181,7 +181,7 @@ module ExercisesHelper
|
|
|
|
|
ex_ordered = ex.is_ordered
|
|
|
|
|
null_standard_answer = ex.exercise_standard_answers
|
|
|
|
|
null_stand_choice = null_standard_answer.pluck(:exercise_choice_id).uniq #一个exercise_choice_id可能对应多个answer_text
|
|
|
|
|
null_stand_text = null_standard_answer.pluck(:answer_text)
|
|
|
|
|
null_stand_text = null_standard_answer.pluck(:answer_text).reject(&:blank?)
|
|
|
|
|
standard_answer_count = 0
|
|
|
|
|
each_null_score = null_stand_choice.size > 0 ? (ex&.question_score.to_f / null_stand_choice.uniq.size).round(3) : 0.0
|
|
|
|
|
all_user_count = 0
|
|
|
|
@ -191,13 +191,6 @@ module ExercisesHelper
|
|
|
|
|
user_count = 0
|
|
|
|
|
s_choice_text = null_stand_text[index]
|
|
|
|
|
user_count = user_count + effictive_users.select{|answer| answer.exercise_choice_id == s && answer.answer_text == s_choice_text}.size
|
|
|
|
|
# if ex_ordered #有序排列,或者有重复答案的时候,不按无序排列
|
|
|
|
|
#
|
|
|
|
|
# else
|
|
|
|
|
# # null_stand_text = null_stand_text.uniq
|
|
|
|
|
# s_choice_text = null_stand_text[index]
|
|
|
|
|
# user_count = user_count + effictive_users.select{|answer| answer.answer_text == s_choice_text }.size #回答了标准答案的用户
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
answer_percent = ((effictive_users_count == 0) ? 0.0 : (user_count / effictive_users_count.to_f ).round(3))
|
|
|
|
|
answer_option = {
|
|
|
|
|