## Script (Python) "getNextInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student_brain ##title= ## # $Id: getNextInfo.py 2678 2007-11-16 13:41:44Z henrik $ """ return the students next info """ try: from Products.zdb import set_trace except: def set_trace(): pass info = {} reasons = '' session_id = student_brain.session level_id = student_brain.level review_state = student_brain.review_state verdict = student_brain.verdict has_verdict = verdict and verdict != 'N/A' has_session = session_id and session_id != 'N/A' has_level = level_id and level_id != 'N/A' info['next_transition'] = None info['next_session_id'] = next_session_id = session_id info['next_level_id'] = next_level_id = level_id info['next_verdict'] = verdict info['next_previous_verdict'] = '' verdicts_voc = context.portal_vocabularies.verdicts if review_state == 'cleared_and_validated': info['next_transition'] = "pay_school_fee" info['next_verdict'] = '' elif review_state == 'returning' and has_verdict and has_level and has_session: info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1) if int(session_id) > 4: info['next_transition'] = "pay_school_fee" info['next_verdict'] = '' info['next_previous_verdict'] = verdict if verdict in ('A','B','G',): #customized info['next_level_id'] = "%s" % (int(level_id) + 100) elif verdict == 'C': info['next_level_id'] = "%s" % (int(level_id) + 10) else: info['next_level_id'] = level_id else: info['next_level_id'] = "%s" % (int(level_id) + 100) elif review_state == 'returning' and not (has_session and has_level and has_verdict): reasons = "Your data record is incomplete. School fee payment has been disabled, please contact your faculty!" info['reasons'] = reasons info['next_session_str'] = context.getSessionsVoc(next_session_id) return info