Last change
on this file since 2460 was
2459,
checked in by Henrik Bettermann, 17 years ago
|
show payment button only if verdict, session and level are not empty
pay_by_sc.py: open study_course to fill new level and session after payment
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[2454] | 1 | ## Script (Python) "getNextInfo" |
---|
[2451] | 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 2459 2007-10-28 13:56:01Z henrik $ |
---|
| 11 | """ |
---|
| 12 | return the students next info |
---|
| 13 | """ |
---|
[2454] | 14 | |
---|
[2451] | 15 | info = {} |
---|
[2454] | 16 | |
---|
| 17 | session_id = student_brain.session |
---|
| 18 | level_id = student_brain.level |
---|
| 19 | review_state = student_brain.review_state |
---|
| 20 | verdict = student_brain.verdict |
---|
[2451] | 21 | info['next_transition'] = None |
---|
[2454] | 22 | info['next_session_id'] = next_session_id = session_id |
---|
| 23 | info['next_level_id'] = next_level_id = level_id |
---|
| 24 | |
---|
| 25 | if review_state == 'cleared_and_validated': |
---|
[2451] | 26 | info['next_transition'] = "pay_school_fee" |
---|
[2459] | 27 | elif review_state == 'returning' and verdict and level_id and session: |
---|
| 28 | info['next_level_id'] = "%s" % (int(level_id) + 100) |
---|
| 29 | info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1) |
---|
| 30 | if int(session_id) > int(context.getSessionId()[0]) -2: |
---|
| 31 | info['next_transition'] = "pay_school_fee" |
---|
| 32 | if verdict not in ('A','B',): |
---|
| 33 | info['next_level_id'] = level_id |
---|
[2451] | 34 | |
---|
[2454] | 35 | info['next_session_str'] = context.sessions_voc(next_session_id) |
---|
[2451] | 36 | |
---|
| 37 | return info |
---|
Note: See
TracBrowser for help on using the repository browser.