Changeset 724 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 19 Oct 2006, 20:39:29 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
r723 r724 20 20 course = res[0].getObject().getContent() 21 21 return course 22 22 23 23 def calculateGPA(): 24 24 """calculate the gpa""" … … 58 58 info['choosen_ids'] = request.get('ids',[]) 59 59 info['doc'] = context.getContent() 60 study_course = context.aq_parent.getContent() 60 study_course = context.aq_parent.getContent() 61 61 cert_id = study_course.study_course 62 62 brain = context.portal_catalog(meta_type="Student",id = student_id)[-1] … … 65 65 info['cert_id'] = cert_id 66 66 67 res = context.portal_catalog(meta_type="StudentCourseResult", 67 res = context.portal_catalog(meta_type="StudentCourseResult", 68 68 container_path="%s/study_course/%s" % (cp,level_id)) 69 69 first = [] … … 82 82 if row['credits'] and rd.grade: 83 83 credits = int(course.credits) 84 sum += credits * (['F','E','D','C','B','A'].index(rd.grade) + 1)84 sum += credits * ['F','E','D','C','B','A'].index(rd.grade) 85 85 course_count += credits 86 86 row['sum'] = sum … … 104 104 if course_count: 105 105 gpaf = (float(sum)/course_count) 106 info['doc'].edit(mapping={'gpa': gpaf}) 107 gpa = "%4.2f" % gpaf 108 info['gpa'] = gpa 106 gpa = "%4.2f" % gpaf 107 info['doc'].edit(mapping={'gpa': gpa}) 109 108 info['first'] = first 110 109 info['second'] = second
Note: See TracChangeset for help on using the changeset viewer.