Changeset 2641
- Timestamp:
- 13 Nov 2007, 14:07:36 (17 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/getStudentLevelsVoc.py
r2637 r2641 10 10 pass 11 11 """ 12 student_id = context.getStudentId() 13 if student_id: 14 end_level = int(context.students_catalog(id = student_id)[0].end_level) 15 else: 16 end_level = 600 12 17 13 18 if key is None: 14 return [("%s" % l,"Level %s" % l) for l in range(100,700,100)] 19 levels = [l for l in range(100,end_level+200,10) 20 if l % 100 < 30 and l < end_level + 110] 21 voc = [] 22 for l in levels: 23 level_nr,repeat = divmod(l, 100) 24 if level_nr > end_level/100: 25 voc += ("%s" % l,"%s (spillover)" % context.portal_vocabularies.levels.get("%d00" % (level_nr - 1))), 26 elif repeat > 0: 27 voc += ("%s" % l,"%s (on %d. probation)" % 28 (context.portal_vocabularies.levels.get("%d00" % (level_nr)), 29 (repeat // 10))), 30 else: 31 voc += ("%s" % l,"%s" % 32 (context.portal_vocabularies.levels.get("%d00" % (level_nr)))), 33 return voc 34 15 35 ikey = int(key) 16 36 level_nr,repeat = divmod(ikey, 100) 17 37 l = [] 18 student = context.students_catalog(id = context.getStudentId())[0]19 38 20 39 level = context.portal_vocabularies.levels.get("%d00" % level_nr) 21 if level_nr > int(student.end_level)/100:40 if level_nr > end_level/100: 22 41 return "%s (spillover)" % context.portal_vocabularies.levels.get("%d00" % (level_nr - 1)) 23 42
Note: See TracChangeset for help on using the changeset viewer.