source: WAeUP_SRP/trunk/skins/waeup_student/getLevelFromResultsCosCode.py @ 5518

Last change on this file since 5518 was 2488, checked in by joachim, 17 years ago

set found to true

  • Property svn:keywords set to Id
File size: 698 bytes
Line 
1## Script (Python) "getLevelFromResultsList"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=list
8##title=
9##
10# $Id: getLevelFromResultsCosCode.py 2488 2007-10-31 10:45:45Z joachim $
11lnr = 0
12found = False
13for e in list:
14    if e.CosCode == "N/A":
15       
16        # used for medical dummy results
17        # return 2
18       
19        # used for 'Temporary Withdrawal' dummy results
20        return int(e.Level[0])
21    try:
22        cc = int(e.CosCode[3])
23        found = True
24    except:
25        continue
26    if lnr <= cc:
27        lnr = cc
28if found:
29    return lnr
30lnr = 0
31for e in list:
32    try:
33        lnr = int(e.Level[0])
34        break
35    except:
36       continue
37return lnr
Note: See TracBrowser for help on using the repository browser.