## 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 2461 2007-10-28 16:47:34Z joachim $ """ return the students next info """ info = {} session_id = student_brain.session level_id = student_brain.level review_state = student_brain.review_state info['verdict'] = student_brain.verdict info['next_transition'] = None info['next_session_id'] = next_session_id = session_id info['next_level_id'] = next_level_id = level_id reasons = [] verdicts_voc = context.portal_vocabularies.verdicts if review_state == 'cleared_and_validated': info['next_transition'] = "pay_school_fee" elif review_state == 'returning' and verdict and level_id and session: info['next_level_id'] = "%s" % (int(level_id) + 100) info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1) if int(session_id) > int(context.getSessionId()[0]) -2: info['next_transition'] = "pay_school_fee" if verdict not in ('A','B',): info['next_level_id'] = level_id if not verdict: reasons += "There is no verdict." else: reasons += "Your are not a %s" % verdicts_voc.get('A') reasons += "or not a %s" % verdicts_voc.get('B') else: info['next_transition'] = "pay_school_fee" info['reasons'] = reasons info['next_session_str'] = context.sessions_voc(next_session_id) return info