olympiamanagement/app/models/student_data_field.rb

21 lines
2.2 KiB
Ruby
Raw Permalink Normal View History

2020-02-03 15:24:43 +00:00
class StudentDataField
include Mongoid::Document
include Mongoid::Timestamps
# encoding: utf-8
include OrbitTag::Taggable
include OrbitCategory::Categorizable
field :sign_up_setting_id , type: String , default: (SignUpSetting.where(:active=>true).last.id.to_s rescue "")
2020-02-20 09:49:29 +00:00
field :student_data_fields , type: Array , default: [{'StudentIdentity'=>{'type'=>'select_string','hint'=>{'zh_tw'=>'','en'=>''},'values'=>{'zh_tw'=>['一般身分','科展得獎者','科學班'],'en'=>['General identity','Science Fair Winner','Science Class']},'required'=>"true"}},
2020-02-03 15:24:43 +00:00
{'StudentName'=>{'type'=>'String','size'=>'20','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentSex'=>{'type'=>'radio','size'=>'20','choices'=>['M','F'],'values'=>{'zh_tw'=>['男','女'],'en'=>['Male','Female']},'hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentBirthYear'=>{'type'=>'Year','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentBirthMonth'=>{'type'=>'select_num','range'=>[1,12],'hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentBirthDay'=>{'type'=>'select_num','range'=>[1,31],'hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentClass'=>{'type'=>'String','size'=>'20','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentPhone'=>{'type'=>'String','size'=>'20','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentCode'=>{'type'=>'String','size'=>'10','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentAddress'=>{'type'=>'String','size'=>'40','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentArea'=>{'type'=>'select_string','hint'=>{'zh_tw'=>'','en'=>''},'values'=>{'zh_tw'=>['台北考區','新竹考區','台中考區','嘉義考區','高雄考區','花蓮考區','台東考區','金門考區','澎湖考區'],
'en'=>['Taipei exam area','Hsinchu exam area','Taichung exam area','Chiayi exam area','Kaohsiung exam area','Hualien exam area','Taitung exam area','Kinmen exam area','Penghu exam area']},'required'=>"true"}},
{'StudentFile'=>{'type'=>'File','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}}]
end