Last change
on this file since 3235 was
2756,
checked in by joachim, 17 years ago
|
new function getGradesFromScore for #32
|
-
Property svn:keywords set to
Id
|
File size:
452 bytes
|
Line | |
---|
1 | ## Script (Python) "getGradeFromScore" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=score=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: getGradesFromScore.py 2756 2007-11-25 17:52:48Z joachim $ |
---|
11 | |
---|
12 | if score is None: |
---|
13 | return None,None |
---|
14 | score = int(score) |
---|
15 | if score >= 70: |
---|
16 | return ('A',5) |
---|
17 | if score >= 60: |
---|
18 | return ('B',4) |
---|
19 | if score >= 50: |
---|
20 | return ('C',3) |
---|
21 | if score >= 45: |
---|
22 | return ('D',2) |
---|
23 | if score >= 40: |
---|
24 | return ('E',1) |
---|
25 | return ('F',0) |
---|
Note: See
TracBrowser for help on using the repository browser.