Changeset 1407 for WAeUP_SRP/trunk/skins/waeup_utilities
- Timestamp:
- 11 Feb 2007, 16:31:13 (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
r1401 r1407 18 18 setheader = request.RESPONSE.setHeader 19 19 20 #def rwrite(s):21 #response.setHeader('Content-type','text/html; charset=ISO-8859-15')22 #response.write(s)20 def rwrite(s): 21 response.setHeader('Content-type','text/html; charset=ISO-8859-15') 22 response.write(s) 23 23 24 24 wftool = context.portal_workflow … … 42 42 res = scat() 43 43 for sbrain in res: 44 old_level = str(sbrain.level)45 44 if str(sbrain.level) == '100': 46 45 ec = "new" … … 48 47 ec = "nor" 49 48 erg = context.results_import(matric_no=sbrain.matric_no) 50 lc = 'u'51 49 if erg and erg[0].Level: 52 lc = " e" # code for level status u = unset53 level = erg[0].Level50 lc = "N" 51 level_res = erg[0].Level 54 52 everdict = erg[0].Verdict 55 l nr= context.getLevelFromResultsCosCode(erg)56 if l nr== 0:53 level_cc = context.getLevelFromResultsCosCode(erg) 54 if level_cc == 0: 57 55 lc = "-" 58 if "%d00" % l nr != level:56 if "%d00" % level_cc != level_res: 59 57 lc = "!" 60 58 verdict,elegible = context.getVerdict(everdict) 61 59 if elegible: 62 lc = " +"63 level = "%d00" % (l nr+ 1)64 context.students_catalog.modifyRecord(id = sbrain.id,65 level="",66 verdict = "")60 lc = "S" 61 level = "%d00" % (level_cc + 1) 62 #context.students_catalog.modifyRecord(id = sbrain.id, 63 # level="", 64 # verdict = "") 67 65 while True: 68 66 student = getattr(students,sbrain.id,None) … … 74 72 if study_course is None: 75 73 break 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)74 #study_course.getContent().edit(mapping = {'current_level':level, 75 # 'current_verdict':verdict}) 76 #context.students_catalog.modifyRecord(id = sbrain.id, 77 # level=level, 78 # verdict=verdict) 81 79 ec = "reg" 82 80 break 83 81 84 # rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />") 85 86 lines.append('"%s %s","%s","%s","%s","%s","%s","%s"' % (lc,ec, 82 #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />") 83 s = '"%s","%s","%s","%s","%s","%s","%s","%s"' % (lc,ec, 87 84 sbrain.id, 88 85 sbrain.matric_no, 89 old_level,90 level ,86 level_res, 87 level_cc, 91 88 everdict, 92 verdict)) 89 verdict) 90 #lines.append(s) 91 else: 92 #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />") 93 s = '"","%s","%s","%s","",""' % (ec,sbrain.id,sbrain.matric_no) 94 #lines.append(s) 93 95 94 95 else: 96 # rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />") 97 lines.append('"%s","%s","%s","",""' % (ec,sbrain.id,sbrain.matric_no)) 98 96 rwrite("%s<br />" %s) 99 97 # count += 1 100 98 # if count > 60: … … 103 101 # count = 0 104 102 105 #rwrite("<br />\n Done" )103 rwrite("<br />\n Done" ) 106 104 107 setheader('Content-type','text/semicolon-seperated-values')108 setheader('Content-Disposition:', 'attachment; filename="fixLevelExport.csv"')109 setheader('Expires', 'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past110 setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1111 setheader('Cache-Control', 'post-check=0,pre-check=0')112 setheader('Pragma', 'no-cache') # HTTP/1.0113 return '\n'.join(lines)105 ##setheader('Content-type','text/semicolon-seperated-values') 106 ##setheader('Content-Disposition:', 'attachment; filename="fixLevelExport.csv"') 107 ##setheader('Expires', 'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past 108 ##setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1 109 ##setheader('Cache-Control', 'post-check=0,pre-check=0') 110 ##setheader('Pragma', 'no-cache') # HTTP/1.0 111 ##return '\n'.join(lines) 114 112 -
WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py
r1392 r1407 40 40 ec = 'cup' 41 41 #cat.modifyRecord(id = sb.id,entry_mode = em) 42 lines.append('"%s","%s","","%s",""' % (ec,sb.id, sb.em))42 lines.append('"%s","%s","","%s",""' % (ec,sb.id,em)) 43 43 #rwrite(ec +"--"+ sb.id +"--"+ em +"<br />") 44 44 else:
Note: See TracChangeset for help on using the changeset viewer.