Changeset 1401 for WAeUP_SRP/trunk/skins/waeup_utilities
- Timestamp:
- 8 Feb 2007, 18:08:38 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.