Ignore:
Timestamp:
28 Oct 2007, 20:58:41 (17 years ago)
Author:
Henrik Bettermann
Message:

rebuild getNextInfo.py (was completely wrong)
fix makeStudentData
and other changes

Location:
WAeUP_SRP/base/skins/waeup_student
Files:
5 edited

Legend:

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

    r2464 r2466  
    2020info = {}
    2121
     22reasons = ''
     23
    2224session_id = student_brain.session
    2325level_id = student_brain.level
    2426review_state = student_brain.review_state
    2527verdict = student_brain.verdict
     28
     29has_verdict = verdict and verdict != 'N/A'
     30has_session = session_id and session_id != 'N/A'
     31has_level = level_id and level_id != 'N/A'
     32
    2633info['next_transition'] = None
    2734info['next_session_id'] = next_session_id = session_id
    2835info['next_level_id'] = next_level_id = level_id
    29 reasons = []
    3036verdicts_voc = context.portal_vocabularies.verdicts
    3137if review_state == 'cleared_and_validated':
    3238    info['next_transition'] = "pay_school_fee"
    33 elif review_state == 'returning' and verdict and level_id and student_brain.session:
     39elif review_state == 'returning' and has_verdict and has_level and has_session:
     40    info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
    3441    if int(session_id) > int(context.getSessionId()[0]) -2:
    35         if verdict not in ('A','B',):
     42        info['next_transition'] = "pay_school_fee"
     43        if verdict in ('A','B',):
     44            info['next_level_id'] = "%s" % (int(level_id) + 100)
     45        else:
    3646            info['next_level_id'] = level_id
    37             if not verdict:
    38                 reasons += "There is no verdict.",
    39             else:
    40                 reasons += "Your are not a %s" % verdicts_voc.get('A'),
    41                 reasons += "or not a %s" % verdicts_voc.get('B'),
    42         else:
    43             info['next_level_id'] = "%s" % (int(level_id) + 100)
    44             info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
    45             info['next_transition'] = "pay_school_fee"
     47    else:
     48        info['next_level_id'] = "%s" % (int(level_id) + 100)
     49elif not (has_session and has_level and has_verdict):
     50    reasons = "Your data record is incomplete. School fee payment has been disabled, please contact your faculty!"
     51
    4652info['reasons'] = reasons
    4753info['next_session_str'] = context.sessions_voc(next_session_id)
  • WAeUP_SRP/base/skins/waeup_student/getSessionResults.py

    r1900 r2466  
    5656    res = results(matric_no = matric_no)
    5757    results = res
    58 else: 
     58else:
    5959    results = []
    6060
     
    6767course_count = 0
    6868session = None
     69level = None
    6970
    7071for r in results:
    7172    if session is None:
    7273        session = r.Session
     74    if level is None:
     75        level = r.Level       
    7376    result = {}
    7477    for field in fields:
     
    110113    info['verdict'] = verdict = 'N/A'
    111114
    112 if student_from_cat.level:
    113     if student_from_cat.sex:
    114         info['sex'] = 'F'
    115     else:
    116         info['sex'] = 'M'
    117     if verdict in ('A','B'):
    118         info['level'] = int(student_from_cat.level)-100
    119     else:
    120         info['level'] = int(student_from_cat.level)
     115if session:
     116    info['session'] = session
    121117else:
    122     info['sex'] = 'N/A'
     118    info['session'] = 'N/A'
     119if level:
     120    info['level'] = level
     121else:
    123122    info['level'] = 'N/A'
    124 
    125 info['session'] = session
    126123info['gpa'] = gpa
    127124info['results'] = (sem1, sem2)
  • WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py

    r2454 r2466  
    1717if mtool.isAnonymousUser():
    1818    return None
     19member = mtool.getAuthenticatedMember()
     20member_id = str(member)
    1921
    2022try:
     
    9294if context.objectIds():
    9395    course_results.moveResultsHere(context,student_id)
    94     logger.info("%s moved courseresults and deleted objects in level %s" % (student_id,level_id))
     96    logger.info("%s initiated moveResultsHere for %s in level %s" % (member_id,student_id,level_id))
    9597credits_total,carry_overs,normal = course_results.getCourses(student_id,level_id)
    9698info['credits_total'] = credits_total
  • WAeUP_SRP/base/skins/waeup_student/session_results_anon_view.pt

    r1292 r2466  
    1212        <tr>
    1313          <th width="150px">Matriculation Number:</th><td tal:content="student/matric_no" />                     
    14         </tr>
    15         <tr>
    16           <th>Sex:</th><td tal:content="student/Sex" />                     
    1714        </tr>
    1815        <tr>
  • WAeUP_SRP/base/skins/waeup_student/session_results_view.pt

    r1851 r2466  
    2626        <tr>
    2727          <th width="150px">Matriculation Number:</th><td tal:content="info/student/matric_no" />                     
    28         </tr>
    29         <tr>
    30           <th>Sex:</th><td tal:content="info/sex" />                     
    31         </tr>
    32         <tr>
    33           <th valign="top">Course of Study:</th><td tal:content="info/student/course" />                     
    3428        </tr>
    3529        <tr>
Note: See TracChangeset for help on using the changeset viewer.