Ignore:
Timestamp:
19 Oct 2006, 20:39:29 (18 years ago)
Author:
Henrik Bettermann
Message:

GPA calculation corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r723 r724  
    2020    course = res[0].getObject().getContent()
    2121    return course
    22        
     22
    2323def calculateGPA():
    2424    """calculate the gpa"""
     
    5858info['choosen_ids'] = request.get('ids',[])
    5959info['doc'] = context.getContent()
    60 study_course = context.aq_parent.getContent() 
     60study_course = context.aq_parent.getContent()
    6161cert_id = study_course.study_course
    6262brain = context.portal_catalog(meta_type="Student",id = student_id)[-1]
     
    6565info['cert_id'] = cert_id
    6666
    67 res = context.portal_catalog(meta_type="StudentCourseResult", 
     67res = context.portal_catalog(meta_type="StudentCourseResult",
    6868                             container_path="%s/study_course/%s" % (cp,level_id))
    6969first = []
     
    8282    if row['credits'] and rd.grade:
    8383        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)
    8585        course_count += credits
    8686    row['sum'] = sum
     
    104104if course_count:
    105105    gpaf = (float(sum)/course_count)
    106 info['doc'].edit(mapping={'gpa': gpaf})
    107 gpa = "%4.2f" % gpaf
    108 info['gpa'] = gpa
     106gpa = "%4.2f" % gpaf
     107info['doc'].edit(mapping={'gpa': gpa})
    109108info['first'] = first
    110109info['second'] = second
Note: See TracChangeset for help on using the changeset viewer.