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.
educoder/app/models/program_bank.rb

35 lines
623 B

class ProgramBank < ApplicationRecord
def oj_language
result = case language
when '1'
then 'C'
when '2'
then 'C++'
when '3'
then 'Python'
when '4'
then 'Java'
end
result
end
def strip_description
strip_html description
end
def oj_sub_discipline_id
result = case language
when '1'
then 3
when '2'
then 4
when '3'
then 5
when '4'
then 2
end
result
end
end