You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/helpers/exercise_helper.rb

23 lines
441 B

# encoding: utf-8
module ExerciseHelper
#判断用户是否已经提交了问卷
def has_commit_exercise?(exercise_id, user_id)
pu = ExerciseUser.find_by_excercise_id_and_user_id(exercise_id, user_id)
if pu.nil?
false
else
true
end
end
def convert_to_char(str)
result = ""
if str.count >= 1
for i in 0 .. str.count do i
result += (str[i].to_i + 64).chr
end
end
end
end