source: WAeUP_SRP/base/skins/waeup_student/getLevelSession.py @ 2440

Last change on this file since 2440 was 2439, checked in by joachim, 17 years ago

new versions for getLevel

  • Property svn:keywords set to Id
File size: 669 bytes
RevLine 
[2439]1## Script (Python) "getLevelSession"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=level_doc,student_id,level_id
8##title=
9##
10# $Id: getLevelSession.py 2439 2007-10-26 14:48:39Z joachim $
11"""
12return fixed session_id from level
13"""
14session_id = level_doc.session
15changed = False
16if len(session_id) == 2:
17    pass
18elif len(session_id) == 9:
19    changed = True
20    session_id = session_id[2:4]
21if len(session_id) != 2:
22    logger.info("invalid session %s in level %s for student %s" %
23                (session_id,level_id,student_id))
24else:
25    if changed:
26        level_doc.edit(mapping={'session': session_id})
27return session_id
28
29   
30
Note: See TracBrowser for help on using the repository browser.