- Timestamp:
- 30 Nov 2017, 07:39:20 (7 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r14804 r14914 4 4 1.6.dev0 (unreleased) 5 5 ======================= 6 7 * Replace `gpa_boundaries` utility attribute by `GPABoundaries` method 8 which may return different values in custom packages depending on faculty 9 or department code (requested by AAU Ekpoma). 6 10 7 11 * Allow `ApplicantOnlinePaymentProcessor` to import records without -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py
r14625 r14914 107 107 students_utils = getUtility(IStudentsUtils) 108 108 table = list() 109 for i in range(len(students_utils. gpa_boundaries)+1):109 for i in range(len(students_utils.GPABoundaries())+1): 110 110 # The last list is reserved for students with more than one 111 111 # level in the same session. … … 137 137 if itemcount > 1: 138 138 # Error: more than one level registered in this session 139 table[len(students_utils. gpa_boundaries)].append(line)139 table[len(students_utils.GPABoundaries())].append(line) 140 140 continue 141 141 gpaclass = students_utils.getDegreeClassNumber(level_obj) 142 142 table[gpaclass].append(line) 143 for i in range(len(students_utils. gpa_boundaries)+1):143 for i in range(len(students_utils.GPABoundaries())+1): 144 144 if len(table[i]): 145 145 table[i] = sorted([value for value in table[i]], … … 211 211 students_utils = getUtility(IStudentsUtils) 212 212 # Print classes in reverse order 213 for gpa_class in range(len(students_utils. gpa_boundaries)-1,-1,-1):213 for gpa_class in range(len(students_utils.GPABoundaries())-1,-1,-1): 214 214 pdf_data.append(Spacer(1, 20)) 215 gpa_class_name = students_utils.gpa_boundaries[gpa_class][1] 215 gpa_class_name = students_utils.GPABoundaries( 216 faccode=self.faccode, depcode=self.depcode)[gpa_class][1] 216 217 pdf_data += [Paragraph('<strong>%s</strong>' % gpa_class_name, 217 218 STYLE["Normal"])] … … 238 239 total_count = 0 239 240 table_data = list() 240 for gpa_class in range(len(students_utils.gpa_boundaries)-1,-1,-1): 241 gpa_class_name = students_utils.gpa_boundaries[gpa_class][1] 241 for gpa_class in range(len(students_utils.GPABoundaries())-1,-1,-1): 242 gpa_class_name = students_utils.GPABoundaries( 243 faccode=self.faccode, depcode=self.depcode)[gpa_class][1] 242 244 gpa_count = len(self.data[gpa_class]) 243 245 total_count += gpa_count -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r14709 r14914 817 817 return pdf_stream 818 818 819 gpa_boundaries = ((1, 'Fail'), 820 (1.5, 'Pass'), 821 (2.4, '3rd Class'), 822 (3.5, '2nd Class Lower'), 823 (4.5, '2nd Class Upper'), 824 (5, '1st Class')) 819 def GPABoundaries(self, faccode=None, depcode=None): 820 return ((1, 'Fail'), 821 (1.5, 'Pass'), 822 (2.4, '3rd Class'), 823 (3.5, '2nd Class Lower'), 824 (4.5, '2nd Class Upper'), 825 (5, '1st Class')) 825 826 826 827 def getClassFromCGPA(self, gpa, student): … … 829 830 base package, it does not. 830 831 """ 831 if gpa < self. gpa_boundaries[0][0]:832 return 0, self. gpa_boundaries[0][1]833 if gpa < self. gpa_boundaries[1][0]:834 return 1, self. gpa_boundaries[1][1]835 if gpa < self. gpa_boundaries[2][0]:836 return 2, self. gpa_boundaries[2][1]837 if gpa < self. gpa_boundaries[3][0]:838 return 3, self. gpa_boundaries[3][1]839 if gpa < self. gpa_boundaries[4][0]:840 return 4, self. gpa_boundaries[4][1]841 if gpa <= self. gpa_boundaries[5][0]:842 return 5, self. gpa_boundaries[5][1]832 if gpa < self.GPABoundaries()[0][0]: 833 return 0, self.GPABoundaries()[0][1] 834 if gpa < self.GPABoundaries()[1][0]: 835 return 1, self.GPABoundaries()[1][1] 836 if gpa < self.GPABoundaries()[2][0]: 837 return 2, self.GPABoundaries()[2][1] 838 if gpa < self.GPABoundaries()[3][0]: 839 return 3, self.GPABoundaries()[3][1] 840 if gpa < self.GPABoundaries()[4][0]: 841 return 4, self.GPABoundaries()[4][1] 842 if gpa <= self.GPABoundaries()[5][0]: 843 return 5, self.GPABoundaries()[5][1] 843 844 return 'N/A' 844 845
Note: See TracChangeset for help on using the changeset viewer.