source: WAeUP_SRP/unilorin/waeup_custom/getTranscriptInfo.py @ 3604

Last change on this file since 3604 was 3602, checked in by Henrik Bettermann, 16 years ago

first tools for transcripts (untested)

File size: 1.6 KB
Line 
1## Script (Python) "getTranscriptInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None
8##title=
9##
10# $Id: getStudyLevelInfo.py 2760 2007-11-26 07:39:15Z henrik $
11"""
12return Info about the Studylevel
13try:
14    from Products.zdb import set_trace
15except:
16    def set_trace():
17        pass
18"""
19
20info = context.waeup_tool.getAccessInfo(context)
21student_id = info['student_id']
22if student_id is None:
23    return None
24
25mtool = context.portal_membership
26member = mtool.getAuthenticatedMember()
27member_id = str(member)
28
29course_results = context.course_results
30request = context.REQUEST
31response = request.RESPONSE
32import logging
33logger = logging.getLogger('Skins.getTranscriptInfo')
34
35
36info['is_so'] = is_so = info['is_sectionofficer']
37info['student'] = student = context.students_catalog.getRecordByKey(student_id)
38info['review_state'] = review_state = student.review_state
39school_fee_paid =  review_state == 'school_fee_paid'
40info['has_verdict'] = has_verdict = level_doc.verdict
41
42info['verdict'] = context.portal_vocabularies.verdicts.get(level_doc.verdict).upper()
43info['session'] = context.portal_vocabularies.sessions.get(level_doc.session)
44
45cert_id = student.course
46info['cert_id'] = cert_id
47total_credits,gpa,carry_overs,normal1,normal2,normal3 = course_results.getCourses(student_id,level_id)
48info['total_credits'] = total_credits
49
50current_session = student.session
51info['gpa'] = gpa
52
53if gpa and total_credits:
54    info['gpa'] = "%4.2f" % (float(gpa)/int(total_credits))
55
56info['carry_overs'] = carry_overs
57
58
59return info
Note: See TracBrowser for help on using the repository browser.