source: WAeUP_SRP/base/skins/waeup_student/getGradesFromScore.py @ 3458

Last change on this file since 3458 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
12if score is None:
13    return None,None
14score = int(score)
15if score >= 70:
16    return ('A',5)
17if score >= 60:
18    return ('B',4)
19if score >= 50:
20    return ('C',3)
21if score >= 45:
22    return ('D',2)
23if score >= 40:
24    return ('E',1)
25return ('F',0)
Note: See TracBrowser for help on using the repository browser.