Changeset 2766 for WAeUP_SRP/base/skins/waeup_student
- Timestamp:
- 26 Nov 2007, 19:18:09 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/create_level.py
r2758 r2766 39 39 lt = context.portal_layouts 40 40 wt = context.waeup_tool 41 student = context.students_catalog (id=student_id)[0]41 student = context.students_catalog.getRecordByKey(student_id) 42 42 cert_id = student.course 43 43 current_level = student.level … … 51 51 52 52 if context.hasObject(current_level): 53 level = getattr(context,"%s" % current_level) 53 #level = getattr(context,"%s" % current_level) 54 return response.redirect("%s/%s" % (context.absolute_url(),current_level)) 54 55 else: 55 56 context.invokeFactory('StudentStudyLevel',"%s" % current_level) … … 65 66 results = context.results_import(matric_no = student.matric_no) 66 67 l = [] 67 68 68 69 69 # fetch carry_over courses from results_import … … 110 110 records.append(d) 111 111 # fetch carry_over courses from the course_results catalog 112 # else 112 else: 113 res = context.aq_results(Eq('student_id',student_id), 114 sortSpecs=('level_id',)) 115 last_level_id = res[-1].level_id 116 for result in res: 117 course_id = result.code 118 if course_id in l or result.level_id != last_level_id: 119 continue 120 query = Eq('code',course_id) 121 c_res = aq_courses(query) 122 if not c_res: 123 #logger.info('%s", course %s not found in courses_catalog' % (student.id,result.CosCode)) 124 continue 125 course_cat_entry = c_res[0] 126 passmark = getattr(course_cat_entry,'passmark',None) 127 try: 128 score = int(result.score) 129 except: 130 # logger.info('%s, course %s has invalid score %s"' % (student.id, 131 # course_id, 132 # result.Score)) 133 continue 134 if int(c_res[0].passmark) <= score: 135 continue 136 l += course_id, 137 d = context.getCourseInfo(course_id) 138 d['course_id'] = course_id 139 d['carry_over'] = True 140 d['code'] = course_id 141 d['student_id'] = student_id 142 d['level_id'] = level_id 143 d['session_id'] = session_id 144 records.append(d) 113 145 114 146 # fetch session courses from the certificate
Note: See TracChangeset for help on using the changeset viewer.