Ignore:
Timestamp:
5 Jun 2013, 08:02:29 (12 years ago)
Author:
Henrik Bettermann
Message:

Remove gpa field. The GPA must not be an attribute of the level. It contains also information on carry over courses of following levels. Thus it can only be reliably calculated at the end of a study course, e.g. in transcripts.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r10267 r10276  
    785785        self.assertEqual(self.student['studycourse']['100']['COURSE1'].grade, 'C')
    786786        self.assertEqual(self.student['studycourse']['100']['COURSE1'].weight, 3)
    787         # We add another ticket to check if GPA will be correctly calculated
     787        # We add another ticket to check if GPAwill be correctly calculated
    788788        # (and rounded)
    789789        courseticket = createObject('waeup.CourseTicket')
     
    797797        self.student['studycourse']['100']['COURSE2'] = courseticket
    798798        self.browser.open(self.student_path + '/studycourse/100')
    799         self.assertTrue('<div>3.57</div>' in self.browser.contents)
    800         self.assertEqual(self.student['studycourse']['100'].gpa, 3.57)
     799        # total credits
     800        self.assertEqual(self.student['studycourse']['100'].gpa_params[1], 23)
     801        # weigheted credits = 3 * 10 + 4 * 13
     802        self.assertEqual(self.student['studycourse']['100'].gpa_params[2], 82.0)
     803        # sgpa = 82 / 23
     804        self.assertEqual(self.student['studycourse']['100'].gpa_params[0], 3.57)
    801805        # Carry-over courses will be collected when next level is created
    802806        self.browser.open(self.student_path + '/studycourse/manage')
     
    18361840        self.student['studycourse']['110']['COURSE2'] = courseticket
    18371841        self.student['studycourse']['100']['COURSE1'].score = 55
    1838         self.assertEqual(self.student['studycourse']['100'].gpa, 3.0)
    1839         self.assertEqual(self.student['studycourse']['110'].gpa, 4.0)
     1842        self.assertEqual(self.student['studycourse']['100'].gpa_params[0], 3.0)
     1843        self.assertEqual(self.student['studycourse']['110'].gpa_params[0], 4.0)
    18401844        # Get transcript data
    18411845        td = self.student['studycourse'].getTranscriptData()
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r10245 r10276  
    402402        self.assertEqual(
    403403            result,
    404             'gpa,level,level_session,level_verdict,total_credits,'
     404            'level,level_session,level_verdict,total_credits,'
    405405            'validated_by,validation_date,'
    406406            'student_id,number_of_tickets,certcode\r\n'
    407             '0.0,,,0,0,,,,0,\r\n'
     407            ',,0,0,,,,0,\r\n'
    408408            )
    409409        return
     
    420420        self.assertEqual(
    421421            result,
    422             'gpa,level,level_session,level_verdict,total_credits,'
     422            'level,level_session,level_verdict,total_credits,'
    423423            'validated_by,validation_date,'
    424424            'student_id,number_of_tickets,certcode\r\n'
    425             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     425            '100,2012,A,100,,,A111111,1,CERT1\r\n'
    426426            )
    427427        return
     
    436436        self.assertEqual(
    437437            result,
    438             'gpa,level,level_session,level_verdict,total_credits,'
     438            'level,level_session,level_verdict,total_credits,'
    439439            'validated_by,validation_date,'
    440440            'student_id,number_of_tickets,certcode\r\n'
    441             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     441            '100,2012,A,100,,,A111111,1,CERT1\r\n'
    442442            )
    443443        return
     
    451451        self.assertEqual(
    452452            result,
    453             'gpa,level,level_session,level_verdict,total_credits,'
     453            'level,level_session,level_verdict,total_credits,'
    454454            'validated_by,validation_date,'
    455455            'student_id,number_of_tickets,certcode\r\n'
    456             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     456            '100,2012,A,100,,,A111111,1,CERT1\r\n'
    457457            )
    458458        return
     
    470470        self.assertEqual(
    471471            result,
    472             'gpa,level,level_session,level_verdict,total_credits,'
     472            'level,level_session,level_verdict,total_credits,'
    473473            'validated_by,validation_date,'
    474474            'student_id,number_of_tickets,certcode\r\n'
    475             '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
     475            '100,2012,A,100,,,A111111,1,CERT1\r\n'
    476476            )
    477477        return
Note: See TracChangeset for help on using the changeset viewer.