Ignore:
Timestamp:
26 Nov 2007, 19:18:09 (17 years ago)
Author:
joachim
Message:

M skins/waeup_student/create_level.py
use course_results for carry_overs

M skins/waeup_pins/pins_view.pt
M skins/waeup_pins/search_pins.py
sort batches in select-box

M Widgets.py
M WAeUPTables.py
M WAeUPTool.py
mass_(create,edit)_courseresults edits verdict in level.

M profiles/default/layouts/application_cest.xml
M profiles/default/applicants_catalog.xml
new meta_data field "serial", index must be added manually

File:
1 edited

Legend:

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

    r2758 r2766  
    3939lt = context.portal_layouts
    4040wt = context.waeup_tool
    41 student = context.students_catalog(id=student_id)[0]
     41student = context.students_catalog.getRecordByKey(student_id)
    4242cert_id = student.course
    4343current_level = student.level
     
    5151
    5252if context.hasObject(current_level):
    53     level = getattr(context,"%s" % current_level)
     53    #level = getattr(context,"%s" % current_level)
     54    return response.redirect("%s/%s" % (context.absolute_url(),current_level))
    5455else:
    5556    context.invokeFactory('StudentStudyLevel',"%s" % current_level)
     
    6566    results = context.results_import(matric_no = student.matric_no)
    6667l = []
    67 
    6868
    6969# fetch carry_over courses from results_import
     
    110110        records.append(d)
    111111# fetch carry_over courses from the course_results catalog
    112 # else
     112else:
     113    res = context.aq_results(Eq('student_id',student_id),
     114                             sortSpecs=('level_id',))
     115    last_level_id = res[-1].level_id
     116    for result in res:
     117        course_id = result.code
     118        if course_id in l or result.level_id != last_level_id:
     119            continue
     120        query = Eq('code',course_id)
     121        c_res = aq_courses(query)
     122        if not c_res:
     123            #logger.info('%s", course %s not found in courses_catalog' % (student.id,result.CosCode))
     124            continue
     125        course_cat_entry = c_res[0]
     126        passmark = getattr(course_cat_entry,'passmark',None)
     127        try:
     128            score = int(result.score)
     129        except:
     130            # logger.info('%s, course %s has invalid score %s"' % (student.id,
     131            #                                                     course_id,
     132            #                                                     result.Score))
     133            continue
     134        if int(c_res[0].passmark) <= score:
     135            continue
     136        l += course_id,
     137        d = context.getCourseInfo(course_id)
     138        d['course_id'] = course_id
     139        d['carry_over'] = True
     140        d['code'] = course_id
     141        d['student_id'] = student_id
     142        d['level_id'] = level_id
     143        d['session_id'] = session_id
     144        records.append(d)
    113145
    114146# fetch session courses from the certificate
Note: See TracChangeset for help on using the changeset viewer.