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

Last change on this file since 2714 was 2678, checked in by Henrik Bettermann, 17 years ago
  • fix previous_verdict for payments in session 04
  • fix missing_data notice
  • Property svn:keywords set to Id
File size: 1.8 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 2678 2007-11-16 13:41:44Z henrik $
11"""
12return the students next info
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19
20info = {}
21
22reasons = ''
23
24session_id = student_brain.session
25level_id = student_brain.level
26review_state = student_brain.review_state
27verdict = student_brain.verdict
28
29has_verdict = verdict and verdict != 'N/A'
30has_session = session_id and session_id != 'N/A'
31has_level = level_id and level_id != 'N/A'
32
33info['next_transition'] = None
34info['next_session_id'] = next_session_id = session_id
35info['next_level_id'] = next_level_id = level_id
36info['next_verdict'] = verdict
37info['next_previous_verdict'] = ''
38verdicts_voc = context.portal_vocabularies.verdicts
39if review_state == 'cleared_and_validated':
40    info['next_transition'] = "pay_school_fee"
41    info['next_verdict'] = ''
42elif review_state == 'returning' and has_verdict and has_level and has_session:
43    info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
44    if int(session_id) > 4:
45        info['next_transition'] = "pay_school_fee"
46        info['next_verdict'] = ''
47        info['next_previous_verdict'] = verdict
48        if verdict in ('A','B',):
49            info['next_level_id'] = "%s" % (int(level_id) + 100)
50        else:
51            info['next_level_id'] = level_id
52    else:
53        info['next_level_id'] = "%s" % (int(level_id) + 100)
54elif review_state == 'returning' and not (has_session and has_level and has_verdict):
55    reasons = "Your data record is incomplete. School fee payment has been disabled, please contact your faculty!"
56
57info['reasons'] = reasons
58info['next_session_str'] = context.getSessionsVoc(next_session_id)
59
60return info
Note: See TracBrowser for help on using the repository browser.