- Timestamp:
- 20 Aug 2007, 18:04:32 (17 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py
r2093 r2132 77 77 row = {} 78 78 row['id'] = l 79 row['title'] = "Level %s" % l 79 #row['title'] = "Level %s" % l 80 row['title'] = context.portal_vocabularies.levels_voc[l] 80 81 row['url'] = "%s/%s" % (context.absolute_url(),l) 81 82 items.append(row) -
WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
r2131 r2132 85 85 info['status_info'] = "Courses validated" 86 86 info['doc'] = context.getContent() 87 ##study_course = context.aq_parent.getContent() 88 ##cert_id = study_course.study_course 87 89 cert_id = student.course 88 90 info['cert_id'] = cert_id 89 credits_total,carry_overs,normal = context.course_results.getCourses(student_id,context.getId()) 91 normal = [] 92 carry_overs = [] 93 credits_total = 0 94 for id,obj in context.objectItems(): 95 #try: 96 # credit = int(obj.getContent().credits) 97 #except ValueError: 98 # credit = 3 99 #credits_total += credit 100 if not id: 101 continue 102 if id.endswith('_co'): 103 d = context.getCourseInfo(id[:-3]) 104 try: 105 credits_total += int(d['credits']) 106 except ValueError: 107 credits_total += 0 108 d['id'] = id 109 d['grade'] = obj.getContent().grade 110 carry_overs.append(d) 111 else: 112 d = context.getCourseInfo(id) 113 d['id'] = id 114 coe = getattr(obj.getContent(),'core_or_elective',True) 115 d['coe'] = 'Core' 116 try: 117 credits_total += int(d['credits']) 118 except ValueError: 119 credits_total += 0 120 if not coe: 121 d['coe'] = 'Elective' 122 normal.append(d) 90 123 info['credits_total'] = credits_total 91 124 info['credits_exceeded'] = credits_total > 51 92 125 current_session = student.session 93 126 info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[-2:] 94 #carry_overs.sort(cmp_semester_id)127 carry_overs.sort(cmp_semester_id) 95 128 info['carry_overs'] = carry_overs 96 #normal.sort(cmp_semester_id)129 normal.sort(cmp_semester_id) 97 130 info['normal'] = normal 98 131
Note: See TracChangeset for help on using the changeset viewer.