- Timestamp:
- 8 Feb 2007, 18:08:38 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTool.py
r1319 r1401 83 83 ###) 84 84 85 security.declareProtected(ModifyPortalContent,'doCommit') ###( 86 def doCommit(self,logger=None): 87 "commit some transactions" 88 transaction.commit() 89 ###) 90 85 91 security.declarePublic('loadStudentFoto') ###( 86 92 def loadStudentFoto(self,student): … … 106 112 return "successfully loaded passport picture" 107 113 ###) 108 109 114 110 115 security.declareProtected(ModifyPortalContent,'createOne') ###( … … 182 187 student = res[0] 183 188 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)) 184 199 #student should not be allowed to perform this transition 185 200 #wftool = self.portal_workflow … … 191 206 em = 'Certificate %s org-code %s not found\n' % (certcode, certcode_org) 192 207 logger.info(em) 193 level = student.Level194 208 validlevel = False 195 209 try: … … 223 237 student_obj.invokeFactory('StudentPersonal','personal') 224 238 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 226 247 personal = student_obj.personal 227 248 self.portal_workflow.doActionFor(personal,'open',dest_container=personal) … … 260 281 catd['sex'] = dp['sex'] 261 282 catd['level'] = level 283 catd['verdict'] = verdict 262 284 if certificate_brain: 263 285 cpath = certificate_brain.getPath().split('/') … … 274 296 dsc = {} 275 297 dsc['study_course'] = certcode 298 dsc['current_level'] = level 299 dsc['current_verdict'] = verdict 276 300 studycourse.getContent().edit(mapping=dsc) 277 301 # -
WAeUP_SRP/trunk/profiles/default/schemas/schema.xsl
r1399 r1401 13 13 <table> 14 14 <xsl:for-each select="object/field"> 15 <xsl:sort select="@name" 16 order="ascending" /> 15 17 <tr> 16 18 <td colspan=""> -
WAeUP_SRP/trunk/profiles/default/schemas/student_study_course.xml
r1399 r1401 7 7 </field> 8 8 <field name="current_level" meta_type="CPS String Field"/> 9 <field name="current_verdict" meta_type="CPS String Field"/> 9 10 </object> -
WAeUP_SRP/trunk/profiles/default/students_catalog.xml
r1319 r1401 1 1 <?xml version="1.0"?> 2 <?xml-stylesheet type="text/xsl" href="catalog.xsl"?> 2 3 <object name="portal_catalog" meta_type="WAeUP Table"> 3 4 <column value="id"/> … … 12 13 <column value="phone"/> 13 14 <column value="level"/> 15 <column value="verdict"/> 14 16 <column value="entry_mode"/> 15 17 <index name="id" meta_type="FieldIndex"> … … 17 19 </index> 18 20 <index name="jamb_reg_no" meta_type="FieldIndex"> 19 <indexed_attr value=" jamb_reg_no"/>21 <indexed_attr value="student_application:jamb_reg_no"/> 20 22 </index> 21 23 <index name="matric_no" meta_type="FieldIndex"> 22 <indexed_attr value=" matric_no"/>24 <indexed_attr value="student_clearance:matric_no"/> 23 25 </index> 24 26 <index name="faculty" meta_type="KeywordIndex"> … … 26 28 </index> 27 29 <index name="entry_mode" meta_type="KeywordIndex"> 28 <indexed_attr value=" entry_mode"/>30 <indexed_attr value="student_application:entry_mode"/> 29 31 </index> 30 32 <index name="department" meta_type="KeywordIndex"> … … 32 34 </index> 33 35 <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"/> 35 40 </index> 36 41 <index name="course" meta_type="KeywordIndex"> 37 <indexed_attr value=" course"/>42 <indexed_attr value="student_study_course:study_course"/> 38 43 </index> 39 44 </object> -
WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py
r1134 r1401 102 102 info = {} 103 103 info['used'] = [] 104 #from Products.zdb import set_trace;set_trace() 104 105 if context.portal_type == "ScratchCardBatch": 105 106 info['batch_doc'] = context.getContent() -
WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py
r1392 r1401 34 34 35 35 36 37 38 36 if str(member) not in ('admin','joachim'): 39 37 return 40 38 count = 0 41 l c = 139 line_count = 0 42 40 lines = [] 43 41 #from Products.zdb import set_trace;set_trace() 44 42 res = scat() 45 43 for sbrain in res: 46 47 44 old_level = str(sbrain.level) 48 49 45 if str(sbrain.level) == '100': 50 46 ec = "new" … … 52 48 ec = "nor" 53 49 erg = context.results_import(matric_no=sbrain.matric_no) 50 lc = 'u' 54 51 if erg and erg[0].Level: 55 ec = "e"52 lc = "e" # code for level status u = unset 56 53 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 = "") 65 67 while True: 66 68 student = getattr(students,sbrain.id,None) … … 72 74 if study_course is None: 73 75 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) 78 81 ec = "reg" 79 82 break … … 81 84 # rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />") 82 85 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)) 84 93 85 94 … … 90 99 # count += 1 91 100 # if count > 60: 92 # l c+= 193 # rwrite("<br />\n%3d " % l c)101 # line_count += 1 102 # rwrite("<br />\n%3d " % line_count) 94 103 # count = 0 95 104
Note: See TracChangeset for help on using the changeset viewer.