Ignore:
Timestamp:
5 Jan 2017, 08:36:18 (8 years ago)
Author:
Henrik Bettermann
Message:

Count and display the number of courses registered but not taken.

Location:
main/waeup.kofa/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r14293 r14368  
    441.4.2.dev0 (unreleased)
    55=======================
     6
     7* Level report: Count and display the number of courses registered but
     8  not taken.
    69
    710* Add control button to create graduated students.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py

    r14356 r14368  
    6969                level_obj.gpa_params[1],
    7070                passed_params[2],
     71                passed_params[5],
    7172                level_obj.gpa,
    7273                failed_courses,
     
    116117            TTR(translate(_('Total Credits Taken'))),
    117118            TTR(translate(_('Total Credits Passed'))),
     119            TTR(translate(_('Courses Without Result'))),
    118120            TTR(translate(_('GPA'))),
    119121            translate(_('Courses Failed')),
     
    127129        # Underline mandatory (core) courses
    128130        failed_courses = Paragraph(
    129             line[5].replace('m_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE)
    130         line = line[:5] + (failed_courses,) + line[6:]
     131            line[6].replace('m_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE)
     132        line = line[:6] + (failed_courses,) + line[7:]
    131133        # Superscript in remarks (needed by AAUE)
    132134        remark = Paragraph(
    133             line[9].replace('s_', '<super>').replace('_s', '</super>'), SMALL_PARA_STYLE)
    134         line = line[:9] + (remark,)
     135            line[10].replace('s_', '<super>').replace('_s', '</super>'), SMALL_PARA_STYLE)
     136        line = line[:10] + (remark,)
    135137        line = (sn,) + line
    136138        table.append(line)
     
    186188        table_data = tbl_data_to_table(self.data)
    187189        #col_widths = [3.5*cm] * len(self.data[0])
    188         col_widths = [1*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 1*cm,
     190        col_widths = [1*cm, 4*cm, 5*cm, 0.8*cm, 0.8*cm, 0.8*cm, 1*cm,
    189191                      6*cm, 0.8*cm, 0.8*cm, 1*cm, 2*cm]
    190192        pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py

    r14337 r14368  
    4141        result = get_students('fac1', 'dep1', 2010, 100)
    4242        self.assertEqual(result,
    43             [(u'1234', u'Bob Tester', 90, 30, 1.667, 'm_Course2_m Course3',
     43            [(u'1234', u'Bob Tester', 90, 30, 0, 1.667, 'm_Course2_m Course3',
    4444              90, 30, 1.667, '')])
    4545        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r14361 r14368  
    160160    def passed_params(self):
    161161        """Determine the number and credits of passed and failed courses.
     162        Count the number of courses registered but not taken.
    162163        This method is used for level reports.
    163164        """
     
    166167        credits_failed = 0
    167168        credits_passed = 0
     169        no_courses_not_taken = 0
    168170        for ticket in self.values():
    169171            if ticket.total_score is not None:
     
    178180                    passed += 1
    179181                    credits_passed += ticket.credits
    180         return passed, failed, credits_passed, credits_failed, courses_failed
     182            else:
     183                no_courses_not_taken += 1
     184        return (passed, failed, credits_passed,
     185                credits_failed, courses_failed,
     186                no_courses_not_taken)
    181187
    182188    @property
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r14293 r14368  
    894894        self.assertEqual(
    895895            self.student['studycourse']['100'].passed_params,
    896             (1, 1, 13, 10, 'COURSE1 '))
     896            (1, 1, 13, 10, 'COURSE1 ', 0))
    897897        self.assertEqual(
    898898            self.student['studycourse']['200'].passed_params,
    899             (0, 0, 0, 0, ''))
     899            (0, 0, 0, 0, '', 1))
    900900        # And also cumulative params can be calculated. Meanwhile we have the
    901901        # following courses: COURSE1 and COURSE2 in level 100 and
Note: See TracChangeset for help on using the changeset viewer.