Changeset 2131 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
20 Aug 2007, 16:39:40 (17 years ago)
Author:
joachim
Message:

new levels_voc calls get_levels_voc used in getStudyCourseInfo

File:
1 edited

Legend:

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

    r2056 r2131  
    8585        info['status_info'] = "Courses validated"
    8686info['doc'] = context.getContent()
    87 ##study_course = context.aq_parent.getContent()
    88 ##cert_id = study_course.study_course
    8987cert_id = student.course
    9088info['cert_id'] = cert_id
    91 normal = []
    92 carry_overs = []
    93 credits_total = 0
    94 for 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)
     89credits_total,carry_overs,normal = context.course_results.getCourses(student_id,context.getId())
    12390info['credits_total'] = credits_total
    12491info['credits_exceeded'] = credits_total > 51
    12592current_session = student.session
    12693info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[-2:]
    127 carry_overs.sort(cmp_semester_id)
     94# carry_overs.sort(cmp_semester_id)
    12895info['carry_overs'] = carry_overs
    129 normal.sort(cmp_semester_id)
     96# normal.sort(cmp_semester_id)
    13097info['normal'] = normal
    13198
Note: See TracChangeset for help on using the changeset viewer.