Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
This commit is contained in:
commit
4204521e14
|
@ -14,17 +14,18 @@ module ExerciseHelper
|
||||||
# 多选
|
# 多选
|
||||||
def multiselect_standard_answer(params)
|
def multiselect_standard_answer(params)
|
||||||
size = params.ord - 96
|
size = params.ord - 96
|
||||||
answer = ""
|
answer = []
|
||||||
if size > 0 # 小写字母答案
|
if size > 0 # 小写字母答案
|
||||||
for i in 0..(params.length-1)
|
for i in 0..(params.length-1)
|
||||||
answer += (params[i].ord - 96).to_s
|
answer << (params[i].ord - 96).to_s
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for i in 0..(params.length-1)
|
for i in 0..(params.length-1)
|
||||||
answer += (params[i].ord - 64).to_s
|
answer << (params[i].ord - 64)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
answer.to_i
|
answer = answer.sort
|
||||||
|
answer.join("")
|
||||||
end
|
end
|
||||||
|
|
||||||
def fill_standart_answer(params, standart_answer)
|
def fill_standart_answer(params, standart_answer)
|
||||||
|
|
Loading…
Reference in New Issue