Changeset 10616


Ignore:
Timestamp:
11 Sep 2013, 06:03:04 (11 years ago)
Author:
Henrik Bettermann
Message:

Print cumulative params.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py

    r10615 r10616  
    6464                level_obj.gpa,
    6565                passed_params[4],
     66                level_obj.cumulative_params[3],
     67                level_obj.cumulative_params[4],
     68                level_obj.cumulative_params[0],
    6669                )
    6770        table.append(line)
     
    106109            TTR('Total Credits Passed'),
    107110            TTR('GPA'),
    108             'Courses Failed')
     111            'Courses Failed',
     112            TTR('Cum. Credits Taken'),
     113            TTR('Cum. Credits Passed'),
     114            TTR('CGPA'))
    109115    table = [col_names]
    110116    sn = 1
     
    157163        table_data = tbl_data_to_table(self.data)
    158164        #col_widths = [3.5*cm] * len(self.data[0])
    159         col_widths = [1*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm, 6*cm, ]
     165        col_widths = [1*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm,
     166                      6*cm, 0.8*cm, 0.8*cm, 0.8*cm]
    160167        pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string,
    161168                              STYLE["Normal"]),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py

    r10574 r10616  
    2727        result = get_students('fac1', 'dep1', 2010, 100)
    2828        self.assertEqual(result,
    29             [(u'K1000000', u'1234', u'Bob Tester', 30, 30, 5.0, [])])
     29            [(u'1234', u'Bob Tester', 30, 30, 5.0, [], 30, 30, 5.0)])
    3030        return
    3131
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r10598 r10616  
    149149        """
    150150        passed = failed = 0
    151         failed_courses = []
    152         failed_credits = 0
    153         passed_credits = 0
     151        courses_failed = []
     152        credits_failed = 0
     153        credits_passed = 0
    154154        for ticket in self.values():
    155155            if ticket.score is not None:
    156156                if ticket.score < ticket.passmark:
    157157                    failed += 1
    158                     failed_credits += ticket.credits
    159                     failed_courses.append(ticket.code)
     158                    credits_failed += ticket.credits
     159                    courses_failed.append(ticket.code)
    160160                else:
    161161                    passed += 1
    162                     passed_credits += ticket.credits
    163         return passed, failed, passed_credits, failed_credits, failed_courses
     162                    credits_passed += ticket.credits
     163        return passed, failed, credits_passed, credits_failed, courses_failed
    164164
    165165    @property
     
    171171        (including repeating levels). This method is used for level reports.
    172172        """
    173         passed_credits = 0
     173        credits_passed = 0
    174174        total_credits = 0
    175175        total_credits_counted = 0
     
    179179            if level.level > self.level:
    180180                continue
    181             passed_credits += level.passed_params[2]
     181            credits_passed += level.passed_params[2]
    182182            total_credits += level.total_credits
    183183            gpa_params = level.gpa_params
     
    187187            cgpa = round(total_credits_weighted / total_credits_counted, 3)
    188188        return (cgpa, total_credits_counted, total_credits_weighted,
    189                total_credits, passed_credits)
     189               total_credits, credits_passed)
    190190
    191191    @property
Note: See TracChangeset for help on using the changeset viewer.