Changeset 2131 for WAeUP_SRP/trunk/skins
- Timestamp:
- 20 Aug 2007, 16:39:40 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
r2056 r2131 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_course89 87 cert_id = student.course 90 88 info['cert_id'] = cert_id 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) 89 credits_total,carry_overs,normal = context.course_results.getCourses(student_id,context.getId()) 123 90 info['credits_total'] = credits_total 124 91 info['credits_exceeded'] = credits_total > 51 125 92 current_session = student.session 126 93 info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[-2:] 127 carry_overs.sort(cmp_semester_id)94 # carry_overs.sort(cmp_semester_id) 128 95 info['carry_overs'] = carry_overs 129 normal.sort(cmp_semester_id)96 # normal.sort(cmp_semester_id) 130 97 info['normal'] = normal 131 98
Note: See TracChangeset for help on using the changeset viewer.