Changeset 17406 for main/kofacustom.edocons/trunk/src
- Timestamp:
- 9 May 2023, 15:19:08 (20 months ago)
- Location:
- main/kofacustom.edocons/trunk/src/kofacustom/edocons/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/batching.py
r17405 r17406 55 55 'title', 'credits', 'passmark', 'semester', 'ticket_session', 56 56 'unlock_score', 'previous', 'carryover_score', 'in_progress', 57 'resumption_date', ' rst_grade', 'attempted_number'57 'resumption_date', 'carryover_grade', 'attempts' 58 58 ] + self.additional_fields 59 59 return sorted(fields) -
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/browser.py
r17393 r17406 30 30 StudyLevelEditFormPage, StudyLevelDisplayFormPage, 31 31 StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip, 32 ExportPDFTranscriptSlip, 32 33 CourseTicketDisplayFormPage, 33 34 CourseTicketManageFormPage, 34 35 StudyLevelDisplayFormPage, 36 StudyLevelManageFormPage, 35 37 StudentTriggerTransitionFormPage, 36 38 ExportPDFAdmissionSlip, StartClearancePage, PaymentsManageFormPage, … … 162 164 return translated_values(self) 163 165 166 class CustomStudyLevelManageFormPage(StudyLevelManageFormPage): 167 """ Page to edit the student study level data 168 """ 169 164 170 class CustomExportPDFCourseRegistrationSlip(NigeriaExportPDFCourseRegistrationSlip): 165 171 """Deliver a PDF slip of the context. … … 177 183 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 178 184 #Mand = translate(_('Requ.'), 'waeup.kofa', target_language=portal_language) 179 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language)180 Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language)185 #Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 186 #Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language) 181 187 studentview = StudentBasePDFFormPage(self.context.student, 182 188 self.request, self.omit_fields) … … 194 200 (Cred, 'credits', 1.5), 195 201 #(Mand, 'mandatory', 1.5), 196 (Score, 'score', 1.5), 197 (Grade, 'grade', 1.5), 198 ('RST', 'carryover_score', 1.5), 202 ('Score', 'score', 1.5), 203 ('Grade', 'grade', 1.5), 204 ('RST Score', 'carryover_score', 1.5), 205 ('RST Grade', 'carryover_grade', 1.5), 199 206 #('Auto', 'automatic', 1.5) 200 207 ]) … … 225 232 """ 226 233 form_fields = grok.AutoFields(ICustomCourseTicket) 234 235 class ExportPDFTranscriptSlip(ExportPDFTranscriptSlip): 236 """Deliver a PDF slip of the context. 237 """ 238 239 def render(self): 240 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 241 Term = translate(_('Term'), 'waeup.kofa', target_language=portal_language) 242 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) 243 Title = translate(_('Title'), 'waeup.kofa', target_language=portal_language) 244 Cred = translate(_('Credits'), 'waeup.kofa', target_language=portal_language) 245 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 246 Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language) 247 studentview = StudentBasePDFFormPage(self.context.student, 248 self.request, self.omit_fields) 249 students_utils = getUtility(IStudentsUtils) 250 251 tableheader = [(Code,'code', 2.5), 252 (Title,'title', 7), 253 (Term, 'semester', 1.5), 254 (Cred, 'credits', 1.5), 255 (Score, 'total_score', 1.5), 256 (Grade, 'grade', 1.5), 257 ('Attmpt', 'attempted_number', 1.5) 258 ] 259 260 pdfstream = students_utils.renderPDFTranscript( 261 self, 'transcript.pdf', 262 self.context.student, studentview, 263 omit_fields=self.omit_fields, 264 tableheader=tableheader, 265 signatures=self._signatures(), 266 sigs_in_footer=self._sigsInFooter(), 267 digital_sigs=self._digital_sigs(), 268 save_file=self._save_file(), 269 ) 270 if not pdfstream: 271 self.redirect(self.url(self.context.student)) 272 return 273 return pdfstream -
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/browser_templates/studylevelpage.pt
r17345 r17406 30 30 <th i18n:translate="">Score</th> 31 31 <th i18n:translate="">Grade</th> 32 <th i18n:translate="">RST</th> 32 <th i18n:translate="">RST Score</th> 33 <th i18n:translate="">RST Grade</th> 33 34 <th i18n:translate="">OS</th> 34 35 <th i18n:translate="">Auto</th> … … 49 50 <td tal:content="value/grade|nothing">GRADE</td> 50 51 <td tal:content="value/carryover_score">RSTSCORE</td> 52 <td tal:content="value/carryover_grade">RSTGRADE</td> 51 53 <td tal:content="value/outstanding">OS</td> 52 54 <td tal:content="value/automatic">AUTO</td> -
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/interfaces.py
r17405 r17406 94 94 """ 95 95 96 automatic = schema.Bool( 97 title = _(u'Automatical Creation'), 98 default = False, 99 required = False, 100 ) 101 102 carry_over = schema.Bool( 103 title = _(u'Carry-over Course'), 104 default = False, 105 required = False, 106 ) 107 96 108 carryover_score = schema.Int( 97 title = _(u'Carry-over Score'),109 title = _(u'Carry-over (RST) Score'), 98 110 default = None, 99 111 required = False, … … 102 114 ) 103 115 104 attempted_number = schema.Int( 105 title = _(u'Attempted Number'), 116 carryover_grade = schema.TextLine( 117 title = _(u'Carry-over (RST) Grade'), 118 required = False, 119 ) 120 121 attempts = schema.Int( 122 title = _(u'Number of Attempts'), 106 123 default = None, 107 124 required = False, 108 125 missing_value = None, 109 126 max = 5, 110 )111 112 rst_grade = schema.TextLine(113 title = _(u'RST Grade'),114 required = False,115 127 ) 116 128 … … 127 139 ) 128 140 129 ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order 141 score = schema.Int( 142 title = _(u'(Final) Score'), 143 default = None, 144 required = False, 145 missing_value = None, 146 ) 147 148 #ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order 130 149 #ICustomCourseTicket['in_progress'].order = ICustomCourseTicket['grade'].order 131 150 #ICustomCourseTicket['resumption_date'].order = ICustomCourseTicket['grade'].order -
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/tests/test_browser.py
r16695 r17406 68 68 open(path, 'wb').write(self.browser.contents) 69 69 print "Sample PDF UG admission_slip.pdf written to %s" % path 70 71 def test_transcripts(self): 72 studylevel = createObject(u'waeup.StudentStudyLevel') 73 studylevel.level = 100 74 studylevel.level_session = 2005 75 self.student['studycourse'].entry_mode = 'ug_ft' 76 self.student['studycourse'].addStudentStudyLevel( 77 self.certificate, studylevel) 78 studylevel2 = createObject(u'waeup.StudentStudyLevel') 79 studylevel2.level = 110 80 studylevel2.level_session = 2006 81 self.student['studycourse'].addStudentStudyLevel( 82 self.certificate, studylevel2) 83 # Add second course (COURSE has been added automatically) 84 courseticket = createObject('waeup.CourseTicket') 85 courseticket.code = 'ANYCODE' 86 courseticket.title = u'Any TITLE' 87 courseticket.credits = 13 88 courseticket.score = 66 89 courseticket.semester = 1 90 courseticket.attempted_number = 4 91 courseticket.dcode = u'ANYDCODE' 92 courseticket.fcode = u'ANYFCODE' 93 self.student['studycourse']['110']['COURSE2'] = courseticket 94 self.student['studycourse']['100']['COURSE1'].score = 55 95 self.assertEqual(self.student['studycourse']['100'].gpa_params_rectified[0], 2.5) 96 self.assertEqual(self.student['studycourse']['110'].gpa_params_rectified[0], 3.0) 97 # Get transcript data 98 td = self.student['studycourse'].getTranscriptData() 99 self.assertEqual(td[0][0]['level_key'], '100') 100 self.assertEqual(td[0][0]['sgpa'], 2.5) 101 self.assertEqual(td[0][0]['level'].level, 100) 102 self.assertEqual(td[0][0]['level'].level_session, 2005) 103 self.assertEqual(td[0][0]['tickets_1'][0].code, 'COURSE1') 104 self.assertEqual(td[0][1]['level_key'], '110') 105 self.assertEqual(td[0][1]['sgpa'], 3.0) 106 self.assertEqual(td[0][1]['level'].level, 110) 107 self.assertEqual(td[0][1]['level'].level_session, 2006) 108 self.assertEqual(td[0][1]['tickets_1'][0].code, 'ANYCODE') 109 self.assertEqual(td[1], 2.782608695652174) 110 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 111 self.browser.open(self.student_path + '/studycourse/transcript') 112 self.assertEqual(self.browser.headers['Status'], '200 Ok') 113 self.assertTrue('Transcript' in self.browser.contents) 114 # Officers can open the pdf transcript 115 self.browser.open(self.student_path + '/studycourse/transcript.pdf') 116 self.assertEqual(self.browser.headers['Status'], '200 Ok') 117 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 118 path = os.path.join(samples_dir(), 'transcript.pdf') 119 open(path, 'wb').write(self.browser.contents) 120 print "Sample PDF transcript.pdf written to %s" % path 70 121
Note: See TracChangeset for help on using the changeset viewer.