Пример #1
0
def ajax_finalize_test(request, test_id):
    test = get_object_or_404(Test, id=test_id)
    if not test.students.count():
        return HttpResponse('Test must have at least one student');
    try:
        # Send to QueXF
        generate_xml(test_id)
        return HttpResponse('SUCCESS');
    except:
        try: # try again? One time it failed and then worked on second try..no clue why
            generate_xml(test_id)
            return HttpResponse('SUCCESS');
        except:
            logging.error('Couldn\'t finalize omr test.', exc_info=True, extra={
                'request': request,
            })
            return HttpResponse('Unexpected Error');
Пример #2
0
def ajax_finalize_test(request, test_id):
    test = get_object_or_404(Test, id=test_id)
    if not test.students.count():
        return HttpResponse('Test must have at least one student');
    try:
        # Send to QueXF
        generate_xml(test_id)
        return HttpResponse('SUCCESS');
    except:
        try: # try again? One time it failed and then worked on second try..no clue why
            generate_xml(test_id)
            return HttpResponse('SUCCESS');
        except:
            logging.error('Couldn\'t finalize omr test.', exc_info=True, extra={
                'request': request,
            })
            return HttpResponse('Unexpected Error');
Пример #3
0
def ajax_finalize_test(request, test_id):
    generate_xml(test_id)
    return HttpResponse('SUCCESS');

    try:
        # Send to QueXF
        generate_xml(test_id)
        return HttpResponse('SUCCESS');
    except:
        try: # try again? One time it failed and then worked on second try..no clue why
            generate_xml(test_id)
            return HttpResponse('SUCCESS');
        except:
            logging.error('Couldn\'t finalize omr test.', exc_info=True, extra={
                'request': request,
            })
            return HttpResponse('Unexpected Error');
Пример #4
0
def ajax_finalize_test(request, test_id):
    generate_xml(test_id)
    return HttpResponse('SUCCESS')

    try:
        # Send to QueXF
        generate_xml(test_id)
        return HttpResponse('SUCCESS')
    except:
        try:  # try again? One time it failed and then worked on second try..no clue why
            generate_xml(test_id)
            return HttpResponse('SUCCESS')
        except:
            logging.error('Couldn\'t finalize omr test.',
                          exc_info=True,
                          extra={
                              'request': request,
                          })
            return HttpResponse('Unexpected Error')
Пример #5
0
def queXF_answer_sheets(request,test_id):
    pdf = generate_xml(test_id)
    response = HttpResponse(pdf, mimetype="application/pdf")
    filename = "Test_" + test_id + ".pdf"
    response['Content-Disposition'] = "filename=" + str(filename)
    return response
Пример #6
0
def queXF_answer_sheets(request, test_id):
    pdf = generate_xml(test_id)
    response = HttpResponse(pdf, mimetype="application/pdf")
    filename = "Test_" + test_id + ".pdf"
    response['Content-Disposition'] = "filename=" + str(filename)
    return response