source: WAeUP_SRP/base/skins/waeup_student/getNextInfo.py @ 2458

Last change on this file since 2458 was 2456, checked in by Henrik Bettermann, 17 years ago

mark deprecated vocabulary
use '000' for pre-studies (no longer missing value)
improve fixReturningSession.py (do not replace level by '000')
fix getNextInfo.py
fix logged_in.py

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1## Script (Python) "getNextInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student_brain
8##title=
9##
10# $Id: getNextInfo.py 2456 2007-10-28 07:09:46Z henrik $
11"""
12return the students next info
13"""
14
15info = {}
16
17session_id = student_brain.session
18level_id = student_brain.level
19review_state = student_brain.review_state
20verdict = student_brain.verdict
21info['next_transition'] = None
22info['next_session_id'] = next_session_id = session_id
23info['next_level_id'] = next_level_id = level_id
24
25if review_state == 'cleared_and_validated':
26    info['next_transition'] = "pay_school_fee"
27elif review_state == 'returning':
28    if level_id:
29        info['next_level_id'] = "%s" % (int(level_id) + 100)
30    if session_id:
31        info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
32        if int(session_id) > int(context.getSessionId()[0]) -2:
33            info['next_transition'] = "pay_school_fee"
34            if verdict not in ('A','B',):
35                info['next_level_id'] = level_id
36
37info['next_session_str'] = context.sessions_voc(next_session_id)
38
39return info
Note: See TracBrowser for help on using the repository browser.