Ignore:
Timestamp:
25 Nov 2007, 18:21:03 (17 years ago)
Author:
Henrik Bettermann
Message:

revised study_level_view and methods

File:
1 edited

Legend:

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

    r2664 r2757  
    5050
    5151
    52 has_paid =  review_state == 'school_fee_paid'
     52school_fee_paid =  review_state == 'school_fee_paid'
    5353
    54 info['show_check_boxes'] =  (is_ca and has_paid) or\
    55                             (is_student and has_paid) or\
    56                             (is_so)
     54is_current_level = level_id == student.level
    5755
     56info['show_check_boxes'] =  (is_ca and school_fee_paid and is_current_level) or\
     57                            (is_student and school_fee_paid and is_current_level) or\
     58                            (is_so and is_current_level)
     59
     60info['is_current_level'] = is_current_level
    5861
    5962info['choosen_ids'] = request.get('ids',[])
     
    6164if is_student:
    6265    if review_state == 'courses_registered':
    63         info['status_info'] = "Request for Course Validation pending"
     66        info['status_info'] = "Request for course validation pending"
    6467    elif review_state == 'courses_validated':
    6568        info['status_info'] = "Courses validated"
    6669elif is_ca:
    6770    if review_state == 'courses_registered':
    68         info['status_info'] = "Please validate these Courses"
     71        info['status_info'] = "Please validate these courses"
    6972    elif review_state == 'courses_validated':
    7073        info['status_info'] = "Courses validated"
    71 info['doc'] = context.getContent()
     74level_doc = info['doc'] = context.getContent()
    7275cert_id = student.course
    7376info['cert_id'] = cert_id
     
    7578    course_results.moveResultsHere(context,student_id)
    7679    logger.info("%s initiated moveResultsHere for %s in level %s" % (member_id,student_id,level_id))
    77 credits_total,carry_overs,normal1,normal2,normal3 = course_results.getCourses(student_id,level_id)
    78 info['credits_total'] = credits_total
     80total_credits,gpa,carry_overs,normal1,normal2,normal3 = course_results.getCourses(student_id,level_id)
     81info['total_credits'] = total_credits
    7982max_credits = 50
    8083if context.getId() == student.end_level:
    8184    max_credits = 51
    8285info['max_credits'] = max_credits
    83 info['credits_exceeded'] = credits_total > max_credits
     86info['credits_exceeded'] = total_credits > max_credits
    8487current_session = student.session
    8588
    86 info['submission_allowed']= review_state in  ('school_fee_paid','returning') and has_paid
    87 info['validation_allowed']= review_state == 'courses_registered'
    88 info['rejection_allowed']= review_state in ('courses_registered', 'courses_validated',)
     89info['gpa'] = gpa
     90if gpa and total_credits:
     91    info['gpa'] = "%4.2f" % (float(gpa)/int(total_credits))
     92   
     93info['submission_allowed']= school_fee_paid and level_id == student.level
     94info['validation_allowed']= review_state == 'courses_registered' and is_current_level
     95info['rejection_allowed']= review_state in ('courses_registered', 'courses_validated',) and is_current_level
    8996
     97info['verdict'] = context.portal_vocabularies.verdicts.get(level_doc.verdict)
     98info['session'] = context.portal_vocabularies.sessions.get(level_doc.session)
    9099
    91100# carry_overs.sort(cmp_semester_id)
Note: See TracChangeset for help on using the changeset viewer.