Ignore:
Timestamp:
27 Oct 2007, 21:53:04 (17 years ago)
Author:
Henrik Bettermann
Message:

rebuild getNextInfo.py completely
fetch session from portal properties.xml
change all scripts using getSessionId
remove StudentCourseResult? relevant code from event services
make pay_by_sc.py and interswitch_cb.py work (rebuild both)

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

Legend:

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

    r2448 r2454  
    7272    results = context.results_import(matric_no = student.matric_no)
    7373records = []
    74 if results:
    75     l = []
     74l = []
     75if student.session in ('6', '06') and results:
    7676    carry_overs = results
    7777    for co in carry_overs:
     
    154154logger.info('%s finished to create level %s' % (student.id,current_level))
    155155
    156 if current_session == '05':
    157     next_session = '06'
    158     next_level = "%s" % (int(current_level) + 100)
    159     study_course = getattr(student,'study_course')
    160     context.portal_workflow.doActionFor(study_course,'open')
    161     study_course_doc = study_course.getContent()
    162     study_course_doc.edit(mapping= {'current_level': next_level,
    163                                     'current_session': next_session,})
    164     context.portal_workflow.doActionFor(study_course,'close_for_edit')
     156#if current_session == '05':
     157#    next_session = '06'
     158#    next_level = "%s" % (int(current_level) + 100)
     159#    study_course = getattr(student,'study_course')
     160#    context.portal_workflow.doActionFor(study_course,'open')
     161#    study_course_doc = study_course.getContent()
     162#    study_course_doc.edit(mapping= {'current_level': next_level,
     163#                                    'current_session': next_session,})
     164#    context.portal_workflow.doActionFor(study_course,'close_for_edit')
    165165
    166166return response.redirect("%s/%s" % (context.absolute_url(),current_level))
  • WAeUP_SRP/base/skins/waeup_student/getNextInfo.py

    r2451 r2454  
    1 ## Script (Python) "getSessionId"
     1## Script (Python) "getNextInfo"
    22##bind container=container
    33##bind context=context
     
    1212return the students next info
    1313"""
     14
    1415info = {}
     16
     17session_id = student_brain.session
     18level_id = student_brain.level
     19review_state = student_brain.review_state
     20verdict = student_brain.verdict
    1521info['next_transition'] = None
    16 session_id = student_brain.session
    17 if int(session_id) > int(context.getSessionId()[3:4]) -2:
     22info['next_session_id'] = next_session_id = session_id
     23info['next_level_id'] = next_level_id = level_id
     24
     25if review_state == 'cleared_and_validated':
    1826    info['next_transition'] = "pay_school_fee"
     27elif review_state == 'returning':
     28    info['next_level_id'] = "%s" % (int(level_id) + 100)
     29    info['next_session_id'] = next_session_id = "%02d" % (int(session_id)+1)
     30    if int(session_id) > int(context.getSessionId()[0]) -2:
     31        info['next_transition'] = "pay_school_fee"
     32        if verdict not in ('A','B',):
     33            info['next_level_id'] = level_id
    1934
    20 if student_brain.review_state == "returning":
    21     session_id info['next_session_id'] = "%02d" % int(session_id) + 1
    22 info['next_session_str'] = context.session_voc(session_id)
    23 next_level_id = student_brain.level
    24 if student_brain.review_state not in ('cleared_and_validated',)
    25     next_level_id = "%s" % (int(next_level_id) + 100)
    26 info['next_level_id'] = next_level_id
    27 
     35info['next_session_str'] = context.sessions_voc(next_session_id)
    2836
    2937return info
  • WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py

    r2451 r2454  
    9797info['credits_exceeded'] = credits_total > 51
    9898current_session = student.session
    99 info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[-2:]
     99info['submission_allowed']= not info['credits_exceeded'] and current_session == context.getSessionId()[0]
    100100# carry_overs.sort(cmp_semester_id)
    101101info['carry_overs'] = carry_overs
Note: See TracChangeset for help on using the changeset viewer.