Ignore:
Timestamp:
29 Jan 2025, 16:10:23 (39 hours ago)
Author:
Henrik Bettermann
Message:

Include Certcode and Students State (status) to Course Lecturer Exporter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/export.py

    r16721 r17997  
    1818"""Exporters for student related stuff.
    1919"""
     20from waeup.kofa.students.export import DataForLecturerExporter
    2021from kofacustom.unidel.students.interfaces import (
    2122    ICustomStudent,
     
    7475            'student_id','state','current_session')
    7576
     77class CustomDataForLecturerExporter(DataForLecturerExporter):
     78    """The Data for Lecturer Exporter searches for students in the course
     79    tickets catalog and exports those course tickets which belong to the
     80    given course code, meet level and session passed through at the
     81    same time, and which are editable by lecturers (disabled on 10/03/21).
     82    This exporter can only be called at course level in the academic section.
     83    """
     84
     85    fields = ('matric_number', 'student_id', 'display_fullname',
     86              'faccode', 'certcode', 'state',
     87              'level', 'code', 'level_session', 'score')
     88
     89    def mangle_value(self, value, name, context=None):
     90        """The mangler determines the student's id and fullname.
     91        """
     92        if context is not None:
     93            student = context.student
     94            if name in ('matric_number',
     95                        'reg_number',
     96                        'student_id',
     97                        'display_fullname',
     98                        'faccode',
     99                        'certcode',
     100                        'state',) and student is not None:
     101                value = getattr(student, name, None)
     102        return super(
     103            DataForLecturerExporter, self).mangle_value(
     104            value, name, context=context)
     105
Note: See TracChangeset for help on using the changeset viewer.