Changeset 1179 for WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py
- Timestamp:
- 2 Jan 2007, 21:29:17 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py
r1174 r1179 58 58 with_courses_cat = hasattr(context,'courses_catalog') 59 59 fields = context.results_import.schema() 60 gpa = 0 61 course_count = 0 60 62 for r in results: 61 63 result = {} … … 66 68 if with_courses_cat and res: 67 69 result['title'] = res[0].title 70 result['credits'] = res[0].credits 71 try: 72 weight = int(result['WEIGHT']) 73 credits = int(res[0].credits) 74 gpa_course = int(res[0].credits) * weight 75 gpa += gpa_course 76 course_count += credits 77 result['gpa'] = 'ok' 78 except: 79 result['gpa'] = 'na' 68 80 else: 69 result['title'] = "To Be Determined" 81 result['title'] = "na" 82 result['credits'] = "na" 83 result['gpa'] = 'na' 70 84 if r.Semester == '2': 71 85 sem2.append(result) 72 86 else: 73 87 sem1.append(result) 88 89 if course_count: 90 gpa = float(gpa) / course_count 91 gpa = "%4.2f" % gpa 92 info['gpa'] = gpa 74 93 info['results'] = (sem1, sem2) 75 94 info['student'] = student 76 95 info['s_id'] = student_id 77 96 return info 97
Note: See TracChangeset for help on using the changeset viewer.