source: WAeUP_SRP/trunk/skins/waeup_student/getLevelsFromCourseResults.py @ 5216

Last change on this file since 5216 was 3397, checked in by joachim, 17 years ago

first analysis for #115 okene

  • Property svn:keywords set to Id
File size: 960 bytes
Line 
1## Script (Python) "getLevelsFromCourseResults"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student_id=None
8##title=
9##
10# $Id: getLevelsFromCourseResults.py 3397 2008-03-31 10:07:17Z joachim $
11"""
12return Info about the Students StudyCourse
13"""
14import DateTime
15from Products.AdvancedQuery import Eq, Between, Le,In
16
17mtool = context.portal_membership
18if mtool.isAnonymousUser():
19    return None
20
21try:
22    from Products.zdb import set_trace
23except:
24    def set_trace():
25        pass
26import logging
27logger = logging.getLogger('Skins.getLevelsFromCourseResults')
28request = context.REQUEST
29
30if student_id is None:
31    student_id = context.getStudentId()
32query = Eq('student_id',student_id)
33results = context.course_results.evalAdvancedQuery(query,(('level_id','desc'),))
34old_level = 'xxx'
35levels = []
36for result in results:
37    if result.level_id != old_level:
38        old_level = result.level_id
39        levels += old_level,
40return levels
41
Note: See TracBrowser for help on using the repository browser.