Changeset 14382 for main/waeup.kofa/trunk/src
- Timestamp:
- 10 Jan 2017, 18:33:30 (8 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/transcript.pt
r11551 r14382 21 21 </td> 22 22 <td> 23 <div tal:content="python: tdata[1]">GPA</div>23 <div tal:content="python:'%.3f' % tdata[1]">GPA</div> 24 24 </td> 25 25 </tr> -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r14373 r14382 71 71 passed_params[2], 72 72 passed_params[5], 73 level_obj.gpa,73 '%.2f' % (int(100*level_obj.gpa)/100.0), 74 74 failed_courses, 75 75 level_obj.cumulative_params[1], 76 76 level_obj.cumulative_params[4], 77 level_obj.cumulative_params[0],77 '%.3f' % (int(1000*level_obj.cumulative_params[0])/1000.0), 78 78 remark, 79 79 ) … … 115 115 'S/N', 116 116 'Matric No.', 117 'Name',117 translate(_('Student Name')), 118 118 TTR(translate(_('Total Credits Taken'))), 119 119 TTR(translate(_('Total Credits Passed'))), … … 197 197 pdf_data += [Paragraph( 198 198 translate( 199 '${a}<br />${b}<br /> Level: ${c}<br />Session: ${d}',199 '${a}<br />${b}<br />Session: ${c}<br />Level: ${d}', 200 200 mapping = {'a':self.factitle, 201 201 'b':self.deptitle, 202 'c':self.level, 203 'd':self.session, }), 202 'c':self.session, 203 'd':self.level, 204 }), 204 205 STYLE["Normal"]), 205 206 Spacer(1, 12),] -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py
r14373 r14382 150 150 STYLE["Normal"]), 151 151 Spacer(1, 12),] 152 pdf_data += [Paragraph('%s<br />%s<br /> Level: %s<br />Session: %s' % (153 self.factitle, self.deptitle, self. level, self.session),152 pdf_data += [Paragraph('%s<br />%s<br />Session: %s<br />Level: %s' % ( 153 self.factitle, self.deptitle, self.session, self.level), 154 154 STYLE["Normal"]), 155 155 Spacer(1, 12),] … … 175 175 pdf_data += [Paragraph('<strong>Summary</strong>', STYLE["Normal"])] 176 176 pdf_data.append(Spacer(1, 10)) 177 total_count = 0 177 178 for gpa_class in range(len(students_utils.gpa_boundaries)-1,-1,-1): 178 179 gpa_class_name = students_utils.gpa_boundaries[gpa_class][1] 179 180 gpa_count = len(self.data[gpa_class]) 181 total_count += gpa_count 180 182 pdf_data += [Paragraph('%s: %s' 181 183 % (gpa_class_name, gpa_count), STYLE["Normal"])] 182 184 pass 185 pdf_data += [Paragraph('Total: %s' % (total_count), STYLE["Normal"])] 183 186 184 187 doc_title = translate(_('Presentation of Session Results')) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r14373 r14382 41 41 result = get_students('fac1', 'dep1', 2010, 100) 42 42 self.assertEqual(result, 43 [(u'1234', u'Bob Tester', 90, 30, 0, 1.667, 'm_Course2_m Course3',44 90, 30, 1.667, '')])43 [(u'1234', u'Bob Tester', 90, 30, 0, '1.66', 44 'm_Course2_m Course3', 90, 30, '1.666', '')]) 45 45 return 46 46 -
main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py
r14361 r14382 120 120 return 121 121 122 def _display_gpa(self, gpa):123 return round(gpa, 2)124 125 122 def getTranscriptData(self): 126 123 """Get a sorted list of dicts with level and course ticket data. … … 155 152 sgpa=sgpa)) 156 153 if total_credits_counted: 157 cgpa = self._display_gpa(cgpa/total_credits_counted)154 cgpa = cgpa/total_credits_counted 158 155 # Override cgpa if value has been imported 159 156 # (not implemented in base package) -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r14368 r14382 108 108 return session_string 109 109 110 def _display_gpa(self, gpa):111 return round(gpa, 3)112 113 110 @property 114 111 def gpa_params_rectified(self): … … 130 127 credits_weighted += ticket.credits * ticket.weight 131 128 if credits_counted: 132 level_gpa = self._display_gpa(credits_weighted/credits_counted)129 level_gpa = credits_weighted/credits_counted 133 130 return level_gpa, credits_counted, credits_weighted 134 131 … … 145 142 credits_weighted += ticket.credits * ticket.weight 146 143 if credits_counted: 147 level_gpa = self._display_gpa(credits_weighted/credits_counted)144 level_gpa = credits_weighted/credits_counted 148 145 # Override level_gpa if value has been imported 149 146 # (not implemented in base package) … … 210 207 total_credits_weighted += gpa_params[2] 211 208 if total_credits_counted: 212 cgpa = self._display_gpa(total_credits_weighted/total_credits_counted)209 cgpa = total_credits_weighted/total_credits_counted 213 210 # Override cgpa if value has been imported 214 211 # (not implemented in base package) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r14368 r14382 874 874 # sgpa = 82 / 23 875 875 self.assertEqual( 876 self.student['studycourse']['100'].gpa_params_rectified[0], 3.565) 876 self.student['studycourse']['100'].gpa_params_rectified[0], 877 3.5652173913043477) 877 878 # Carry-over courses will be collected when next level is created 878 879 self.browser.open(self.student_path + '/studycourse/manage') … … 903 904 self.assertEqual( 904 905 self.student['studycourse']['100'].cumulative_params, 905 (2.26 1, 23, 52.0, 23, 13))906 (2.260869565217391, 23, 52.0, 23, 13)) 906 907 # COURSE1 in level 200 is not taken into consideration 907 908 # when calculating the gpa. 908 909 self.assertEqual( 909 910 self.student['studycourse']['200'].cumulative_params, 910 (2.26 1, 23, 52.0, 33, 13))911 (2.260869565217391, 23, 52.0, 33, 13)) 911 912 return 912 913 … … 2103 2104 self.assertEqual(td[0][1]['level'].level_session, 2006) 2104 2105 self.assertEqual(td[0][1]['tickets_1'][0].code, 'ANYCODE') 2105 self.assertEqual(td[1], 3.5 7)2106 self.assertEqual(td[1], 3.5652173913043477) 2106 2107 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 2107 2108 self.browser.open(self.student_path + '/studycourse/transcript') -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r14319 r14382 282 282 element[2]*cm for element in tableheader], style=CONTENT_STYLE) 283 283 data.append(table) 284 sgpa = '%s: % s' % (trans('Sessional GPA (rectified)', lang), level['sgpa'])284 sgpa = '%s: %.2f' % (trans('Sessional GPA (rectified)', lang), level['sgpa']) 285 285 data.append(Paragraph(sgpa, style["Normal"])) 286 286 return data … … 882 882 transcript_data = view.context.getTranscriptData() 883 883 levels_data = transcript_data[0] 884 gpa = transcript_data[1]885 884 886 885 contextdata = [] … … 921 920 f_label = trans(_('Cumulative GPA:'), portal_language) 922 921 f_label = Paragraph(f_label, ENTRY1_STYLE) 923 f_text = formatted_text('%s (%s)' % (gpa, self.getClassFromCGPA(gpa)[1])) 922 f_text = formatted_text('%.3f (%s)' % ( 923 transcript_data[1], self.getClassFromCGPA(transcript_data[1])[1])) 924 924 f_text = Paragraph(f_text, ENTRY1_STYLE) 925 925 contextdata.append([f_label,f_text])
Note: See TracChangeset for help on using the changeset viewer.