From 7338ad6e24ae330faa655eb19d7e0eac65b8bbf7 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 13 Nov 2019 10:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4exercise=5Fhelper=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E6=B3=A8=E9=87=8A=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercises_helper.rb | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index f5a1e0709..f457ce257 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -238,30 +238,6 @@ module ExercisesHelper standard_answer_count += 1 end end - - # null_stand_choice.each_with_index do |s,index| - # user_count = 0 - # if ex_ordered #有序排列,或者有重复答案的时候,不按无序排列 - # 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 - # 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 = { - # :choice_position => index+1, - # :choice_text => s_choice_text, - # :choice_users_count => user_count, - # :choice_percent => answer_percent.round(2).to_s, - # :right_answer => true - # } - # question_answer_infos.push(answer_option) - # all_user_count += user_count - # standard_answer_count += 1 - # end answer_user_score = all_user_count * each_null_score percent = (ex_total_score == 0.0 ? 0.0 : (answer_user_score / ex_total_score.to_f).round(3) * 100) #正确率