Changeset 9690 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 20 Nov 2012, 06:17:36 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r9631 r9690 476 476 additional_headers = ['level'] 477 477 478 @property 479 def available_fields(self): 480 fields = super(StudentStudyLevelProcessor, self).available_fields 481 fields.remove('total_credits') 482 fields.remove('gpa') 483 return fields 484 478 485 def getParent(self, row, site): 479 486 student = self._getStudent(row, site) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9687 r9690 1107 1107 grok.template('studylevelmanagepage') 1108 1108 form_fields = grok.AutoFields(IStudentStudyLevel).omit( 1109 'validation_date', 'validated_by' )1109 'validation_date', 'validated_by', 'total_credits', 'gpa') 1110 1110 pnav = 4 1111 1111 taboneactions = [_('Save'),_('Cancel')] -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelpage.pt
r9687 r9690 15 15 </tr> 16 16 </tal:block> 17 <tr>18 <td i18n:translate="">19 Total Credits:20 </td>21 <td>22 <span tal:replace="view/context/total_credits">26</span>23 </td>24 </tr>25 <tr>26 <td i18n:translate="">27 Momentary GPA:28 </td>29 <td>30 <span tal:replace="python: '%4.2f' % view.context.gpa">2.33</span>31 </td>32 </tr>33 17 </tbody> 34 18 </table> -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r9687 r9690 480 480 certcode = Attribute('The certificate code of the study course') 481 481 is_current_level = Attribute('Is this level the current level of the student?') 482 total_credits = Attribute('Total of all ticket credits in this study level.')483 gpa = Attribute('Grade point average in this study level.')484 482 485 483 level_session = schema.Choice( … … 508 506 ) 509 507 508 total_credits = schema.Int( 509 title = _(u'Total Credits'), 510 required = False, 511 readonly = True, 512 ) 513 514 gpa = schema.Int( 515 title = _(u'GPA'), 516 required = False, 517 readonly = True, 518 ) 519 510 520 def addCourseTicket(ticket, course): 511 521 """Add a course ticket object. -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r9687 r9690 89 89 gpa += ticket.credits * ticket.weight 90 90 if credits_counted: 91 gpa = float(gpa)/credits_counted92 return gpa91 gpa = 100*gpa/credits_counted 92 return float(gpa)/100 93 93 94 94 @property … … 138 138 return 139 139 140 StudentStudyLevel = attrs_to_fields(StudentStudyLevel) 140 StudentStudyLevel = attrs_to_fields( 141 StudentStudyLevel, omit=['total_credits', 'gpa']) 141 142 142 143 class StudentStudyLevelFactory(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9687 r9690 767 767 # GPA has been properly calculated and is shown on the page 768 768 self.browser.open(self.student_path + '/studycourse/100') 769 self.assertTrue('3.0 0' in self.browser.contents)769 self.assertTrue('3.0' in self.browser.contents) 770 770 self.assertEqual(self.student['studycourse']['100'].gpa, 3.0) 771 771 # Carry-over courses will be collected when next level is created -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r9684 r9690 219 219 self.assertEqual( 220 220 result, 221 'level,level_session,level_verdict,validated_by,validation_date,' 221 'gpa,level,level_session,level_verdict,total_credits,' 222 'validated_by,validation_date,' 222 223 'student_id,number_of_tickets,certcode\r\n' 223 ' ,,0,,,,0,\r\n'224 '0.0,,,0,0,,,,0,\r\n' 224 225 ) 225 226 return … … 236 237 self.assertEqual( 237 238 result, 238 'level,level_session,level_verdict,validated_by,validation_date,' 239 'gpa,level,level_session,level_verdict,total_credits,' 240 'validated_by,validation_date,' 239 241 'student_id,number_of_tickets,certcode\r\n' 240 ' 100,2012,A,,,A111111,1,CERT1\r\n'242 '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n' 241 243 ) 242 244 return … … 251 253 self.assertEqual( 252 254 result, 253 'level,level_session,level_verdict,validated_by,validation_date,' 255 'gpa,level,level_session,level_verdict,total_credits,' 256 'validated_by,validation_date,' 254 257 'student_id,number_of_tickets,certcode\r\n' 255 ' 100,2012,A,,,A111111,1,CERT1\r\n'258 '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n' 256 259 ) 257 260 return … … 265 268 self.assertEqual( 266 269 result, 267 'level,level_session,level_verdict,validated_by,validation_date,' 270 'gpa,level,level_session,level_verdict,total_credits,' 271 'validated_by,validation_date,' 268 272 'student_id,number_of_tickets,certcode\r\n' 269 ' 100,2012,A,,,A111111,1,CERT1\r\n'273 '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n' 270 274 ) 271 275 return
Note: See TracChangeset for help on using the changeset viewer.