Changeset 1401 for WAeUP_SRP


Ignore:
Timestamp:
8 Feb 2007, 18:08:38 (18 years ago)
Author:
joachim
Message:

fix the levels
add verdict to students_catalog
add current_verdict to student_study_course
add the same fixes to makeStudentData (not yet tested)

Location:
WAeUP_SRP/trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r1319 r1401  
    8383    ###)
    8484
     85    security.declareProtected(ModifyPortalContent,'doCommit') ###(
     86    def doCommit(self,logger=None):
     87        "commit some transactions"
     88        transaction.commit()
     89    ###)
     90
    8591    security.declarePublic('loadStudentFoto') ###(
    8692    def loadStudentFoto(self,student):
     
    106112        return "successfully loaded passport picture"
    107113    ###)
    108 
    109114
    110115    security.declareProtected(ModifyPortalContent,'createOne') ###(
     
    182187            student = res[0]
    183188        logger.info('"%s", "creating Datastructure"' % student_id)
     189        s_results = self.results_import(matric_no = st.matric_no)
     190        lnr = self.getLevelFromResultsCosCode(s_results)
     191        level = "%d00" % lnr
     192        verdict,elegible = self.getVerdict(s_results[0].Verdict)
     193        if elegible:
     194            level = "%d00" % (lnr + 1)
     195##        level = s_results[0].Level
     196##        for result in s_results:
     197##            if level != result.Level:
     198##                logger.info('"%s", "Levels differ","%s != %s"' % (student_id,level,result.Level))
    184199        #student should not be allowed to perform this transition
    185200        #wftool = self.portal_workflow
     
    191206            em = 'Certificate %s org-code %s not found\n' % (certcode, certcode_org)
    192207            logger.info(em)
    193         level = student.Level
    194208        validlevel = False
    195209        try:
     
    223237        student_obj.invokeFactory('StudentPersonal','personal')
    224238        da['jamb_reg_no'] = student.Entryregno
    225         da['entry_mode'] = student.Mode_of_Entry
     239        em = student.Mode_of_Entry
     240        if em in ('DIRECT', 'DIRECT ENTRY',):
     241            em = 'DE'
     242        elif em in ('U.M.E', 'UNE',):
     243            em = 'UME'
     244        elif not em:
     245            em = "unknown"
     246        da['entry_mode'] = em
    226247        personal = student_obj.personal
    227248        self.portal_workflow.doActionFor(personal,'open',dest_container=personal)
     
    260281        catd['sex'] = dp['sex']
    261282        catd['level'] = level
     283        catd['verdict'] = verdict
    262284        if certificate_brain:
    263285            cpath = certificate_brain.getPath().split('/')
     
    274296        dsc = {}
    275297        dsc['study_course'] = certcode
     298        dsc['current_level'] = level
     299        dsc['current_verdict'] = verdict
    276300        studycourse.getContent().edit(mapping=dsc)
    277301        #
  • WAeUP_SRP/trunk/profiles/default/schemas/schema.xsl

    r1399 r1401  
    1313        <table>
    1414          <xsl:for-each select="object/field">
     15            <xsl:sort select="@name"
     16                      order="ascending" />
    1517            <tr>
    1618              <td colspan="">
  • WAeUP_SRP/trunk/profiles/default/schemas/student_study_course.xml

    r1399 r1401  
    77  </field>
    88  <field name="current_level" meta_type="CPS String Field"/>
     9  <field name="current_verdict" meta_type="CPS String Field"/>
    910</object>
  • WAeUP_SRP/trunk/profiles/default/students_catalog.xml

    r1319 r1401  
    11<?xml version="1.0"?>
     2<?xml-stylesheet type="text/xsl" href="catalog.xsl"?>
    23<object name="portal_catalog" meta_type="WAeUP Table">
    34 <column value="id"/>
     
    1213 <column value="phone"/>
    1314 <column value="level"/>
     15 <column value="verdict"/>
    1416 <column value="entry_mode"/>
    1517 <index name="id" meta_type="FieldIndex">
     
    1719 </index>
    1820 <index name="jamb_reg_no" meta_type="FieldIndex">
    19   <indexed_attr value="jamb_reg_no"/>
     21  <indexed_attr value="student_application:jamb_reg_no"/>
    2022 </index>
    2123 <index name="matric_no" meta_type="FieldIndex">
    22   <indexed_attr value="matric_no"/>
     24  <indexed_attr value="student_clearance:matric_no"/>
    2325 </index>
    2426 <index name="faculty" meta_type="KeywordIndex">
     
    2628 </index>
    2729 <index name="entry_mode" meta_type="KeywordIndex">
    28   <indexed_attr value="entry_mode"/>
     30  <indexed_attr value="student_application:entry_mode"/>
    2931 </index>
    3032 <index name="department" meta_type="KeywordIndex">
     
    3234 </index>
    3335 <index name="level" meta_type="KeywordIndex">
    34   <indexed_attr value="level"/>
     36  <indexed_attr value="student_study_course:current_level"/>
     37 </index>
     38 <index name="verdict" meta_type="KeywordIndex">
     39  <indexed_attr value="student_study_course:current_verdict"/>
    3540 </index>
    3641 <index name="course" meta_type="KeywordIndex">
    37   <indexed_attr value="course"/>
     42  <indexed_attr value="student_study_course:study_course"/>
    3843 </index>
    3944</object>
  • WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py

    r1134 r1401  
    102102info = {}
    103103info['used'] = []
     104#from Products.zdb import set_trace;set_trace()
    104105if context.portal_type == "ScratchCardBatch":
    105106    info['batch_doc'] = context.getContent()
  • WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py

    r1392 r1401  
    3434
    3535
    36 
    37 
    3836if str(member) not in ('admin','joachim'):
    3937    return
    4038count = 0
    41 lc = 1
     39line_count = 0
    4240lines = []
    4341#from Products.zdb import set_trace;set_trace()
    4442res = scat()
    4543for sbrain in res:
    46 
    4744    old_level = str(sbrain.level)
    48  
    4945    if str(sbrain.level) == '100':
    5046        ec = "new"
     
    5248        ec = "nor"
    5349    erg = context.results_import(matric_no=sbrain.matric_no)
     50    lc = 'u'
    5451    if erg and erg[0].Level:
    55         ec = "e"
     52        lc = "e" # code for level status u = unset
    5653        level = erg[0].Level
    57         for e in erg:
    58             ec = "E"
    59             if level != e.Level:
    60                 ec = "%s:%s!=%s<br />\n" % (sbrain.matric_no,level,e.Level)
    61         level = "%d" % (int(level) + 100)
    62 
    63         context.students_catalog.modifyRecord(id = sbrain.id, level="")
    64 
     54        everdict = erg[0].Verdict
     55        lnr = context.getLevelFromResultsCosCode(erg)
     56        if lnr == 0:
     57            lc = "-"
     58        if "%d00" % lnr != level:
     59            lc = "!"
     60        verdict,elegible = context.getVerdict(everdict)
     61        if elegible:
     62            lc = "+"
     63            level = "%d00" % (lnr + 1)
     64        context.students_catalog.modifyRecord(id = sbrain.id,
     65                                              level="",
     66                                              verdict = "")
    6567        while True:
    6668            student = getattr(students,sbrain.id,None)
     
    7274            if study_course is None:
    7375                break
    74 
    75             study_course.getContent().edit(mapping = {'current_level':level})
    76             context.students_catalog.modifyRecord(id = sbrain.id, level=level)
    77 
     76            study_course.getContent().edit(mapping = {'current_level':level,
     77                                                      'current_verdict':verdict})
     78            context.students_catalog.modifyRecord(id = sbrain.id,
     79                                                  level=level,
     80                                                  verdict=verdict)
    7881            ec = "reg"
    7982            break
     
    8184#        rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
    8285
    83         lines.append('"%s","%s","%s","%s","%s"' % (ec,sbrain.id,sbrain.matric_no,old_level,level))
     86        lines.append('"%s %s","%s","%s","%s","%s","%s","%s"' % (lc,ec,
     87                                                           sbrain.id,
     88                                                           sbrain.matric_no,
     89                                                           old_level,
     90                                                           level,
     91                                                           everdict,
     92                                                           verdict))
    8493       
    8594
     
    9099#    count += 1
    91100#    if count > 60:
    92 #        lc += 1
    93 #        rwrite("<br />\n%3d " % lc)
     101#        line_count += 1
     102#        rwrite("<br />\n%3d " % line_count)
    94103#        count = 0
    95104
Note: See TracChangeset for help on using the changeset viewer.