source: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/utils/utils.py @ 13277

Last change on this file since 13277 was 13160, checked in by Henrik Bettermann, 9 years ago

Replace jamb_subjects field by the list-of-choices field
jamb_subjects_list which allows to select items from the jambsubjects
vocabulary. This field is available only for CBT application.

  • Property svn:keywords set to Id
File size: 11.4 KB
Line 
1## $Id: utils.py 13160 2015-07-10 11:39:13Z henrik $
2##
3## Copyright (C) 2012 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"""Customize general helper utilities for Kofa.
19"""
20import os
21import pytz
22from waeup.kofa.utils.utils import KofaUtils, sorted_phone_prefixes
23from kofacustom.nigeria.interfaces import MessageFactory as _
24
25INT_PHONE_PREFIXES = [
26    (1, _('Nigeria'), '234'),
27    (99, _('Germany'), '49'),
28    (99, _('United States'), '1'),
29    (99, _('Niger'), '227'),
30    (99, _('Benin'), '229'),
31    (99, _('Cameroon'), '237'),
32    (99, _('United Kingdom'), '44'),
33    (99, _('France'), '33'),
34    ]
35
36class NigeriaKofaUtils(KofaUtils):
37    """A collection of methods subject to customization.
38    """
39    PORTAL_LANGUAGE = 'en'
40
41    PREFERRED_LANGUAGES_DICT = {
42        'en':(1, u'English'),
43        'fr':(2, u'Français'),
44        'de':(3, u'Deutsch'),
45        'ha':(4, u'Hausa'),
46        'yo':(5, u'Yoruba'),
47        'ig':(6, u'Igbo'),
48        }
49
50    #: A function to return
51    @classmethod
52    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
53        return sorted_phone_prefixes(data, request)
54
55    EXAM_SUBJECTS_DICT = {
56        'accounts': 'Accounts',
57        'add_general_science': 'Add General Science',
58        'add_maths': 'Add Maths',
59        'adv_elect_install_maint': 'Adv. Electrical Installation and Maintenance',
60        'agricultural_science': 'Agricultural Science',
61        'applied_electricity': 'Applied Electricity',
62        'arabi': 'Arabic',
63        'arithmetics': 'Arithmetics',
64        'art': 'Art',
65        'auto_mechanics': 'Auto Mechanics',
66        'awaiting_results': 'Awaiting Results',
67        'basic_electricity': 'Basic Electricity',
68        'bible_knowledge': 'Bible Knowledge',
69        'biology': 'Biology',
70        'biology_alt_syl': 'Biology (Alt.Syl)',
71        'book_keeping': 'Book Keeping',
72        'building_construction': 'Building Construction',
73        'business_management': 'Business Management',
74        'business_construction_management': 'Business/Construction Management (Adv)',
75        'chemistry': 'Chemistry',
76        'chemistry_alt_syl': 'Chemistry (Alt.Syl)',
77        'christian_religious_studies': 'Christian Religious Studies',
78        'class_teaching': 'Class Teaching',
79        'clerical_office_duties': 'Clerical Office Duties',
80        'clothing_and_textiles': 'Clothing and Textiles',
81        'commerce': 'Commerce',
82        'economics': 'Economics',
83        'education': 'Education',
84        'efik': 'Efik',
85        'electronics': 'Electronics',
86        'elementary_surveying': 'Elementary Surveying',
87        'english_language': 'English Language',
88        'engineering_science': 'Engineering Science',
89        'financial_accounting': 'Financial Accounting',
90        'fine_art': 'Fine Art',
91        'food_and_nutrition': 'Food and Nutrition',
92        'french': 'French',
93        'further_mathematics': 'Further Mathematics',
94        'general_science': 'General Science',
95        'geography': 'Geography',
96        'german': 'German',
97        'government': 'Government',
98        'hausa': 'Hausa',
99        'hausa_literature': 'Hausa Literature',
100        'health_science': 'Health Science',
101        'history': 'History',
102        'home_economics': 'Home Economics',
103        'home_management': 'Home Management',
104        'human_biology': 'Human Biology',
105        'industrial_electrical_installation': 'Industrial Elect Installation (Adv)',
106        'intergrated_science': 'Intergrated Science',
107        'islamic_studies': 'Islamic Studies',
108        'literature_in_english': 'Literature in English',
109        'literature_in_nigerian_languages': 'Literature in Nigerian Languages',
110        'igbo': 'Igbo',
111        'igbo_literature': 'Igbo Literature',
112        'yoruba': 'Yoruba',
113        'yoruba_literature': 'Yoruba Literature',
114        'management_in_living': 'Management in Living',
115        'mathematics': 'Mathematics',
116        'metalwork': 'Metalwork',
117        'music': 'Music',
118        'nigerian_language': 'Nigerian Language',
119        'office_practice': 'Office Practice',
120        'physical_education': 'Physical Education',
121        'physical_health_education': 'Physical and Health Education',
122        'physics': 'Physics',
123        'physics_alt_syl': 'Physics (Alt.Syl)',
124        'principles_and_practice_of_education': 'Principles and Practice of Education',
125        'principles_of_cost_accounting': 'Principles of Cost Accounting',
126        'rural_science': 'Rural Science',
127        'science': 'Science',
128        'secretarial_duties': 'Secretarial Duties',
129        'shorthand': 'Shorthand',
130        'sierra_leone_studies': 'Sierra Leone Studies',
131        'sierra_leone_languages': 'Sierra Leone Languages',
132        'social_studies': 'Social Studies',
133        'statistics': 'Statistics',
134        'teaching_practice': 'Teaching Practice',
135        'technical_drawing': 'Technical Drawing',
136        'typewriting': 'Typewriting',
137        'visual_art': 'Visual Art',
138        'woodwork': 'Woodwork',
139        'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc',
140        'first_written': 'First Written',
141        'second_written': 'Second Written',
142        'pract_tests': 'Practical Tests',
143        # Added 25/08/2014
144        'animal_husbandry_(alt_a)': 'Animal Husbandry (Alt A)',
145        'animal_husbandry_(alt_b)': 'Animal Husbandry (Alt B)',
146        'auto_electrical_work': 'Auto Electrical Work',
147        'auto_mechanical_work': 'Auto Mechanical Work',
148        'catering_craft_practice': 'Catering Craft Practice',
149        'civic_education': 'Civic Education',
150        'computer_studies': 'Computer Studies',
151        'cosmetology': 'Cosmetology',
152        'data_processing': 'Data Processing',
153        'dyeing_&_bleaching': 'Dyeing & Bleaching',
154        'electrical_installation_and_maintenance_work': 'Electrical Installation and Maintenance Work',
155        'fisheries_(alt_a)_ghana_candidates': 'Fisheries (Alt A) Ghana Candidates',
156        'fisheries_(alt_b)_nigeria_candidates': 'Fisheries (Alt B) Nigeria Candidates',
157        'garment_making': 'Garment Making',
158        'general_agriculture': 'General Agriculture',
159        'gsm_phones_maintenance_and_repairs': 'Gsm Phones Maintenance and Repairs',
160        'health_education': 'Health Education',
161        'insurance': 'Insurance',
162        'painting_and_decorating': 'Painting and Decorating',
163        'photography': 'Photography',
164        'printing_craft_practice': 'Printing Craft Practice',
165        'store_management': 'Store Management',
166        'textiles': 'Textiles',
167        # Added after 19/01/2015
168        'marketing': 'Marketing',
169        'carpentry_joinery': 'Carpentry and Joinery',
170        'tourism': 'Tourism',
171        'mining': 'Mining',
172        'furniture_making': 'Furniture Making',
173        }
174
175    EXAM_GRADES = (
176        ('A1', 'Excellent (A1)'),
177        ('A2', 'Very Good (A2)'),
178        ('A3', 'Good (A3)'),
179        ('B2', 'Very Good (B2)'),
180        ('B3', 'Good (B3)'),
181        ('C4', 'Credit (C4)'),
182        ('C5', 'Credit (C5)'),
183        ('C6', 'Credit (C6)'),
184        ('A', 'Pass (A)'),
185        ('B', 'Pass (B)'),
186        ('C', 'Pass (C)'),
187        ('U', 'Pass (U)'),
188        ('D7', 'Pass (D7)'),
189        ('P7', 'Pass (P7)'),
190        ('P8', 'Pass (P8)'),
191        ('E8', 'Pass (E8)'),
192        ('F9', 'Fail (F9)'),
193        ('Aa', 'A (a)'),
194        ('Bb', 'B (b)'),
195        ('Cc', 'C (c)'),
196        ('Dd', 'D (d)'),
197        ('Ee', 'E (e)'),
198        ('Ff', 'F (f)'),
199        ('Gg', 'G (g)'),
200        ('credit-1', 'Credit-1'),
201        ('credit-2', 'Credit-2'),
202        ('dist', 'Distinction'),
203        ('pass', 'Pass'), 
204        ('AR', 'Awaiting Results'),
205        )
206
207    INST_TYPES_DICT = {
208        'none': '',
209        'faculty': 'Faculty of',
210        'department': 'Department of',
211        'school': 'School of',
212        'office': 'Office for',
213        'centre': 'Centre for',
214        'institute': 'Institute of',
215        'school_for': 'School for',
216        'college': 'College of',
217        'directorate': 'Directorate of',
218        }
219
220    STUDY_MODES_DICT = {
221        'ume_ft': 'UME Full Time',
222        'ug_ft': 'Undergraduate Full Time',
223        'ug_pt': 'Undergraduate Part Time',
224        'dp_pt': 'Diploma Part Time',
225        'ct_ft': 'Certificate Full Time',
226        'dp_ft': 'Diploma Full Time',
227        'de_ft': 'Direct Entry Full Time',
228        'de_pt': 'Direct Entry Part Time',
229        'nd_ft': 'National Diploma Full Time',
230        'nd_pt': 'National Diploma Part Time',
231        'hnd_ft': 'Higher National Diploma Full Time',
232        'hnd_pt': 'Higher National Diploma Part Time',
233        'pg_ft': 'Postgraduate Full Time',
234        'pg_pt': 'Postgraduate Part Time',
235        'pgd_ft': 'Postgraduate Diploma Full Time',
236        'pgd_pt': 'Postgraduate Diploma Part Time',
237        'special_pg_pt': 'Special Postgraduate Part Time',
238        'nce_ft': 'NCE Full Time',
239        'nce_pt': 'NCE Part Time',
240        'ug_sw': 'Undergraduate Sandwich',
241        'nce_sw': 'NCE Sandwich',
242        'jm_ft': 'Joint Matriculation Full Time',
243        'ph_ft': 'Post Higher Education Full Time',
244        'transfer_pt': 'Transfer Part Time',
245        'transfer_ft': 'Transfer Full Time',
246        'ct_pt': 'Certificate Part Time',
247        'rmd_ft': 'Remedial with deficiencies',
248        'rm_ft': 'Remedial',
249        'transfer': 'Transfer',
250        'prence': 'Pre-NCE',
251        'prend': 'Pre-ND',
252        'pce': 'PCE',
253        'pd_ft': 'Professional Diploma in Education',
254        'found': 'Foundation',
255        'no': 'no application',
256        }
257
258    APP_CATS_DICT = {
259        'basic': 'PUTME, PUDE, PCE, PRENCE',
260        'no': 'No Application',
261        'pg_ft': 'Postgraduate Full-Time',
262        'pg_pt': 'Postgraduate Part-Time',
263        'sandwich': 'Sandwich',
264        'cest': 'Part-Time, Diploma, Certificate',
265        'pre': 'Pre-Degree Studies',
266        }
267
268    VERDICTS_DICT = {
269        '0': 'not yet',
270        'A': 'Successful student',
271        'B': 'Student with carryover courses',
272        'C': 'Student on probation',
273        'D': 'Withdrawn from the faculty',
274        'E': 'Student who were previously on probation',
275        'F': 'Medical case',
276        'G': 'Absent from examination',
277        'H': 'Withheld results',
278        'I': 'Expelled/rusticated/suspended student',
279        'J': 'Temporary withdrawn from the university',
280        'K': 'Unregistered student',
281        'L': 'Referred student',
282        'M': 'Reinstatement',
283        'N': 'Student on transfer',
284        #'O': 'NCE-III repeater', # FCEOkene only
285        'P': 'Exhausted maximum years in the university',
286        'Y': 'No previous verdict',
287        'X': 'New 300 level student (Uniben)',
288        'Z': 'Successful student (provisional)',
289        'A1': 'First Class',
290        'A2': 'Second Class Upper',
291        'A3': 'Second Class Lower',
292        'A4': 'Third Class',
293        'A5': 'Pass',
294        'A6': 'Distinction',
295        'A7': 'Credit',
296        'A8': 'Merit',
297        }
298
299
300    @property
301    def tzinfo(self):
302        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.