Changeset 1388 for WAeUP_SRP/trunk/skins/waeup_utilities
- Timestamp:
- 4 Feb 2007, 08:48:18 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py
r1387 r1388 40 40 res = scat() 41 41 for sbrain in res: 42 ec = " x"42 ec = "nor" 43 43 erg = context.results_import(matric_no=sbrain.matric_no) 44 44 if erg and erg[0].Level: … … 50 50 ec = "%s:%s!=%s<br />\n" % (sbrain.matric_no,level,e.Level) 51 51 level = "%d" % (int(level) + 100) 52 context.students_catalog.modifyRecord(id = sbrain.id, level=level) 52 53 # würde ich an dieser Stelle nicht machen (siehe unten) 54 #context.students_catalog.modifyRecord(id = sbrain.id, level=level) 55 53 56 while True: 54 57 student = getattr(students,sbrain.id,None) 55 ec = " s"58 ec = "nos" 56 59 if student is None: 57 60 break 58 ec = " S"61 ec = "nyr" 59 62 study_course = getattr(student,"study_course", None) 60 63 if study_course is None: 61 64 break 62 65 study_course.getContent().edit(mapping = {'current_level':level}) 63 ec += "C" 66 67 #dies ist der richtige Platz 68 context.students_catalog.modifyRecord(id = sbrain.id, level=level) 69 70 ec = "reg" 64 71 break 65 rwrite(ec) 66 count += 1 67 if count > 60: 68 lc += 1 69 rwrite("<br />\n%3d " % lc) 70 count = 0 72 if sbrain.level: 73 old_level = str(sbrain.level) 74 else: 75 old_level = 'non' 76 rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />") 77 78 else: 79 rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />") 80 # count += 1 81 # if count > 60: 82 # lc += 1 83 # rwrite("<br />\n%3d " % lc) 84 # count = 0 71 85 rwrite("<br />\n Done" ) 86 -
WAeUP_SRP/trunk/skins/waeup_utilities/removeResults.py
r1253 r1388 14 14 15 15 request = REQUEST 16 response = request.RESPONSE 17 18 def rwrite(s): 19 response.setHeader('Content-type','text/html; charset=ISO-8859-15') 20 #response.setHeader('Content-length','%d' % (len(s))) 21 #response.setStatus('OK') 22 response.write(s) 23 16 24 wftool = context.portal_workflow 17 25 mtool = context.portal_membership … … 19 27 roles = member.getRolesInContext(context) 20 28 rcat = context.results_import 29 scat = context.students_catalog 21 30 #from Products.zdb import set_trace;set_trace() 22 31 if str(member) not in ('admin','joachim'): 23 return 24 count = 0 32 return 33 rwrite("start <br />") 25 34 for m in rcat.uniqueValuesFor('matric_no'): 26 if m.startswith('ENG'): 27 res = rcat(matric_no = m) 35 #if m.startswith('ART'): 36 res_r = rcat(matric_no = m) 37 res_s = scat(matric_no = m) 38 if res_s and res_s[0].course == 'BARTTHR' and res_s[0].level =="500": 28 39 to_del = [] 29 for r in res :40 for r in res_r: 30 41 to_del.append(r.key) 31 for uid in to_del: 32 rcat.deleteRecord(uid) 33 count += len(to_del) 34 return "%d deleted" % count 42 43 #zum Testen auskommentiert 44 #for uid in to_del: 45 #rcat.deleteRecord(uid) 46 47 rwrite(m+" "+res_s[0].course+" "+res_s[0].level + " " + str(len(to_del)) +"<br />") 48 rwrite("<br />\n Done" )
Note: See TracChangeset for help on using the changeset viewer.