|
|
|
@ -89,11 +89,7 @@ module ExercisesHelper
|
|
|
|
|
if ex.question_type <= 2 #单选题
|
|
|
|
|
standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id) #标准答案的位置
|
|
|
|
|
ex.exercise_choices.each do |c|
|
|
|
|
|
if standard_answer.include?(c.choice_position) #选项的标准答案为选项的位置
|
|
|
|
|
right_answer = true
|
|
|
|
|
else
|
|
|
|
|
right_answer = false
|
|
|
|
|
end
|
|
|
|
|
right_answer = standard_answer.include?(c.choice_position) #选项的标准答案为选项的位置
|
|
|
|
|
answer_this_choice = effictive_users.search_exercise_answer("exercise_choice_id",c.id)
|
|
|
|
|
answer_users_count = answer_this_choice.count
|
|
|
|
|
if effictive_users_count == 0
|
|
|
|
@ -176,11 +172,7 @@ module ExercisesHelper
|
|
|
|
|
# zero_scores = all_zero_scores - un_review_scores #已评阅,且答案未0分的人数
|
|
|
|
|
main_scores_array = [full_scores,no_full_scores,zero_scores,un_review_scores]
|
|
|
|
|
main_scores_array.each_with_index do |s,index|
|
|
|
|
|
if index == 0
|
|
|
|
|
right_answer = true
|
|
|
|
|
else
|
|
|
|
|
right_answer = false
|
|
|
|
|
end
|
|
|
|
|
right_answer = (index == 0)
|
|
|
|
|
if effictive_users_count == 0 || s < 0
|
|
|
|
|
s = 0
|
|
|
|
|
score_percent = 0.0
|
|
|
|
@ -207,11 +199,7 @@ module ExercisesHelper
|
|
|
|
|
shixun_score_array = [full_scores,no_full_scores,all_zero_scores]
|
|
|
|
|
shixun_chas = []
|
|
|
|
|
shixun_score_array.each_with_index do |s,index|
|
|
|
|
|
if index == 0
|
|
|
|
|
right_answer = true
|
|
|
|
|
else
|
|
|
|
|
right_answer = false
|
|
|
|
|
end
|
|
|
|
|
right_answer = (index == 0)
|
|
|
|
|
if effictive_users_count == 0
|
|
|
|
|
score_percent = 0.0
|
|
|
|
|
else
|
|
|
|
|