- Timestamp:
- 17 Jul 2022, 08:50:14 (2 years ago)
- Location:
- main/kofacustom.unidel/trunk/src/kofacustom/unidel/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/batching.py
r16949 r17025 20 20 from kofacustom.nigeria.students.batching import NigeriaStudentProcessor 21 21 from waeup.kofa.students.batching import ( 22 StudentOnlinePaymentProcessor, StudentStudyLevelProcessor) 22 StudentOnlinePaymentProcessor, StudentStudyLevelProcessor, 23 CourseTicketProcessor) 23 24 from kofacustom.unidel.students.interfaces import ( 24 25 ICustomStudent, … … 26 27 ICustomStudentUpdateByMatricNo, 27 28 ICustomStudentOnlinePayment, 28 ICustomStudentStudyLevel 29 ICustomStudentStudyLevel, 30 ICustomCourseTicketImport 29 31 ) 30 32 … … 53 55 fields.remove('total_credits_s2') 54 56 return fields 57 58 class CustomCourseTicketProcessor(CourseTicketProcessor): 59 """A batch processor for ICourseTicket objects. 60 """ 61 iface = ICustomCourseTicketImport 62 63 @property 64 def available_fields(self): 65 fields = [ 66 'student_id','reg_number','matric_number', 67 'mandatory', 'score', 'ca', 'carry_over', 'automatic', 68 'level_session', 'outstanding', 'course_category', 69 'title', 'credits', 'passmark', 'semester', 'ticket_session', 70 'unlock_score', 'previous' 71 ] + self.additional_fields 72 return sorted(fields) -
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py
r16977 r17025 29 29 StudyLevelEditFormPage, StudyLevelDisplayFormPage, StudyLevelManageFormPage, 30 30 StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip, 31 CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, 31 CourseTicketDisplayFormPage, CourseTicketManageFormPage, 32 StudentTriggerTransitionFormPage, 32 33 PaymentsManageFormPage, msave, emit_lock_message) 33 34 from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket … … 49 50 ICustomStudentStudyLevel, 50 51 ICustomUGStudentClearance, 51 ICustomPGStudentClearance) 52 ICustomPGStudentClearance, 53 ICustomCourseTicket) 52 54 from kofacustom.unidel.interfaces import MessageFactory as _ 53 55 … … 151 153 [_('Faculty Officer\'s Signature')], 152 154 [_('Student\'s Signature')]) 155 156 class CustomCourseTicketDisplayFormPage(CourseTicketDisplayFormPage): 157 """ Page to display course tickets 158 """ 159 160 @property 161 def form_fields(self): 162 return grok.AutoFields(ICustomCourseTicket).omit('course_category', 163 'ticket_session') 164 165 class CustomCourseTicketManageFormPage(CourseTicketManageFormPage): 166 """ Page to manage course tickets 167 """ 168 169 form_fields = grok.AutoFields(ICustomCourseTicket).omit('course_category') 170 form_fields['title'].for_display = True 171 form_fields['fcode'].for_display = True 172 form_fields['dcode'].for_display = True 173 form_fields['semester'].for_display = True 174 form_fields['passmark'].for_display = True 175 form_fields['credits'].for_display = True 176 form_fields['mandatory'].for_display = False 177 form_fields['automatic'].for_display = True 178 form_fields['carry_over'].for_display = True 179 form_fields['ticket_session'].for_display = True -
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/interfaces.py
r16949 r17025 19 19 from zope import schema 20 20 from waeup.kofa.students.vocabularies import StudyLevelSource 21 from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab) 21 22 from kofacustom.nigeria.students.interfaces import ( 22 23 INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, … … 107 108 """ 108 109 110 score = schema.Int( 111 title = _(u'Score'), 112 required = False, 113 readonly = False, 114 max = 100, 115 ) 116 117 ca = schema.Int( 118 title = _(u'CA'), 119 default = None, 120 required = False, 121 missing_value = None, 122 max = 90, 123 ) 124 125 ICustomCourseTicket['score'].order = INigeriaCourseTicket['score'].order 126 ICustomCourseTicket['ca'].order = ICustomCourseTicket['score'].order 127 128 class ICustomCourseTicketImport(ICustomCourseTicket): 129 """An interface for importing course results and nothing more. 130 """ 131 132 score = schema.Int( 133 title = _(u'Score'), 134 required = False, 135 readonly = False, 136 max = 100, 137 ) 138 139 ca = schema.Int( 140 title = _(u'CA'), 141 required = False, 142 readonly = False, 143 max = 90, 144 ) 145 146 level_session = schema.Choice( 147 title = _(u'Level Session'), 148 source = academic_sessions_vocab, 149 required = False, 150 readonly = False, 151 ) 152 153 109 154 class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): 110 155 """Representation of a student. Skip regular reg_number validation. -
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/studylevel.py
r16949 r17025 81 81 grok.provides(ICustomCourseTicket) 82 82 83 @property 84 def total_score(self): 85 """Returns ca + score or imported total score. 86 """ 87 if self.outstanding: 88 return None 89 # Override total_score if value has been imported 90 if getattr(self, 'imported_ts', None): 91 return self.imported_ts 92 if self.score == -1: 93 return 0 94 if not None in (self.score, self.ca): 95 return self.score + self.ca 96 return None 83 97 84 98 CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
Note: See TracChangeset for help on using the changeset viewer.