Changeset 15229


Ignore:
Timestamp:
11 Nov 2018, 21:22:33 (6 years ago)
Author:
Henrik Bettermann
Message:

Remove CA column if not needed.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py

    r15228 r15229  
    10841084        passed = 0
    10851085        failed = 0
     1086        with_ca = False
    10861087        # In AAUE only editable tickets can be printed
    10871088        for ticket in sorted_tickets:
     1089            if ticket.ca > 0:
     1090                with_ca = True
    10881091            total = ticket.total_score
    10891092            grade = ticket._getGradeWeightFromScore[0]
     
    11191122        dep = self.context.__parent__.__parent__.longtitle
    11201123        fac = self.context.__parent__.__parent__.__parent__.longtitle
     1124        # remove CA column if not necessary
     1125        if not with_ca:
     1126            header = [[_(''),
     1127                       _('Student Id'),
     1128                       _('Matric No.'),
     1129                       #_('Reg. No.'),
     1130                       #_('Fullname'),
     1131                       #_('Status'),
     1132                       #_('Course of\nStudies'),
     1133                       _('Department'),
     1134                       _('Level'),
     1135                       #_(' CA  '),
     1136                       _('Exam\nScore'),
     1137                       _('Total '),
     1138                       _('Grade'),
     1139                       ],]
     1140            for ticket in tickets:
     1141                del(ticket[5])
    11211142        return header + tickets, [
    11221143            dep, fac, total, passed, passed_perc, failed, failed_perc]
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r15198 r15229  
    424424        open(path, 'wb').write(self.browser.contents)
    425425        print "Sample PDF coursetickets.pdf written to %s" % path
     426        # The CA column is not shown if CA is not used
     427        self.student['studycourse']['100']['COURSE1'].ca = 0
     428        self.browser.open(pdf_url)
     429        path = os.path.join(samples_dir(), 'coursetickets_wo_ca.pdf')
     430        open(path, 'wb').write(self.browser.contents)
     431        print "Sample PDF coursetickets_wo_ca.pdf written to %s" % path
    426432
    427433    def test_lecturers_do_only_see_selected_students(self):
Note: See TracChangeset for help on using the changeset viewer.