Changeset 14918 for main/waeup.aaue/trunk/src/waeup/aaue/students
- Timestamp:
- 30 Nov 2017, 12:57:05 (7 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/reports/level_report.py
r14632 r14918 80 80 final_level_obj = level_obj.student['studycourse'][final_level] 81 81 if final_level_obj.remark not in ( 82 'Pass', '3s_rd_s', '2s_2_s', '2s_1_s', '1s_st_s'): 82 'Pass', '3s_rd_s', '2s_2_s', '2s_1_s', '1s_st_s', 83 'Merit', 'Credit', 'Distinction'): 83 84 return True 84 85 return False -
main/waeup.aaue/trunk/src/waeup/aaue/students/reports/session_results_presentation.py
r14673 r14918 123 123 final_level_obj = level_obj.student['studycourse'][final_level] 124 124 if final_level_obj.remark not in ( 125 'Pass', '3s_rd_s', '2s_2_s', '2s_1_s', '1s_st_s'): 125 'Pass', '3s_rd_s', '2s_2_s', '2s_1_s', '1s_st_s', 126 'Merit', 'Credit', 'Distinction'): 126 127 return True 127 128 return False -
main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_level_report.py
r14629 r14918 87 87 print "Sample grad_level_report.pdf written to %s" % path 88 88 return 89 90 def test_create_dp_pdf(self): 91 self.certificate.study_mode = 'dp_ft' 92 self.student['studycourse']['100']['Course1'].ca = 0 93 self.student['studycourse']['100']['Course1'].credits = 91 94 self.certificate.end_level = 100 95 self.app['faculties']['fac1'].officer_1 = 'Rosa Moonshine - Dean of Faculty' 96 self.app['faculties']['fac1']['dep1'].officer_1 = 'Amalia Sunshine - Head of Department' 97 report = GradLevelReport('fac1', 'dep1', 'CERT1', 2010, 100) 98 result = report.create_pdf('JOB_ID') 99 self.assertTrue(result.startswith('%PDF-')) 100 path = os.path.join(samples_dir(), 'dp_grad_level_report.pdf') 101 open(path, 'wb').write(result) 102 print "Sample dp_grad_level_report.pdf written to %s" % path 103 return -
main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_session_results_presentation.py
r14631 r14918 56 56 return 57 57 58 def test_create_dp_pdf(self): 59 self.certificate.degree = 'BA(FS)' 60 self.certificate.study_mode = 'dp_ft' 61 self.app['faculties']['fac1'].officer_1 = 'Rosa Moonshine - Dean of Faculty' 62 self.app['faculties']['fac1']['dep1'].officer_1 = 'Amalia Sunshine - Head of Department' 63 self.app['faculties']['fac1']['dep1'].officer_2 = 'Theresa Starbright - External Examiner' 64 report = CustomSessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 65 result = report.create_pdf('JOB_ID') 66 self.assertTrue(result.startswith('%PDF-')) 67 path = os.path.join(samples_dir(), 'dp_session_results_presentation.pdf') 68 open(path, 'wb').write(result) 69 print "Sample dp_session_results_presentation.pdf written to %s" % path 70 return 71 58 72 59 73 class GradSessionResultsPresentationTests(CatalogTestSetup): -
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r14675 r14918 186 186 certificate = getattr(self.__parent__,'certificate',None) 187 187 end_level = getattr(certificate, 'end_level', None) 188 study_mode = getattr(certificate, 'study_mode', None) 189 is_dp = False 190 if study_mode and study_mode.startswith('dp'): 191 is_dp = True 188 192 failed_limit = 1.5 189 193 if self.student.entry_session < 2013: … … 213 217 return 'Fail' 214 218 if self.cumulative_params[0] < 1.5: 219 if is_dp: 220 return 'Fail' 215 221 return 'Pass' 216 222 if self.cumulative_params[0] < 2.4: 223 if is_dp: 224 return 'Pass' 217 225 return '3s_rd_s' 218 226 if self.cumulative_params[0] < 3.5: 227 if is_dp: 228 return 'Merit' 219 229 return '2s_2_s' 220 230 if self.cumulative_params[0] < 4.5: 231 if is_dp: 232 return 'Credit' 221 233 return '2s_1_s' 222 234 if self.cumulative_params[0] < 5.1: 235 if is_dp: 236 return 'Distinction' 223 237 return '1s_st_s' 224 238 return 'N/A' -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r14899 r14918 18 18 import grok 19 19 from time import time 20 from zope.component import createObject 20 from zope.component import createObject, queryUtility 21 from zope.catalog.interfaces import ICatalog 21 22 from waeup.kofa.interfaces import ( 22 23 ADMITTED, CLEARANCE, REQUESTED, CLEARED, RETURNING, PAID, … … 37 38 PORTRAIT_CHANGE_STATES = (ADMITTED,) 38 39 39 gpa_boundaries_diploma = ((1.5, 'Fail'), 40 (1.5, 'Fail'), 41 (2.4, 'Pass'), 42 (3.5, 'Merit'), 43 (4.5, 'Credit'), 44 (5, 'Distinction')) 45 46 gpa_boundaries = ((1, 'FRNS / NER / NYV'), 47 (1.5, 'Pass'), 48 (2.4, '3rd Class Honours (Diploma: Pass)'), 49 (3.5, '2nd Class Honours Lower Division (Diploma: Merit)'), 50 (4.5, '2nd Class Honours Upper Division (Diploma: Credit)'), 51 (5, '1st Class Honours (Diploma: Distinction)')) 40 def GPABoundaries(self, faccode=None, depcode=None, 41 certcode=None, student=None): 42 if student and student.current_mode.startswith('dp'): 43 return ((1.5, 'Fail'), 44 (2.4, 'Pass'), 45 (3.5, 'Merit'), 46 (4.5, 'Credit'), 47 (5, 'Distinction')) 48 elif student: 49 return ((1, 'FRNS / NER / NYV'), 50 (1.5, 'Pass'), 51 (2.4, '3rd Class Honours'), 52 (3.5, '2nd Class Honours Lower Division'), 53 (4.5, '2nd Class Honours Upper Division'), 54 (5, '1st Class Honours')) 55 # Session Results Presentations depend on certificate 56 results = None 57 if certcode: 58 cat = queryUtility(ICatalog, name='certificates_catalog') 59 results = list( 60 cat.searchResults(code=(certcode, certcode))) 61 if results and results[0].study_mode.startswith('dp'): 62 return ((1.5, 'Fail'), 63 (2.4, 'Pass'), 64 (3.5, 'Merit'), 65 (4.5, 'Credit'), 66 (5, 'Distinction')) 67 else: 68 return ((1, 'FRNS / NER / NYV'), 69 (1.5, 'Pass'), 70 (2.4, '3rd Class Honours'), 71 (3.5, '2nd Class Honours Lower Division'), 72 (4.5, '2nd Class Honours Upper Division'), 73 (5, '1st Class Honours')) 52 74 53 75 def getClassFromCGPA(self, gpa, student): 54 if student.current_mode.startswith('dp'): 55 gpa_boundaries = self.gpa_boundaries_diploma 56 57 else: 58 gpa_boundaries = self.gpa_boundaries 76 gpa_boundaries = self.GPABoundaries(student=student) 59 77 if gpa < gpa_boundaries[0][0]: 60 78 # FRNS / Fail
Note: See TracChangeset for help on using the changeset viewer.