## Script (Python) "getStudentStatistics" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: getStudentStatistics.py 1081 2006-12-18 20:56:42Z joachim $ """ return Student Statistic """ try: from Products.AdvancedQuery import Eq, Between, Le,In aq_portal = context.portal_catalog.evalAdvancedQuery aq_students = context.students_catalog.evalAdvancedQuery except: evalAdvancedQuery = None l = [] if not context.isStaff(): return l dep = {} dep['id'] = "All" dep['students'] = len(context.students_catalog()) dep['clearance_pin_entered'] = len(aq_portal(Eq('review_state','clearance_pin_entered'))) dep['clearance_requested'] = len(aq_portal(Eq('review_state','clearance_requested'))) dep['cleared_and_validated'] = len(aq_portal(Eq('review_state','cleared_and_validated'))) l.append(dep) return l