Ignore:
Timestamp:
24 Feb 2022, 10:23:10 (3 years ago)
Author:
Henrik Bettermann
Message:

Improve export and reimport of previous study course data.

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

Legend:

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

    r16828 r16831  
    55=======================
    66
    7 * Add importers for previous study course data.
     7* Add `previous` field to `StudentStudyCourseProcessor`,
     8  `StudentStudyLevelProcessor` and `CourseTicketProcessor` to ensure
     9  that previous study course data are being imported into the right study
     10  course container.
    811
    912* Add exporters for previous study course data.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r16828 r16831  
    5151    FORBIDDEN_POSTGRAD_TRANS, FORBIDDEN_POSTGRAD_STATES)
    5252from waeup.kofa.utils.batching import BatchProcessor
     53
     54def studycourseName(row):
     55    previous = row.get('previous', None)
     56    if previous == '1':
     57        return 'studycourse_1'
     58    elif previous == '2':
     59        return 'studycourse_2'
     60    return 'studycourse'
    5361
    5462class StudentProcessor(BatchProcessor):
     
    485493    iface_transfer = IStudentStudyCourseTransfer
    486494    factory_name = 'waeup.StudentStudyCourse'
    487     studycourse_name = 'studycourse'
     495
     496    @property
     497    def available_fields(self):
     498        return super(
     499            StudentStudyCourseProcessor, self).available_fields + ['previous',]
    488500
    489501    def getParent(self, row, site):
     
    494506        if student is None:
    495507            return None
    496         return student.get(self.studycourse_name)
     508        return student.get(studycourseName(row))
     509
     510    def addEntry(self, obj, row, site):
     511        if studycourseName(row) == 'studycourse':
     512            raise NotImplementedError('method not availabe')
     513        parent = self.getParent(row, site)
     514        parent[studycourseName(row)] = obj
     515        return
    497516
    498517    def updateEntry(self, obj, row, site, filename):
     
    509528            student.transfer(
    510529                certificate=certificate, current_session=current_session)
    511             obj = student[self.studycourse_name]
     530            obj = student[studycourseName(row)]
    512531            # Once imported we must ensure that after export and reimport
    513532            # the student is not transferred again.
     
    589608    iface = IStudentStudyLevel
    590609    factory_name = 'waeup.StudentStudyLevel'
    591     studycourse_name = 'studycourse'
    592610
    593611    additional_fields_required = ['level']
     
    595613    @property
    596614    def available_fields(self):
    597         fields = super(StudentStudyLevelProcessor, self).available_fields
     615        fields = super(
     616            StudentStudyLevelProcessor, self).available_fields + ['previous',]
    598617        fields.remove('total_credits')
    599618        fields.remove('gpa')
     
    604623        if student is None:
    605624            return None
    606         return student[self.studycourse_name]
     625        return student[studycourseName(row)]
    607626
    608627    def getEntry(self, row, site):
     
    707726    iface = ICourseTicketImport
    708727    factory_name = 'waeup.CourseTicket'
    709     studycourse_name = 'studycourse'
    710728
    711729    additional_fields = ['level', 'code']
     
    719737            'outstanding', 'course_category', 'level_session',
    720738            'title', 'credits', 'passmark', 'semester', 'ticket_session',
    721             'unlock_score'
     739            'unlock_score', 'previous'
    722740            ] + self.additional_fields
    723741        return sorted(fields)
     
    727745        if student is None:
    728746            return None
    729         return student[self.studycourse_name].get(str(row['level']))
     747        return student[studycourseName(row)].get(str(row['level']))
    730748
    731749    def getEntry(self, row, site):
     
    10851103        notify(grok.ObjectModifiedEvent(obj.__parent__))
    10861104        return
    1087 
    1088 class FirstStudentStudyCourseProcessor(StudentStudyCourseProcessor):
    1089     """The First Student Study Course Processor imports first
    1090     study course data of students who have been transferred.
    1091     """
    1092     util_name = 'studycourseprocessor_1'
    1093     grok.name(util_name)
    1094     name = _('FirstStudentStudyCourse Processor')
    1095     studycourse_name = 'studycourse_1'
    1096 
    1097     def addEntry(self, obj, row, site):
    1098         parent = self.getParent(row, site)
    1099         parent[self.studycourse_name] = obj
    1100         return
    1101 
    1102 class FirstStudentStudyLevelProcessor(StudentStudyLevelProcessor):
    1103     """The First Student Study Level Processor imports study level data
    1104     into first study course containers of students who have been transferred.
    1105     """
    1106     util_name = 'studylevelprocessor_1'
    1107     grok.name(util_name)
    1108     name = _('FirstStudentStudyLevel Processor')
    1109     studycourse_name = 'studycourse_1'
    1110 
    1111 class FirstCourseTicketProcessor(CourseTicketProcessor):
    1112     """The First Course Ticket Processor imports course tickets into
    1113     first study level containers of students who have been transferred.
    1114     """
    1115     util_name = 'courseticketprocessor_1'
    1116     grok.name(util_name)
    1117     name = _('FirstCourseTicket Processor')
    1118     iface = ICourseTicketImport
    1119     factory_name = 'waeup.CourseTicket'
    1120     studycourse_name = 'studycourse_1'
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r16827 r16831  
    415415    """
    416416    grok.name('studentstudycourses')
    417 
    418     fields = tuple(sorted(iface_names(IStudentStudyCourse))) + ('student_id',)
     417    previous = 0
     418
     419    fields = tuple(sorted(iface_names(IStudentStudyCourse))) + (
     420        'student_id', 'previous')
    419421    title = _(u'Student Study Courses (Data Backup)')
    420422
     
    431433            student = context.student
    432434            value = getattr(student, name, None)
     435        if name == 'previous':
     436            return self.previous
    433437        return super(
    434438            StudentStudyCourseExporter, self).mangle_value(
     
    440444    """
    441445    grok.name('studentstudycourses_1')
    442 
     446    previous = 1
    443447    title = _(u'First Student Study Courses (Data Backup)')
    444448
     
    451455    """
    452456    grok.name('studentstudycourses_2')
    453 
     457    previous = 2
    454458    title = _(u'Second Student Study Courses (Data Backup)')
    455459
     
    465469    """
    466470    grok.name('studentstudylevels')
     471    previous = 0
    467472
    468473    fields = tuple(sorted(iface_names(
    469474        IStudentStudyLevel))) + (
    470         'student_id', 'number_of_tickets','certcode')
     475        'student_id', 'number_of_tickets','certcode', 'previous')
    471476    title = _(u'Student Study Levels (Data Backup)')
    472477
     
    480485            student = context.student
    481486            value = getattr(student, name, None)
     487        if name == 'previous':
     488            return self.previous
    482489        return super(
    483490            StudentStudyLevelExporter, self).mangle_value(
     
    489496    """
    490497    grok.name('studentstudylevels_1')
    491 
     498    previous = 1
    492499    title = _(u'First Course Student Study Levels (Data Backup)')
    493500
     
    500507    """
    501508    grok.name('studentstudylevels_2')
    502 
     509    previous = 2
    503510    title = _(u'Second Course Student Study Levels (Data Backup)')
    504511
     
    524531    fields = tuple(sorted(iface_names(ICourseTicket) +
    525532        ['level', 'code', 'level_session'])) + ('student_id',
    526         'certcode', 'display_fullname')
     533        'certcode', 'display_fullname', 'previous')
    527534    title = _(u'Course Tickets (Data Backup)')
     535    previous = 0
    528536
    529537    def filter_func(self, x, **kw):
     
    537545            if name in ('student_id', 'display_fullname') and student is not None:
    538546                value = getattr(student, name, None)
     547        if name == 'previous':
     548            return self.previous
    539549        return super(
    540550            CourseTicketExporter, self).mangle_value(
     
    546556    """
    547557    grok.name('coursetickets_1')
    548 
     558    previous = 1
    549559    title = _(u'First Course Course Tickets (Data Backup)')
    550560
     
    557567    """
    558568    grok.name('coursetickets_2')
    559 
     569    previous = 2
    560570    title = _(u'Second Course Course Tickets (Data Backup)')
    561571
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r16828 r16831  
    4040    StudentStudyLevelProcessor, CourseTicketProcessor,
    4141    StudentOnlinePaymentProcessor, StudentVerdictProcessor,
    42     FirstStudentStudyCourseProcessor,
    43     FirstStudentStudyLevelProcessor,
    44     FirstCourseTicketProcessor)
     42    )
    4543from waeup.kofa.students.payments import StudentOnlinePayment
    4644from waeup.kofa.students.student import Student
     
    9593    '\n')[0].split(',')
    9694
     95FIRST_STUDYCOURSE_SAMPLE_DATA = open(
     96    os.path.join(os.path.dirname(__file__), 'sample_first_studycourse_data.csv'),
     97    'rb').read()
     98
     99FIRST_STUDYCOURSE_HEADER_FIELDS = FIRST_STUDYCOURSE_SAMPLE_DATA.split(
     100    '\n')[0].split(',')
     101
    97102TRANSFER_SAMPLE_DATA = open(
    98103    os.path.join(os.path.dirname(__file__), 'sample_transfer_data.csv'),
     
    140145    '\n')[0].split(',')
    141146
     147FIRST_STUDYLEVEL_SAMPLE_DATA = open(
     148    os.path.join(os.path.dirname(__file__), 'sample_first_studylevel_data.csv'),
     149    'rb').read()
     150
     151FIRST_STUDYLEVEL_HEADER_FIELDS = FIRST_STUDYLEVEL_SAMPLE_DATA.split(
     152    '\n')[0].split(',')
     153
    142154COURSETICKET_SAMPLE_DATA = open(
    143155    os.path.join(os.path.dirname(__file__), 'sample_courseticket_data.csv'),
     
    145157
    146158COURSETICKET_HEADER_FIELDS = COURSETICKET_SAMPLE_DATA.split(
     159    '\n')[0].split(',')
     160
     161FIRST_COURSETICKET_SAMPLE_DATA = open(
     162    os.path.join(os.path.dirname(__file__), 'sample_first_courseticket_data.csv'),
     163    'rb').read()
     164
     165FIRST_COURSETICKET_HEADER_FIELDS = FIRST_COURSETICKET_SAMPLE_DATA.split(
    147166    '\n')[0].split(',')
    148167
     
    11411160
    11421161    def test_import_firstcourse_with_content(self):
    1143         processor = FirstStudentStudyCourseProcessor()
     1162        processor = StudentStudyCourseProcessor()
    11441163        csv_file = os.path.join(
    1145             self.workdir, 'sample_studycourse_data.csv')
     1164            self.workdir, 'sample_first_studycourse_data.csv')
     1165        open(csv_file, 'wb').write(FIRST_STUDYCOURSE_SAMPLE_DATA)
    11461166        num, num_warns, fin_file, fail_file = processor.doImport(
    1147             csv_file, STUDYCOURSE_HEADER_FIELDS,'create')
     1167            csv_file, FIRST_STUDYCOURSE_HEADER_FIELDS,'create')
    11481168        self.assertEqual(num_warns,1)
    11491169        content = open(fail_file).read()
    11501170        self.assertTrue('current_level: not in range' in content)
    1151         studycourse = processor.getEntry(dict(reg_number='1'), self.app)
     1171        studycourse = processor.getEntry(
     1172            dict(reg_number='1', previous='1'), self.app)
    11521173        self.assertEqual(studycourse.certificate.code, u'CERT1')
    11531174        self.assertEqual(studycourse.__name__, u'studycourse_1')
     
    11561177        self.assertEqual([i for i in results[0].keys()],
    11571178            [u'accommodation', u'payments', u'studycourse', u'studycourse_1'])
    1158         processor = FirstStudentStudyLevelProcessor()
     1179
     1180        processor = StudentStudyLevelProcessor()
    11591181        csv_file = os.path.join(
    1160             self.workdir, 'sample_studylevel_data.csv')
     1182            self.workdir, 'sample_first_studylevel_data.csv')
     1183        open(csv_file, 'wb').write(FIRST_STUDYLEVEL_SAMPLE_DATA)
    11611184        num, num_warns, fin_file, fail_file = processor.doImport(
    1162             csv_file, STUDYLEVEL_HEADER_FIELDS,'create')
     1185            csv_file, FIRST_STUDYLEVEL_HEADER_FIELDS,'create')
    11631186        self.assertEqual(num_warns,3)
    11641187        assert processor.entryExists(
     
    11721195        self.assertEqual([i for i in results[0]['studycourse_1'].keys()],
    11731196            [u'100', u'200'])
    1174         processor = FirstCourseTicketProcessor()
     1197
     1198        processor = CourseTicketProcessor()
    11751199        csv_file = os.path.join(
    1176             self.workdir, 'sample_courseticket_data.csv')
     1200            self.workdir, 'sample_first_courseticket_data.csv')
     1201        open(csv_file, 'wb').write(FIRST_COURSETICKET_SAMPLE_DATA)
    11771202        num, num_warns, fin_file, fail_file = processor.doImport(
    1178             csv_file, COURSETICKET_HEADER_FIELDS,'create')
     1203            csv_file, FIRST_COURSETICKET_HEADER_FIELDS,'create')
    11791204        assert processor.entryExists(
    1180             dict(reg_number='1', level='100', code='COURSE1'), self.app) is True
     1205            dict(reg_number='1', level='100',
     1206                 code='COURSE1', previous='1'), self.app) is True
    11811207        self.assertEqual([i for i in results[0]['studycourse_1']['100'].keys()],
    11821208            [u'COURSE1'])
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r16827 r16831  
    416416            result,
    417417            'certificate,current_level,current_session,current_verdict,'
    418             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    419 
    420             ',,,0,,,0,\r\n'
     418            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     419
     420            ',,,0,,,0,,0\r\n'
    421421            )
    422422        return
     
    433433            result,
    434434            'certificate,current_level,current_session,current_verdict,'
    435             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    436 
    437             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
     435            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     436
     437            'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n'
    438438            )
    439439        return
     
    449449            result,
    450450            'certificate,current_level,current_session,current_verdict,'
    451             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    452 
    453             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
     451            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     452
     453            'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n'
    454454            )
    455455        return
     
    464464            result,
    465465            'certificate,current_level,current_session,current_verdict,'
    466             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    467 
    468             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
     466            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     467
     468            'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n'
    469469            )
    470470        return
     
    483483            result,
    484484            'certificate,current_level,current_session,current_verdict,'
    485             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    486 
    487             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
     485            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     486
     487            'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n'
    488488            )
    489489        return
     
    501501            result,
    502502            'certificate,current_level,current_session,current_verdict,'
    503             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    504 
    505             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
     503            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     504
     505            'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n'
    506506            )
    507507        return
     
    519519            result,
    520520            'certificate,current_level,current_session,current_verdict,'
    521             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    522 
    523             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
     521            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     522
     523            'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n'
    524524            )
    525525        return
     
    549549            result,
    550550            'certificate,current_level,current_session,current_verdict,'
    551             'entry_mode,entry_session,previous_verdict,student_id\r\n'
     551            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
    552552            )
    553553        error = self.student.transfer(self.certificate2, current_session=2013)
     
    558558            result,
    559559            'certificate,current_level,current_session,current_verdict,'
    560             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    561             'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n')
     560            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     561            'CERT1,200,2012,0,ug_ft,2010,0,A111111,1\r\n')
    562562        error = self.student.transfer(self.certificate,
    563563                                      current_session=2014,
     
    570570            result,
    571571            'certificate,current_level,current_session,current_verdict,'
    572             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    573             'CERT2,,2013,,transfer,2010,,A111111\r\n')
     572            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     573            'CERT2,,2013,,transfer,2010,,A111111,2\r\n')
    574574        exporter = StudentStudyCourseExporter()
    575575        exporter.export_all(self.app, self.outfile)
     
    578578            result,
    579579            'certificate,current_level,current_session,current_verdict,'
    580             'entry_mode,entry_session,previous_verdict,student_id\r\n'
    581             'CERT1,300,2014,,transfer,2010,,A111111\r\n')
     580            'entry_mode,entry_session,previous_verdict,student_id,previous\r\n'
     581            'CERT1,300,2014,,transfer,2010,,A111111,0\r\n')
    582582        return
    583583
     
    591591            'gpa,level,level_session,level_verdict,total_credits,'
    592592            'transcript_remark,validated_by,validation_date,student_id,'
    593             'number_of_tickets,certcode\r\n'
     593            'number_of_tickets,certcode,previous\r\n'
    594594            )
    595595        error = self.student.transfer(self.certificate2, current_session=2013)
     
    601601            'gpa,level,level_session,level_verdict,total_credits,'
    602602            'transcript_remark,validated_by,validation_date,student_id,'
    603             'number_of_tickets,certcode\r\n'
    604             '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n' )
     603            'number_of_tickets,certcode,previous\r\n'
     604            '0.00,100,2012,A,100,,,,A111111,1,CERT1,1\r\n' )
    605605        study_level = StudentStudyLevel()
    606606        study_level.level_session = 2015
     
    620620            'gpa,level,level_session,level_verdict,total_credits,'
    621621            'transcript_remark,validated_by,validation_date,student_id,'
    622             'number_of_tickets,certcode\r\n'
    623             '0.00,400,2015,C,0,,,,A111111,0,CERT2\r\n')
     622            'number_of_tickets,certcode,previous\r\n'
     623            '0.00,400,2015,C,0,,,,A111111,0,CERT2,2\r\n')
    624624        exporter = StudentStudyLevelExporter()
    625625        exporter.export_all(self.app, self.outfile)
     
    629629            'gpa,level,level_session,level_verdict,total_credits,'
    630630            'transcript_remark,validated_by,validation_date,student_id,'
    631             'number_of_tickets,certcode\r\n')
     631            'number_of_tickets,certcode,previous\r\n')
    632632        return
    633633
     
    642642            'fcode,level,level_session,mandatory,outstanding,passmark,'
    643643            'score,semester,ticket_session,title,student_id,certcode,'
    644             'display_fullname\r\n'
     644            'display_fullname,previous\r\n'
    645645            )
    646646        error = self.student.transfer(self.certificate2, current_session=2013)
     
    653653            'fcode,level,level_session,mandatory,outstanding,passmark,'
    654654            'score,semester,ticket_session,title,student_id,certcode,'
    655             'display_fullname\r\n'
     655            'display_fullname,previous\r\n'
    656656            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,'
    657             'A111111,CERT1,Anna M. Tester\r\n')
     657            'A111111,CERT1,Anna M. Tester,1\r\n')
    658658        study_level = StudentStudyLevel()
    659659        study_level.level_session = 2015
     
    685685            'fcode,level,level_session,mandatory,outstanding,passmark,'
    686686            'score,semester,ticket_session,title,student_id,certcode,'
    687             'display_fullname\r\n1,1,CRS9,,150,DEP9,FAC9,400,2015,0,0,'
    688             '100,,2,,Course 9,A111111,CERT2,Anna M. Tester\r\n')
     687            'display_fullname,previous\r\n1,1,CRS9,,150,DEP9,FAC9,400,2015,0,0,'
     688            '100,,2,,Course 9,A111111,CERT2,Anna M. Tester,2\r\n')
    689689        exporter = CourseTicketExporter()
    690690        exporter.export_all(self.app, self.outfile)
     
    695695            'fcode,level,level_session,mandatory,outstanding,passmark,'
    696696            'score,semester,ticket_session,title,student_id,certcode,'
    697             'display_fullname\r\n'
     697            'display_fullname,previous\r\n'
    698698            )
    699699        return
     
    731731            'gpa,level,level_session,level_verdict,total_credits,'
    732732            'transcript_remark,validated_by,validation_date,'
    733             'student_id,number_of_tickets,certcode\r\n'
    734             '0.00,,,0,0,,,,,0,\r\n'
     733            'student_id,number_of_tickets,certcode,previous\r\n'
     734            '0.00,,,0,0,,,,,0,,0\r\n'
    735735            )
    736736        return
     
    749749            'gpa,level,level_session,level_verdict,total_credits,'
    750750            'transcript_remark,validated_by,validation_date,'
    751             'student_id,number_of_tickets,certcode\r\n'
    752             '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
     751            'student_id,number_of_tickets,certcode,previous\r\n'
     752            '0.00,100,2012,A,100,,,,A111111,1,CERT1,0\r\n'
    753753            )
    754754        return
     
    765765            'gpa,level,level_session,level_verdict,total_credits,'
    766766            'transcript_remark,validated_by,validation_date,'
    767             'student_id,number_of_tickets,certcode\r\n'
    768             '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
     767            'student_id,number_of_tickets,certcode,previous\r\n'
     768            '0.00,100,2012,A,100,,,,A111111,1,CERT1,0\r\n'
    769769            )
    770770        return
     
    780780            'gpa,level,level_session,level_verdict,total_credits,'
    781781            'transcript_remark,validated_by,validation_date,'
    782             'student_id,number_of_tickets,certcode\r\n'
    783             '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
     782            'student_id,number_of_tickets,certcode,previous\r\n'
     783            '0.00,100,2012,A,100,,,,A111111,1,CERT1,0\r\n'
    784784            )
    785785        return
     
    799799            'gpa,level,level_session,level_verdict,total_credits,'
    800800            'transcript_remark,validated_by,validation_date,'
    801             'student_id,number_of_tickets,certcode\r\n'
    802             '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
     801            'student_id,number_of_tickets,certcode,previous\r\n'
     802            '0.00,100,2012,A,100,,,,A111111,1,CERT1,0\r\n'
    803803            )
    804804        return
     
    818818            'gpa,level,level_session,level_verdict,total_credits,'
    819819            'transcript_remark,validated_by,validation_date,'
    820             'student_id,number_of_tickets,certcode\r\n'
    821             '0.00,100,2012,A,100,,,,A111111,1,CERT1\r\n'
     820            'student_id,number_of_tickets,certcode,previous\r\n'
     821            '0.00,100,2012,A,100,,,,A111111,1,CERT1,0\r\n'
    822822            )
    823823        return
     
    855855            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    856856            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    857             'display_fullname\r\n'
    858             '0,0,,,,,,,,0,0,,,,,,,,\r\n'
     857            'display_fullname,previous\r\n'
     858            '0,0,,,,,,,,0,0,,,,,,,,,0\r\n'
    859859            )
    860860        return
     
    874874            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    875875            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    876             'display_fullname\r\n'
     876            'display_fullname,previous\r\n'
    877877            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    878             'Anna M. Tester\r\n'
     878            'Anna M. Tester,0\r\n'
    879879            )
    880880        return
     
    891891            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    892892            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    893             'display_fullname\r\n'
     893            'display_fullname,previous\r\n'
    894894            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    895             'Anna M. Tester\r\n'
     895            'Anna M. Tester,0\r\n'
    896896            )
    897897        return
     
    907907            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    908908            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    909             'display_fullname\r\n'
     909            'display_fullname,previous\r\n'
    910910            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    911             'Anna M. Tester\r\n'
     911            'Anna M. Tester,0\r\n'
    912912            )
    913913        return
     
    926926            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    927927            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    928             'display_fullname\r\n'
     928            'display_fullname,previous\r\n'
    929929            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    930             'Anna M. Tester\r\n'
     930            'Anna M. Tester,0\r\n'
    931931            )
    932932        # We can set the course tickets level, semester and level_session
     
    940940            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    941941            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    942             'display_fullname\r\n'
     942            'display_fullname,previous\r\n'
    943943            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    944             'Anna M. Tester\r\n'
     944            'Anna M. Tester,0\r\n'
    945945            )
    946946        # 'all' does select all
     
    953953            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    954954            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    955             'display_fullname\r\n'
     955            'display_fullname,previous\r\n'
    956956            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    957             'Anna M. Tester\r\n'
     957            'Anna M. Tester,0\r\n'
    958958            )
    959959        # Level 200 tickets do not exist.
     
    965965            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    966966            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    967             'display_fullname\r\n'
     967            'display_fullname,previous\r\n'
    968968                        )
    969969        # Session 2013 tickets do not exist.
     
    976976            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    977977            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    978             'display_fullname\r\n'
     978            'display_fullname,previous\r\n'
    979979            )
    980980        # 1st semester tickets do not exist.
     
    987987            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    988988            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    989             'display_fullname\r\n'
     989            'display_fullname,previous\r\n'
    990990            )
    991991        # If the coursetickets catalog is used to filter students
     
    999999            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    10001000            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    1001             'display_fullname\r\n'
     1001            'display_fullname,previous\r\n'
    10021002            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    1003             'Anna M. Tester\r\n'
     1003            'Anna M. Tester,0\r\n'
    10041004            )
    10051005        exporter.export_filtered(
     
    10101010            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    10111011            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    1012             'display_fullname\r\n'
     1012            'display_fullname,previous\r\n'
    10131013            )
    10141014        # Also tickets in probating levels are exported. Therefore
     
    10231023            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    10241024            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    1025             'display_fullname\r\n'
     1025            'display_fullname,previous\r\n'
    10261026            '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    1027             'Anna M. Tester\r\n'
     1027            'Anna M. Tester,0\r\n'
    10281028            )
    10291029        return
Note: See TracChangeset for help on using the changeset viewer.