From 21694daa5942a1b4b6f0924373f2d9024c7dd7ea Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 Nov 2015 10:05:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A1=BA=E5=BA=8F=E6=8C=89?= =?UTF-8?q?=E5=B0=8F=E5=88=B0=E5=A4=A7=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercise_helper.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/helpers/exercise_helper.rb b/app/helpers/exercise_helper.rb index 6f39d8f8a..db45e8d87 100644 --- a/app/helpers/exercise_helper.rb +++ b/app/helpers/exercise_helper.rb @@ -14,17 +14,18 @@ module ExerciseHelper # 多选 def multiselect_standard_answer(params) size = params.ord - 96 - answer = "" + answer = [] if size > 0 # 小写字母答案 for i in 0..(params.length-1) - answer += (params[i].ord - 96).to_s + answer << (params[i].ord - 96).to_s end else for i in 0..(params.length-1) - answer += (params[i].ord - 64).to_s + answer << (params[i].ord - 64) end end - answer.to_i + answer = answer.sort + answer.join("") end def fill_standart_answer(params, standart_answer)