[8810] | 1 | ## $Id: interfaces.py 10153 2013-05-06 10:51:34Z henrik $
|
---|
| 2 | ##
|
---|
| 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
|
---|
| 4 | ## This program is free software; you can redistribute it and/or modify
|
---|
| 5 | ## it under the terms of the GNU General Public License as published by
|
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or
|
---|
| 7 | ## (at your option) any later version.
|
---|
| 8 | ##
|
---|
| 9 | ## This program is distributed in the hope that it will be useful,
|
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 12 | ## GNU General Public License for more details.
|
---|
| 13 | ##
|
---|
| 14 | ## You should have received a copy of the GNU General Public License
|
---|
| 15 | ## along with this program; if not, write to the Free Software
|
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 17 | ##
|
---|
| 18 |
|
---|
| 19 | import zope.i18nmessageid
|
---|
| 20 | from zope import schema
|
---|
| 21 | from zc.sourcefactory.basic import BasicSourceFactory
|
---|
| 22 | from waeup.kofa.interfaces import (SimpleKofaVocabulary,
|
---|
| 23 | ISessionConfiguration, academic_sessions_vocab)
|
---|
| 24 | from kofacustom.nigeria.utils.lgas import LGAS
|
---|
| 25 |
|
---|
[9854] | 26 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.nigeria')
|
---|
[8810] | 27 |
|
---|
| 28 | high_qual = SimpleKofaVocabulary(
|
---|
| 29 | ('National Certificate of Education','nce'),
|
---|
| 30 | ('Pre Degree Programme','pre'),
|
---|
| 31 | ('Diploma Programme','dip'),
|
---|
| 32 | ('Ordinary National Diploma','ond'),
|
---|
| 33 | ('Bachelors Degree','bd'),
|
---|
| 34 | ('Masters Degree','md'),
|
---|
| 35 | ('Professional Qualification','pq'),
|
---|
| 36 | ('Other Certification','oc'),
|
---|
| 37 | ('Higher National Diploma','hnd'),
|
---|
| 38 | ('Post Graduate Diploma','pgd'),
|
---|
| 39 | ('NCE AL OTH','nce_al_oth'),
|
---|
| 40 | ('National Defence Academy','nda'),
|
---|
| 41 | ('Awaiting Results','a_rslt'),
|
---|
| 42 | ('RMC','rmc'),
|
---|
[10153] | 43 | ('Ph.D.(Doctor of Philosophy)','phd'),
|
---|
[8810] | 44 | )
|
---|
| 45 |
|
---|
| 46 | high_grade = SimpleKofaVocabulary(
|
---|
| 47 | ('Upper Credit','upper_credit'),
|
---|
| 48 | ('Distinction','distinction'),
|
---|
| 49 | ('Credit','credit'),
|
---|
| 50 | ('Merit','merit'),
|
---|
| 51 | ('Lower Credit','lower_credit'),
|
---|
| 52 | ('First Class','first_class'),
|
---|
| 53 | ('Second Class Upper','second_class_upper'),
|
---|
| 54 | ('Second Class Lower','second_class_lower'),
|
---|
| 55 | ('Third Class','third_class'),
|
---|
| 56 | ('Pass','pass'),
|
---|
| 57 | ('Awaiting Results','a_rslt'),
|
---|
| 58 | ('A Levels','al'),
|
---|
[10135] | 59 | ('Unclassified Certificate', 'uc'),
|
---|
[8810] | 60 | )
|
---|
| 61 |
|
---|
| 62 | exam_types = SimpleKofaVocabulary(
|
---|
| 63 | ('SSCE','ssce'),
|
---|
| 64 | ('WAEC','waec'),
|
---|
| 65 | ('GCE O\' LEVEL','gce_o_level'),
|
---|
| 66 | ('TC II','tc_ii'),
|
---|
| 67 | ('RSA','rsa'),
|
---|
| 68 | ('NABTEB','nabteb'),
|
---|
| 69 | ('NECO','neco'),
|
---|
| 70 | ('ACE','ace'),
|
---|
| 71 | ('GCE A\' LEVEL','gce_a_level'),
|
---|
| 72 | ('IGCSE','igcse'),
|
---|
| 73 | )
|
---|
| 74 |
|
---|
| 75 | #lgas_vocab = SimpleKofaVocabulary(
|
---|
| 76 | # *sorted([(x[1],x[0]) for x in LGAS]))
|
---|
| 77 |
|
---|
| 78 | class LGASource(BasicSourceFactory):
|
---|
| 79 | """A source for school subjects used in exam documentation.
|
---|
| 80 | """
|
---|
| 81 | lga_dict = dict(LGAS)
|
---|
| 82 |
|
---|
| 83 | def getValues(self):
|
---|
| 84 | return sorted(self.lga_dict.keys())
|
---|
| 85 |
|
---|
| 86 | def getToken(self, value):
|
---|
| 87 | return str(value)
|
---|
| 88 |
|
---|
| 89 | def getTitle(self, value):
|
---|
| 90 | return self.lga_dict.get(value,
|
---|
| 91 | _('Invalid key: ${a}', mapping = {'a':value}))
|
---|