Beispiel #1
0
def main():
    round_number = int(sys.argv[1])
    if len(sys.argv)>2:
        filename = sys.argv[2]
        fp = codecs.open(filename,"w",encoding="utf-8")
    else:
        fp = None

    results = (AdmissionResult.
               objects.
               filter(round_number=round_number).
               select_related(depth=1).
               all())

    for r in results:
        app = r.applicant
        exam_scores = prepare_exam_scores(app)
        paid_total = sum([c.paid_amount for c in app.admission_confirmations.all()])
        confirmed = paid_total >= r.admitted_major.confirmation_amount
        prefix = app.title
        name = app.first_name + ' ' + app.last_name
        if not fp:
            print "%s,%d,%s,%.5f,%s,%s" % (app.national_id, int(r.admitted_major.number), str(confirmed), exam_scores['final_score'], prefix, name)
        else:
            print >>fp, u"%s,%d,%s,%.5f,%s,%s" % (app.national_id, int(r.admitted_major.number), str(confirmed), exam_scores['final_score'], prefix, name)
Beispiel #2
0
def show_applicant(request, applicant_id):
    applicant = get_object_or_404(Applicant, pk=applicant_id)
    try:
        submission_info = applicant.submission_info
    except:
        submission_info = None
    
    from application.views.status import prepare_exam_scores

    exam_scores = prepare_exam_scores(applicant)

    admission_results = applicant.admission_results.all()
    confirmations = AdmissionConfirmation.objects.filter(applicant=applicant).all()

    return render_to_response("review/show_app.html",
                              { 'applicant': applicant,
                                'submission_info': submission_info,
                                'exam_scores': exam_scores,
                                'admission_results': admission_results,
                                'confirmations': confirmations })
Beispiel #3
0
def main():
    round_number = int(sys.argv[1])
    if len(sys.argv) > 2:
        filename = sys.argv[2]
        fp = codecs.open(filename, "w", encoding="utf-8")
    else:
        fp = None

    uses_nat_id = '--nat' in sys.argv

    results = (AdmissionResult.objects.filter(
        round_number=round_number).select_related(depth=1).all())

    c = 0
    for r in results:
        c += 1
        app = r.applicant
        exam_scores = prepare_exam_scores(app)
        confirmed = (app.admission_confirmations.all().count() > 0)

        if AdmissionWaiver.is_waived(app):
            confirmed = False

        if confirmed and app.get_student_registration() == None:
            print 'BAD!'
            quit()

        prefix = app.title
        name = app.first_name + ' ' + app.last_name
        k = app.id
        if uses_nat_id:
            k = app.national_id
        if not fp:
            print "%s,%d,%s,%.5f,%s,%s" % (
                k, int(r.admitted_major.number), str(confirmed),
                exam_scores['final_score'], prefix, name)
        else:
            print >> fp, u"%s,%d,%s,%.5f,%s,%s" % (
                k, int(r.admitted_major.number), str(confirmed),
                exam_scores['final_score'], prefix, name)
def main():
    round_number = int(sys.argv[1])
    if len(sys.argv)>2:
        filename = sys.argv[2]
        fp = codecs.open(filename,"w",encoding="utf-8")
    else:
        fp = None

    uses_nat_id = '--nat' in sys.argv

    results = (AdmissionResult.
               objects.
               filter(round_number=round_number).
               select_related(depth=1).
               all())

    c = 0
    for r in results:
        c += 1
        app = r.applicant
        exam_scores = prepare_exam_scores(app)
        confirmed = (app.admission_confirmations.all().count() > 0)

        if AdmissionWaiver.is_waived(app):
            confirmed = False

        if confirmed and app.get_student_registration()==None:
            print 'BAD!'
            quit()

        prefix = app.title
        name = app.first_name + ' ' + app.last_name
        k = app.id
        if uses_nat_id:
            k = app.national_id
        if not fp:
            print "%s,%d,%s,%.5f,%s,%s" % (k, int(r.admitted_major.number), str(confirmed), exam_scores['final_score'], prefix, name)
        else:
            print >>fp, u"%s,%d,%s,%.5f,%s,%s" % (k, int(r.admitted_major.number), str(confirmed), exam_scores['final_score'], prefix, name)
Beispiel #5
0
def show_applicant(request, applicant_id):
    applicant = get_object_or_404(Applicant, pk=applicant_id)
    try:
        submission_info = applicant.submission_info
    except:
        submission_info = None

    from application.views.status import prepare_exam_scores

    exam_scores = prepare_exam_scores(applicant)

    admission_results = applicant.admission_results.all()
    confirmations = AdmissionConfirmation.objects.filter(
        applicant=applicant).all()

    return render_to_response(
        "review/show_app.html", {
            'applicant': applicant,
            'submission_info': submission_info,
            'exam_scores': exam_scores,
            'admission_results': admission_results,
            'confirmations': confirmations
        })