Changeset 2132 for WAeUP_SRP


Ignore:
Timestamp:
20 Aug 2007, 18:04:32 (17 years ago)
Author:
joachim
Message:

correct files for levels_voc, revert changes to getStudyLevelInfo

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py

    r2093 r2132  
    7777    row = {}
    7878    row['id'] = l
    79     row['title'] = "Level %s" % l
     79    #row['title'] = "Level %s" % l
     80    row['title'] = context.portal_vocabularies.levels_voc[l]
    8081    row['url'] = "%s/%s" % (context.absolute_url(),l)
    8182    items.append(row)
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r2131 r2132  
    8585        info['status_info'] = "Courses validated"
    8686info['doc'] = context.getContent()
     87##study_course = context.aq_parent.getContent()
     88##cert_id = study_course.study_course
    8789cert_id = student.course
    8890info['cert_id'] = cert_id
    89 credits_total,carry_overs,normal = context.course_results.getCourses(student_id,context.getId())
     91normal = []
     92carry_overs = []
     93credits_total = 0
     94for id,obj in context.objectItems():
     95    #try:
     96    #    credit = int(obj.getContent().credits)
     97    #except ValueError:
     98    #    credit = 3
     99    #credits_total += credit
     100    if not id:
     101        continue
     102    if id.endswith('_co'):
     103        d = context.getCourseInfo(id[:-3])
     104        try:
     105            credits_total += int(d['credits'])
     106        except ValueError:
     107            credits_total += 0
     108        d['id'] = id
     109        d['grade'] = obj.getContent().grade
     110        carry_overs.append(d)
     111    else:
     112        d = context.getCourseInfo(id)
     113        d['id'] = id
     114        coe = getattr(obj.getContent(),'core_or_elective',True)
     115        d['coe'] = 'Core'
     116        try:
     117            credits_total += int(d['credits'])
     118        except ValueError:
     119            credits_total += 0
     120        if not coe:
     121            d['coe'] = 'Elective'
     122        normal.append(d)
    90123info['credits_total'] = credits_total
    91124info['credits_exceeded'] = credits_total > 51
    92125current_session = student.session
    93126info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[-2:]
    94 # carry_overs.sort(cmp_semester_id)
     127carry_overs.sort(cmp_semester_id)
    95128info['carry_overs'] = carry_overs
    96 # normal.sort(cmp_semester_id)
     129normal.sort(cmp_semester_id)
    97130info['normal'] = normal
    98131
Note: See TracChangeset for help on using the changeset viewer.