## Script (Python) "getTranscriptInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student=None ##title= ## # $Id: getStudyLevelInfo.py 2760 2007-11-26 07:39:15Z henrik $ """ return Info about the Studylevel try: from Products.zdb import set_trace except: def set_trace(): pass """ info = context.waeup_tool.getAccessInfo(context) student_id = info['student_id'] if student_id is None: return None mtool = context.portal_membership member = mtool.getAuthenticatedMember() member_id = str(member) course_results = context.course_results request = context.REQUEST response = request.RESPONSE import logging logger = logging.getLogger('Skins.getTranscriptInfo') info['is_so'] = is_so = info['is_sectionofficer'] info['student'] = student = context.students_catalog.getRecordByKey(student_id) info['review_state'] = review_state = student.review_state school_fee_paid = review_state == 'school_fee_paid' info['has_verdict'] = has_verdict = level_doc.verdict info['verdict'] = context.portal_vocabularies.verdicts.get(level_doc.verdict).upper() info['session'] = context.portal_vocabularies.sessions.get(level_doc.session) cert_id = student.course info['cert_id'] = cert_id total_credits,gpa,carry_overs,normal1,normal2,normal3 = course_results.getCourses(student_id,level_id) info['total_credits'] = total_credits current_session = student.session info['gpa'] = gpa if gpa and total_credits: info['gpa'] = "%4.2f" % (float(gpa)/int(total_credits)) info['carry_overs'] = carry_overs return info