Ignore:
Timestamp:
17 Jul 2022, 08:50:14 (2 years ago)
Author:
Henrik Bettermann
Message:

Add continuous assessment (ca) field.

Location:
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students
Files:
4 edited

Legend:

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

    r16949 r17025  
    2020from kofacustom.nigeria.students.batching import NigeriaStudentProcessor
    2121from waeup.kofa.students.batching import (
    22     StudentOnlinePaymentProcessor, StudentStudyLevelProcessor)
     22    StudentOnlinePaymentProcessor, StudentStudyLevelProcessor,
     23    CourseTicketProcessor)
    2324from kofacustom.unidel.students.interfaces import (
    2425    ICustomStudent,
     
    2627    ICustomStudentUpdateByMatricNo,
    2728    ICustomStudentOnlinePayment,
    28     ICustomStudentStudyLevel
     29    ICustomStudentStudyLevel,
     30    ICustomCourseTicketImport
    2931    )
    3032
     
    5355        fields.remove('total_credits_s2')
    5456        return  fields
     57
     58class CustomCourseTicketProcessor(CourseTicketProcessor):
     59    """A batch processor for ICourseTicket objects.
     60    """
     61    iface = ICustomCourseTicketImport
     62
     63    @property
     64    def available_fields(self):
     65        fields = [
     66            'student_id','reg_number','matric_number',
     67            'mandatory', 'score', 'ca', 'carry_over', 'automatic',
     68            'level_session', 'outstanding', 'course_category',
     69            'title', 'credits', 'passmark', 'semester', 'ticket_session',
     70            'unlock_score', 'previous'
     71            ] + self.additional_fields
     72        return sorted(fields)
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py

    r16977 r17025  
    2929    StudyLevelEditFormPage, StudyLevelDisplayFormPage, StudyLevelManageFormPage,
    3030    StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip,
    31     CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage,
     31    CourseTicketDisplayFormPage, CourseTicketManageFormPage,
     32    StudentTriggerTransitionFormPage,
    3233    PaymentsManageFormPage, msave, emit_lock_message)
    3334from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket
     
    4950    ICustomStudentStudyLevel,
    5051    ICustomUGStudentClearance,
    51     ICustomPGStudentClearance)
     52    ICustomPGStudentClearance,
     53    ICustomCourseTicket)
    5254from kofacustom.unidel.interfaces import MessageFactory as _
    5355
     
    151153                [_('Faculty Officer\'s Signature')],
    152154                [_('Student\'s Signature')])
     155
     156class CustomCourseTicketDisplayFormPage(CourseTicketDisplayFormPage):
     157    """ Page to display course tickets
     158    """
     159
     160    @property
     161    def form_fields(self):
     162        return grok.AutoFields(ICustomCourseTicket).omit('course_category',
     163            'ticket_session')
     164
     165class CustomCourseTicketManageFormPage(CourseTicketManageFormPage):
     166    """ Page to manage course tickets
     167    """
     168   
     169    form_fields = grok.AutoFields(ICustomCourseTicket).omit('course_category')
     170    form_fields['title'].for_display = True
     171    form_fields['fcode'].for_display = True
     172    form_fields['dcode'].for_display = True
     173    form_fields['semester'].for_display = True
     174    form_fields['passmark'].for_display = True
     175    form_fields['credits'].for_display = True
     176    form_fields['mandatory'].for_display = False
     177    form_fields['automatic'].for_display = True
     178    form_fields['carry_over'].for_display = True
     179    form_fields['ticket_session'].for_display = True
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/interfaces.py

    r16949 r17025  
    1919from zope import schema
    2020from waeup.kofa.students.vocabularies import StudyLevelSource
     21from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab)
    2122from kofacustom.nigeria.students.interfaces import (
    2223    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    107108    """
    108109
     110    score = schema.Int(
     111        title = _(u'Score'),
     112        required = False,
     113        readonly = False,
     114        max = 100,
     115        )
     116
     117    ca = schema.Int(
     118        title = _(u'CA'),
     119        default = None,
     120        required = False,
     121        missing_value = None,
     122        max = 90,
     123        )
     124
     125ICustomCourseTicket['score'].order = INigeriaCourseTicket['score'].order
     126ICustomCourseTicket['ca'].order = ICustomCourseTicket['score'].order
     127
     128class ICustomCourseTicketImport(ICustomCourseTicket):
     129    """An interface for importing course results and nothing more.
     130    """
     131   
     132    score = schema.Int(
     133        title = _(u'Score'),
     134        required = False,
     135        readonly = False,
     136        max = 100,
     137        )
     138
     139    ca = schema.Int(
     140        title = _(u'CA'),
     141        required = False,
     142        readonly = False,
     143        max = 90,
     144        )
     145
     146    level_session = schema.Choice(
     147        title = _(u'Level Session'),
     148        source = academic_sessions_vocab,
     149        required = False,
     150        readonly = False,
     151        )
     152
     153
    109154class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
    110155    """Representation of a student. Skip regular reg_number validation.
  • main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/studylevel.py

    r16949 r17025  
    8181    grok.provides(ICustomCourseTicket)
    8282
     83    @property
     84    def total_score(self):
     85        """Returns ca + score or imported total score.
     86        """
     87        if self.outstanding:
     88            return None
     89        # Override total_score if value has been imported
     90        if getattr(self, 'imported_ts', None):
     91            return self.imported_ts
     92        if self.score == -1:
     93            return 0
     94        if not None in (self.score, self.ca):
     95            return self.score + self.ca
     96        return None
    8397
    8498CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
Note: See TracChangeset for help on using the changeset viewer.