Changeset 16509 for main/waeup.uniben
- Timestamp:
- 16 Jun 2021, 12:52:36 (3 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/batching.py
r14817 r16509 19 19 """ 20 20 from kofacustom.nigeria.students.batching import NigeriaStudentProcessor 21 from waeup.kofa.students.batching import StudentOnlinePaymentProcessor 21 from waeup.kofa.students.batching import ( 22 StudentOnlinePaymentProcessor, CourseTicketProcessor) 22 23 from waeup.uniben.students.interfaces import ( 23 24 ICustomStudent, 24 25 ICustomStudentUpdateByRegNo, 25 26 ICustomStudentUpdateByMatricNo, 26 ICustomStudentOnlinePayment 27 ICustomStudentOnlinePayment, 28 ICustomCourseTicketImport 27 29 ) 28 30 … … 38 40 """ 39 41 iface = ICustomStudentOnlinePayment 42 43 class CustomCourseTicketProcessor(CourseTicketProcessor): 44 """A batch processor for ICourseTicket objects. 45 """ 46 iface = ICustomCourseTicketImport 47 48 @property 49 def available_fields(self): 50 fields = [ 51 'student_id','reg_number','matric_number', 52 'mandatory', 'score', 'carry_over', 'automatic', 53 'outstanding', 'course_category', 'level_session', 54 'title', 'credits', 'passmark', 'semester', 'ticket_session', 55 'unlock_score', 'grading_sys' 56 ] + self.additional_fields 57 return sorted(fields) 58 -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r16458 r16509 32 32 StudyLevelEditFormPage, StudyLevelDisplayFormPage, 33 33 StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip, 34 CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, 34 CourseTicketDisplayFormPage, 35 CourseTicketManageFormPage, 36 StudentTriggerTransitionFormPage, 35 37 msave, emit_lock_message, 36 38 StudentActivateView, StudentDeactivateView, … … 71 73 ICustomStudentPersonal, 72 74 ICustomStudentPersonalEdit, 73 IMedicalHistory) 75 IMedicalHistory, 76 ICustomCourseTicket) 74 77 from waeup.uniben.interfaces import MessageFactory as _ 75 78 … … 658 661 """ Page to display course tickets 659 662 """ 660 form_fields = grok.AutoFields(ICourseTicket).omit('score') 663 form_fields = grok.AutoFields(ICustomCourseTicket).omit('score') 664 665 class CustomCourseTicketManageFormPage(CourseTicketManageFormPage): 666 """ Page to manage course tickets 667 """ 668 669 form_fields = grok.AutoFields(ICustomCourseTicket).omit('course_category') 670 form_fields['title'].for_display = True 671 form_fields['fcode'].for_display = True 672 form_fields['dcode'].for_display = True 673 form_fields['semester'].for_display = True 674 form_fields['passmark'].for_display = True 675 form_fields['credits'].for_display = True 676 form_fields['mandatory'].for_display = False 677 form_fields['automatic'].for_display = True 678 form_fields['carry_over'].for_display = True 679 form_fields['ticket_session'].for_display = True 661 680 662 681 class CustomStudentActivateView(StudentActivateView): -
main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py
r16385 r16509 18 18 19 19 from zope import schema 20 from waeup.kofa.interfaces import validate_email, IKofaObject 20 from waeup.kofa.interfaces import ( 21 validate_email, IKofaObject, 22 academic_sessions_vocab) 21 23 from waeup.kofa.students.vocabularies import StudyLevelSource 24 from kofacustom.nigeria.interfaces import GradingSystemSource 22 25 from kofacustom.nigeria.students.interfaces import ( 23 26 INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, … … 30 33 from waeup.uniben.interfaces import MessageFactory as _ 31 34 35 32 36 class ICustomStudentBase(INigeriaStudentBase): 33 37 """Representation of student base data. … … 291 295 """ 292 296 297 grading_sys = schema.Choice( 298 title = _(u'Grading System'), 299 source = GradingSystemSource(), 300 required = True, 301 default = 'A', 302 ) 303 304 class ICustomCourseTicketImport(ICustomCourseTicket): 305 """An interface for importing course results and nothing more. 306 """ 307 308 score = schema.Int( 309 title = _(u'Score'), 310 required = False, 311 readonly = False, 312 ) 313 314 level_session = schema.Choice( 315 title = _(u'Level Session'), 316 source = academic_sessions_vocab, 317 required = False, 318 readonly = False, 319 ) 320 321 grading_sys = schema.Choice( 322 title = _(u'Grading System'), 323 source = GradingSystemSource(), 324 required = False, 325 default = 'A', 326 ) 327 293 328 class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): 294 329 """Representation of a student. Skip regular reg_number validation. -
main/waeup.uniben/trunk/src/waeup/uniben/students/studylevel.py
r14359 r16509 87 87 return True 88 88 89 @property 90 def _getGradeWeightFromScore(self): 91 """Uniben Course Grading System 92 """ 93 if getattr(self, 'grading_sys', 'A') == 'A': 94 if self.total_score is None: 95 return (None, None) 96 if self.total_score >= 70: 97 return ('A',5) 98 if self.total_score >= 60: 99 return ('B',4) 100 if self.total_score >= 50: 101 return ('C',3) 102 if self.total_score >= 45: 103 return ('D',2) 104 if self.total_score >= 40: 105 return ('E',1) 106 return ('F',0) 107 else: 108 if self.total_score is None: 109 return (None, None) 110 if self.total_score >= 70: 111 return ('A',5) 112 if self.total_score >= 60: 113 return ('B',4) 114 if self.total_score >= 50: 115 return ('C',3) 116 if self.total_score >= 45: 117 return ('D',2) 118 return ('F',0) 119 120 89 121 CustomCourseTicket = attrs_to_fields(CustomCourseTicket) 90 122
Note: See TracChangeset for help on using the changeset viewer.