Changeset 1498 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 26 Feb 2007, 16:00:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/create_level.py
r1495 r1498 14 14 from Products.AdvancedQuery import Eq, Between, Le,In 15 15 aq_portal = context.portal_catalog.evalAdvancedQuery 16 aq_courses = context.courses_catalog.evalAdvancedQuery 16 17 17 18 current = DateTime.DateTime() … … 21 22 redirect = response.redirect 22 23 logger = logging.getLogger('Student.create_level') 23 students = context.portal_directories.students24 24 mtool = context.portal_membership 25 25 member = mtool.getAuthenticatedMember() … … 49 49 results = context.results_import(matric_no = student.matric_no) 50 50 if results: 51 carry_overs = [brain for brain in results if brain.GRADE in ('D','E','F')] 52 #carry_overs = [brain for brain in results if int(brain.Score) < 40 ] 51 #carry_overs = [brain for brain in results if brain.GRADE in ('D','E','F')] 53 52 l = [] 53 carry_overs = results 54 54 for co in carry_overs: 55 carry_over = False 56 query = Eq('code',co.CosCode) 57 c_res = aq_courses(query) 58 if not c_res: 59 logger.info('"%s","%s course not found in courses catalog"' % (student.id,co.CosCode)) 60 continue 61 course_cat_entry = c_res[0] 62 if not course_cat_entry.passmark: 63 carry_over = co.GRADE in ('D','E','F') 64 else: 65 try: 66 score = int(co.Score) 67 except: 68 logger.info('"%s"," course %s invalid score %s"' % (student.id, 69 co.CosCode, 70 co.Score)) 71 continue 72 if int(c_res[0].passmark) <= score: 73 continue 74 carry_over = True 75 if not carry_over: 76 continue 55 77 d = context.getCourseInfo(co.CosCode) 56 78 d['grade'] = co.GRADE … … 77 99 course_result.getContent().edit(mapping=d) 78 100 session.set('in_progress','finished') 101 return 79 102 return response.redirect("%s" % level.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.