Ignore:
Timestamp:
28 Oct 2018, 17:30:45 (6 years ago)
Author:
Henrik Bettermann
Message:

Implement study level 0 (Level Zero) option for storing for
orphaned course tickets (tickets without level information).
Add ticket_session field to ICourseTicket.

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

Legend:

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

    r15163 r15203  
    649649    `fcode` and `dcode` can nevermore be changed, neither via the user interface
    650650    nor by import. Other values can be overwritten by import.
     651
     652    `ticket_session` is an additional attribute which can be used to store the
     653    session of the course when it was taken. Usually this information is
     654    redundantbecause the the parent study level object already contains this
     655    information except for the study level zero container which can be used to
     656    store 'orphaned' course tickets.
    651657    """
    652658    grok.implements(IBatchProcessor)
     
    669675            'mandatory', 'score', 'carry_over', 'automatic',
    670676            'outstanding', 'course_category', 'level_session',
    671             'title', 'credits', 'passmark', 'semester'
     677            'title', 'credits', 'passmark', 'semester', 'ticket_session'
    672678            ] + self.additional_fields
    673679        return sorted(fields)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r15197 r15203  
    10301030        level_code = self.request.form.get('addlevel', None)
    10311031        level_session = self.request.form.get('level_session', None)
    1032         if not level_session:
     1032        if not level_session and not level_code == '0':
    10331033            self.flash(_('You must select a session for the level.'),
    10341034                       type="warning")
    10351035            self.redirect(self.url(self.context, u'@@manage')+'#tab2')
    10361036            return
     1037        if level_session and level_code == '0':
     1038            self.flash(_('Level zero must not be assigned a session.'),
     1039                       type="warning")
     1040            self.redirect(self.url(self.context, u'@@manage')+'#tab2')
     1041            return
    10371042        studylevel = createObject(u'waeup.StudentStudyLevel')
    10381043        studylevel.level = int(level_code)
    1039         studylevel.level_session = int(level_session)
     1044        if level_code != '0':
     1045            studylevel.level_session = int(level_session)
    10401046        try:
    10411047            self.context.addStudentStudyLevel(
     
    13061312        self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT
    13071313        self.level_dict = level_dict(self.context)
    1308         self.session_dict = dict(
     1314        self.session_dict = dict([(None, 'None'),] +
    13091315            [(item[1], item[0]) for item in academic_sessions()])
    13101316        self.studymode_dict = getUtility(IKofaUtils).STUDY_MODES_DICT
     
    13401346        self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT
    13411347        self.level_dict = level_dict(self.context)
    1342         self.session_dict = dict(
     1348        self.session_dict = dict([(None, 'None'),] +
    13431349            [(item[1], item[0]) for item in academic_sessions()])
    13441350        self.studymode_dict = getUtility(IKofaUtils).STUDY_MODES_DICT
     
    14831489        level_title = translate(self.context.level_title, 'waeup.kofa',
    14841490            target_language=lang)
    1485         return _('${a}: Study Level ${b}', mapping = {
     1491        return _('${a}: ${b}', mapping = {
    14861492            'a':self.context.student.display_fullname,
    14871493            'b':level_title})
     
    16131619        level_title = translate(self.context.level_title, 'waeup.kofa',
    16141620            target_language=lang)
    1615         return _('Manage study level ${a}',
     1621        return _('Manage ${a}',
    16161622            mapping = {'a':level_title})
    16171623
     
    17771783    grok.name('index')
    17781784    grok.require('waeup.viewStudent')
    1779     form_fields = grok.AutoFields(ICourseTicket).omit('course_category')
     1785    form_fields = grok.AutoFields(ICourseTicket).omit('course_category',
     1786        'ticket_session')
    17801787    grok.template('courseticketpage')
    17811788    pnav = 4
     
    18031810    form_fields['automatic'].for_display = True
    18041811    form_fields['carry_over'].for_display = True
     1812    form_fields['ticket_session'].for_display = True
    18051813    pnav = 4
    18061814    grok.template('courseticketmanagepage')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/transcript.pt

    r15163 r15203  
    4646                                      level['tickets_2'], level['tickets_3'])">
    4747      <tr tal:repeat="ticket semester_tickets">
    48         <td tal:content="python: view.level_dict[ticket.level]">LEVEL</td>
     48        <td tal:content="python: view.level_dict.get('ticket.level', ticket.level)">LEVEL</td>
    4949        <td tal:content="python: view.session_dict[ticket.level_session]">SESSION</td>
    5050        <td tal:content="python: view.semester_dict[ticket.semester]">SEMESTER</td>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r15197 r15203  
    1818#from datetime import datetime
    1919from zope.component import getUtility
    20 from zope.interface import Attribute, Interface
     20from zope.interface import Attribute, Interface, invariant, Invalid
    2121from zope import schema
    2222from zc.sourcefactory.contextual import BasicContextualSourceFactory
     
    662662        )
    663663
     664    ticket_session = schema.Choice(
     665        title = _(u'Imported Session'),
     666        source = academic_sessions_vocab,
     667        required = False,
     668        )
     669
    664670    passmark = schema.Int(
    665671        title = _(u'Passmark'),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv

    r9421 r15203  
    1 reg_number,matric_number,level,code,score,mandatory,level_session
    2 1,,100,COURSE1,1,True,
    3 2,,100,COURSE1,2,False,
    4 ,100002,100,COURSE1,3,False,
    5 1,,200,COURSE1,1,True,2008
    6 1,,nonsense,COURSE1,5,,
    7 1,,100,NONSENSE,5,,
    8 1,,200,COURSE1,6,,2004
    9 1,,300,COURSE1,6,,2008
    10 1,,300,COURSE1,6,,2008X
     1reg_number,matric_number,level,code,score,mandatory,level_session,ticket_session
     21,,100,COURSE1,1,True,,
     32,,100,COURSE1,2,False,,
     4,100002,100,COURSE1,3,False,,
     51,,200,COURSE1,1,True,2008,
     61,,nonsense,COURSE1,5,,,
     71,,100,NONSENSE,5,,,
     81,,200,COURSE1,6,,2004,
     91,,300,COURSE1,6,,2008,
     101,,300,COURSE1,6,,2008X,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r15163 r15203  
    957957        self.assertEqual(num_warns,5)
    958958        self.assertEqual(fail_file,
    959             'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    960             '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Not all parents do exist yet.\r\n'
    961             '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
    962             '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
    963             '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level object: does not exist\r\n'
    964             '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
     959            'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n'
     960            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Not all parents do exist yet.\r\n'
     961            '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     962            '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n'
     963            '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n'
     964            '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n')
    965965        assert self.processor.entryExists(
    966966            dict(reg_number='1', level='100', code='COURSE1'),
     
    10101010        self.assertEqual(num_warns,5)
    10111011        self.assertEqual(fail_file,
    1012             'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    1013             '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
    1014             '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
    1015             '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
    1016             '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level object: does not exist\r\n'
    1017             '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
     1012            'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n'
     1013            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
     1014            '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     1015            '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n'
     1016            '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n'
     1017            '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n')
    10181018        shutil.rmtree(os.path.dirname(fin_file))
    10191019
     
    10521052        self.assertEqual(num_warns,7)
    10531053        self.assertEqual(fail_file,
    1054             'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    1055             '1,COURSE1,True,100,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n'
    1056             '1,COURSE1,True,200,2008,1,<IGNORE>,Studycourse is locked.\r\n'
    1057             '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
    1058             '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
    1059             '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
    1060             '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level object: does not exist\r\n'
    1061             '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
     1054            'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n'
     1055            '1,COURSE1,True,100,<IGNORE>,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n'
     1056            '1,COURSE1,True,200,2008,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n'
     1057            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
     1058            '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     1059            '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n'
     1060            '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n'
     1061            '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n')
    10621062        shutil.rmtree(os.path.dirname(fin_file))
    10631063
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r15200 r15203  
    805805        self.browser.getLink("100").click()
    806806        self.assertMatches(
    807             '...: Study Level 100 (Year 1)...', self.browser.contents)
     807            '...: 100 (Year 1)...', self.browser.contents)
    808808        self.browser.getLink("Manage").click()
    809809        self.browser.getControl(name="form.level_session").value = ['2002']
     
    888888        self.browser.getLink("200").click()
    889889        self.assertMatches(
    890             '...: Study Level 200 (Year 2)...', self.browser.contents)
     890            '...: 200 (Year 2)...', self.browser.contents)
    891891        # Since COURSE1 has score 10 it becomes a carry-over course
    892892        # in level 200
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r15163 r15203  
    614614            result,
    615615            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    616             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     616            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    617617            'display_fullname\r\n'
    618             '0,0,,,,,,,,0,0,,,,,,,\r\n'
     618            '0,0,,,,,,,,0,0,,,,,,,,\r\n'
    619619            )
    620620        return
     
    633633            result,
    634634            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    635             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     635            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    636636            'display_fullname\r\n'
    637             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     637            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    638638            'Anna M. Tester\r\n'
    639639            )
     
    650650            result,
    651651            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    652             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     652            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    653653            'display_fullname\r\n'
    654             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     654            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    655655            'Anna M. Tester\r\n'
    656656            )
     
    666666            result,
    667667            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    668             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     668            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    669669            'display_fullname\r\n'
    670             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     670            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    671671            'Anna M. Tester\r\n'
    672672            )
     
    685685            result,
    686686            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    687             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     687            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    688688            'display_fullname\r\n'
    689             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     689            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    690690            'Anna M. Tester\r\n'
    691691            )
     
    699699            result,
    700700            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    701             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     701            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    702702            'display_fullname\r\n'
    703             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     703            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    704704            'Anna M. Tester\r\n'
    705705            )
     
    712712            result,
    713713            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    714             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     714            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    715715            'display_fullname\r\n'
    716             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     716            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    717717            'Anna M. Tester\r\n'
    718718            )
     
    724724            result,
    725725            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    726             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     726            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    727727            'display_fullname\r\n'
    728728                        )
     
    735735            result,
    736736            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    737             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     737            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    738738            'display_fullname\r\n'
    739739            )
     
    747747            result,
    748748            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    749             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     749            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    750750            'display_fullname\r\n'
    751             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     751            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    752752            'Anna M. Tester\r\n'
    753753            )
     
    758758            result,
    759759            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    760             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     760            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    761761            'display_fullname\r\n'
    762762            )
     
    771771            result,
    772772            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    773             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     773            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    774774            'display_fullname\r\n'
    775             '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     775            '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    776776            'Anna M. Tester\r\n'
    777777            )
     
    13451345             'student_id,state,certcode,faccode,depcode,is_postgrad,'
    13461346             'entry_session,current_level,current_session,'
    1347              '10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
     1347             '0,10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
    13481348             '510,520,600,610,620,700,710,720,800,810,820,900,910,920,999\r\n'
    1349              'A111111,created,CERT1,NA,NA,0,2010,200,2012,,2012'
     1349             'A111111,created,CERT1,NA,NA,0,2010,200,2012,,,2012'
    13501350             ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n',
    13511351            result
     
    13611361            'student_id,state,certcode,faccode,depcode,is_postgrad,'
    13621362            'entry_session,current_level,current_session,'
    1363             '10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
     1363            '0,10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
    13641364            '510,520,600,610,620,700,710,720,800,810,820,900,910,920,999\r\n'
    1365             'A111111,created,CERT1,NA,NA,0,2010,200,2012,,2012'
     1365            'A111111,created,CERT1,NA,NA,0,2010,200,2012,,,2012'
    13661366            ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n',
    13671367            result
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py

    r9778 r15203  
    6565        studylevelsource = StudyLevelSource().factory
    6666        values = studylevelsource.getValues(studycourse)
    67         self.assertEqual(values, [100, 110, 120, 200, 210, 220, 300, 310, 320,
     67        self.assertEqual(values, [0, 100, 110, 120, 200, 210, 220, 300, 310, 320,
    6868            400, 410, 420, 500, 510, 520, 600, 610, 620])
    6969        # All titles do exist
    7070        titles = [studylevelsource.getTitle(studycourse, value)
    7171            for value in values]
    72         self.assertEqual(len(titles), 18)
     72        self.assertEqual(len(titles), 19)
    7373        # Unfortunately, unittests don't know about internationalization
    7474        self.assertEqual(studylevelsource.getTitle(studycourse, None),
    7575            'Error: level id ${value} out of range')
    7676        self.assertEqual(studylevelsource.getTitle(studycourse, 0),
     77            'Level Zero')
     78        self.assertEqual(studylevelsource.getTitle(studycourse, 1),
    7779            'Error: level id ${value} out of range')
    7880        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
     
    9698        self.assertEqual(studylevelsource.getTitle(studycourse, 700),
    9799            'Error: level id ${value} out of range')
    98         # Now we modify the certificates to be a pure to pre-studies
     100        # Now we modify the certificates to be a pure pre-studies
    99101        # course
    100102        studycourse.certificate.start_level = 10
    101103        studycourse.certificate.end_level = 10
    102104        values = studylevelsource.getValues(studycourse)
    103         self.assertEqual(values, [10])
     105        self.assertEqual(values, [0, 10])
    104106        titles = [studylevelsource.getTitle(studycourse, value)
    105107            for value in values]
    106         self.assertEqual(len(titles), 1)
     108        self.assertEqual(len(titles), 2)
    107109        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
    108110            'Pre-Studies')
     
    115117        studycourse.certificate.end_level = 200
    116118        values = studylevelsource.getValues(studycourse)
    117         self.assertEqual(values, [10, 100, 110, 120,
     119        self.assertEqual(values, [0, 10, 100, 110, 120,
    118120            200, 210, 220, 300, 310, 320])
    119121        titles = [studylevelsource.getTitle(studycourse, value)
    120122            for value in values]
    121         self.assertEqual(len(titles), 10)
     123        self.assertEqual(len(titles), 11)
    122124        # Repeating Pre-Studies level does not exist and raises a KeyError
    123125        # when trying to get its title
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r15200 r15203  
    263263        headerline = []
    264264        tabledata = []
    265         subheader = '%s %s, %s %s' % (
    266             trans(_('Session'), lang),
    267             view.session_dict[level_obj.level_session],
    268             trans(_('Level'), lang),
    269             view.level_dict[level_obj.level])
     265        if 'evel' in view.level_dict.get('ticket.level', str(level_obj.level)):
     266            subheader = '%s %s, %s' % (
     267                trans(_('Session'), lang),
     268                view.session_dict[level_obj.level_session],
     269                view.level_dict.get('ticket.level', str(level_obj.level)))
     270        else:
     271            subheader = '%s %s, %s %s' % (
     272                trans(_('Session'), lang),
     273                view.session_dict[level_obj.level_session],
     274                trans(_('Level'), lang),
     275                view.level_dict.get('ticket.level', str(level_obj.level)))
    270276        data.append(Paragraph(subheader, HEADING_STYLE))
    271277        for element in tableheader:
  • main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py

    r14480 r15203  
    6969        start_level = int(certificate.start_level)
    7070        end_level = int(certificate.end_level)
    71     return levels_from_range(start_level, end_level)
     71    return [0,] + levels_from_range(start_level, end_level)
    7272
    7373class StudyLevelSource(BasicContextualSourceFactory):
     
    7777    first spillover level by the certificate's end level plus 100
    7878    and the second spillover level by the end level plus 110.
     79    The level zero contains all courses without level
     80    affiliation.
    7981    """
    8082    def getValues(self, context):
     
    105107        if value == 999:
    106108            return course_levels.by_value[999].title
     109        if value == 0:
     110            return _('Level Zero')
    107111        if start_level == 10 and end_level == 10 and value != 10:
    108112            return _('Error: level id ${value} out of range',
Note: See TracChangeset for help on using the changeset viewer.