示例#1
0
def finalize_timing(sub_id, grade_id):

    if isinstance(sub_id, Submission):
        sub_id = sub_id.id
    else:
        try:
            sub = Submission.objects.get(id=int(submission_id))
        except Exception:
            return False, "Invalid submission id."

    success, timing_dict = generate_final_timing_dict(sub_id, grade_id)
    if not success:
        log.warning(
            "Final timing dict generation failed with error: {0}".format(
                timing_dict))
        return False

    success, timing_id = save_grader_data_in_timing_object(timing_dict)

    if not success:
        log.warning("Timing object finalization failed with error: {0}".format(
            timing_id))
        return False

    return True
示例#2
0
def initialize_timing(sub_id):
    success, timing_dict=generate_initial_timing_dict(sub_id)
    if not success:
        log.warning("Initial timing dict generation failed with error: {0}".format(timing_dict))
        return False

    success, timing_id = instantiate_timing_object(timing_dict)

    if not success:
        log.warning("Timing object instantiation failed with error: {0}".format(timing_dict))
        return False

    return True
示例#3
0
def initialize_timing(sub_id):
    success, timing_dict=generate_initial_timing_dict(sub_id)
    if not success:
        log.warning("Initial timing dict generation failed with error: {0}".format(timing_dict))
        return False

    success, timing_id = instantiate_timing_object(timing_dict)

    if not success:
        log.warning("Timing object instantiation failed with error: {0}".format(timing_dict))
        return False

    return True
示例#4
0
def finalize_timing(sub_id, grade_id):

    if isinstance(sub_id,Submission):
        sub_id=sub_id.id
    else:
        try:
            sub=Submission.objects.get(id=int(submission_id))
        except Exception:
            return False, "Invalid submission id."

    success, timing_dict=generate_final_timing_dict(sub_id,grade_id)
    if not success:
        log.warning("Final timing dict generation failed with error: {0}".format(timing_dict))
        return False

    success, timing_id=save_grader_data_in_timing_object(timing_dict)

    if not success:
        log.warning("Timing object finalization failed with error: {0}".format(timing_id))
        return False

    return True