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');
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');
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')
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
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