Changeset 9253 for main


Ignore:
Timestamp:
28 Sep 2012, 09:56:23 (12 years ago)
Author:
Henrik Bettermann
Message:

Export always certcode which is very helpful for offline data evaluation. Also add current_level, current_session and is_postgrad to StudentExporter?.

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

Legend:

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

    r9235 r9253  
    105105    fields = tuple(sorted(iface_names(
    106106        IStudent, omit=['loggerInfo']))) + (
    107         'password', 'state', 'history', 'certcode')
     107        'password', 'state', 'history', 'certcode', 'is_postgrad',
     108        'current_level', 'current_session')
    108109
    109110    #: The title under which this exporter will be displayed
     
    176177    #: Fieldnames considered by this exporter
    177178    fields = tuple(sorted(iface_names(
    178         IStudentStudyLevel) + ['level'])) + ('student_id', 'number_of_tickets')
     179        IStudentStudyLevel) + ['level'])) + (
     180        'student_id', 'number_of_tickets','certcode')
    179181
    180182    #: The title under which this exporter will be displayed
     
    209211    fields = tuple(sorted(iface_names(ICourseTicket) +
    210212        ['level', 'code', 'title', 'credits',
    211         'passmark', 'semester', 'fcode', 'dcode'])) + ('student_id',)
     213        'passmark', 'semester', 'fcode', 'dcode'])) + ('student_id', 'certcode')
    212214
    213215    #: The title under which this exporter will be displayed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9235 r9253  
    429429    level = Attribute('The level code')
    430430    number_of_tickets = Attribute('Number of tickets contained in this level')
     431    certcode = Attribute('The certificate code of the study course')
    431432
    432433    level_session = schema.Choice(
     
    470471    fcode = Attribute('faculty code of the original course')
    471472    dcode = Attribute('department code of the original course')
     473    certcode = Attribute('certificate code of the study course')
    472474
    473475    mandatory = schema.Bool(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r9235 r9253  
    4343        try:
    4444            return self.__parent__.__parent__
     45        except AttributeError:
     46            return None
     47
     48    @property
     49    def certcode(self):
     50        try:
     51            return self.__parent__.certificate.code
    4552        except AttributeError:
    4653            return None
     
    124131            return None
    125132
     133    @property
     134    def certcode(self):
     135        try:
     136            return self.__parent__.__parent__.certificate.code
     137        except AttributeError:
     138            return None
     139
    126140    def writeLogMessage(self, view, message):
    127141        return self.__parent__.__parent__.__parent__.writeLogMessage(view, message)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r9235 r9253  
    4545            'firstname,lastname,matric_number,middlename,nationality,'
    4646            'perm_address,phone,reg_number,sex,student_id,suspended,password,'
    47             'state,history,certcode\r\n'
     47            'state,history,certcode,is_postgrad,current_level,current_session\r\n'
    4848
    4949            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
     
    6565            'firstname,lastname,matric_number,middlename,nationality,'
    6666            'perm_address,phone,reg_number,sex,student_id,suspended,password,'
    67             'state,history,certcode\r\n'
     67            'state,history,certcode,is_postgrad,current_level,current_session\r\n'
    6868
    6969            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
     
    8484            'firstname,lastname,matric_number,middlename,nationality,'
    8585            'perm_address,phone,reg_number,sex,student_id,suspended,password,'
    86             'state,history,certcode\r\n'
     86            'state,history,certcode,is_postgrad,current_level,current_session\r\n'
    8787
    8888            'my adm code,0,my clr code,1981-02-04#,anna@sample.com,,'
     
    210210            result,
    211211            'level,level_session,level_verdict,validated_by,validation_date,'
    212             'student_id,number_of_tickets\r\n'
    213             ',,0,,,,0\r\n'
     212            'student_id,number_of_tickets,certcode\r\n'
     213            ',,0,,,,0,\r\n'
    214214            )
    215215        return
     
    227227            result,
    228228            'level,level_session,level_verdict,validated_by,validation_date,'
    229             'student_id,number_of_tickets\r\n'
    230             '100,2012,A,,,A111111,1\r\n'
     229            'student_id,number_of_tickets,certcode\r\n'
     230            '100,2012,A,,,A111111,1,CERT1\r\n'
    231231            )
    232232        return
     
    242242            result,
    243243            'level,level_session,level_verdict,validated_by,validation_date,'
    244             'student_id,number_of_tickets\r\n'
    245             '100,2012,A,,,A111111,1\r\n'
     244            'student_id,number_of_tickets,certcode\r\n'
     245            '100,2012,A,,,A111111,1,CERT1\r\n'
    246246            )
    247247        return
     
    256256            result,
    257257            'level,level_session,level_verdict,validated_by,validation_date,'
    258             'student_id,number_of_tickets\r\n'
    259             '100,2012,A,,,A111111,1\r\n'
     258            'student_id,number_of_tickets,certcode\r\n'
     259            '100,2012,A,,,A111111,1,CERT1\r\n'
    260260            )
    261261        return
     
    292292            result,
    293293            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    294             'passmark,score,semester,title,student_id\r\n'
    295             '0,0,,,,,,0,,0,,,\r\n'
     294            'passmark,score,semester,title,student_id,certcode\r\n'
     295            '0,0,,,,,,0,,0,,,,\r\n'
    296296            )
    297297        return
     
    310310            result,
    311311            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    312             'passmark,score,semester,title,student_id\r\n'
    313             '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111\r\n'
     312            'passmark,score,semester,title,student_id,certcode\r\n'
     313            '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111,CERT1\r\n'
    314314            )
    315315        return
     
    325325            result,
    326326            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    327             'passmark,score,semester,title,student_id\r\n'
    328             '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111\r\n'
     327            'passmark,score,semester,title,student_id,certcode\r\n'
     328            '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111,CERT1\r\n'
    329329            )
    330330        return
     
    339339            result,
    340340            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    341             'passmark,score,semester,title,student_id\r\n'
    342             '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111\r\n'
     341            'passmark,score,semester,title,student_id,certcode\r\n'
     342            '1,1,CRS1,100,DEP1,FAC1,100,0,100,0,2,Course 1,A111111,CERT1\r\n'
    343343            )
    344344        return
Note: See TracChangeset for help on using the changeset viewer.