예제 #1
0
    def submission_enqueue_operations(self, submission):
        """Push in queue the operations required by a submission.

        submission (Submission): a submission.

        return (int): the number of actually enqueued operations.

        """
        new_operations = 0
        for dataset in get_datasets_to_judge(submission.task):
            submission_result = submission.get_result(dataset)
            number_of_operations = 0
            for operation, priority, timestamp in submission_get_operations(
                    submission_result, submission, dataset):
                number_of_operations += 1
                if self.enqueue(operation, priority, timestamp):
                    new_operations += 1

            # If we got 0 operations, but the submission result is to
            # evaluate, it means that we just need to finalize the
            # evaluation.
            if number_of_operations == 0 and submission_to_evaluate(
                    submission_result):
                logger.info("Result %d(%d) has already all evaluations, "
                            "finalizing it.", submission.id, dataset.id)
                submission_result.set_evaluation_outcome()
                submission_result.sa_session.commit()
                self.evaluation_ended(submission_result)

        return new_operations
예제 #2
0
    def submission_enqueue_operations(self, submission):
        """Push in queue the operations required by a submission.

        submission (Submission): a submission.

        return (int): the number of actually enqueued operations.

        """
        new_operations = 0
        for dataset in get_datasets_to_judge(submission.task):
            submission_result = submission.get_result(dataset)
            number_of_operations = 0
            for operation, priority, timestamp in submission_get_operations(
                    submission_result, submission, dataset):
                number_of_operations += 1
                if self.enqueue(operation, priority, timestamp):
                    new_operations += 1

            # If we got 0 operations, but the submission result is to
            # evaluate, it means that we just need to finalize the
            # evaluation.
            if number_of_operations == 0 and submission_to_evaluate(
                    submission_result):
                logger.info(
                    "Result %d(%d) has already all evaluations, "
                    "finalizing it.", submission.id, dataset.id)
                submission_result.set_evaluation_outcome()
                submission_result.sa_session.commit()
                self.evaluation_ended(submission_result)

        return new_operations
예제 #3
0
    def user_test_enqueue_operations(self, user_test):
        """Push in queue the operations required by a user test.

        user_test (UserTest): a user test.

        return (int): the number of actually enqueued operations.

        """
        new_operations = 0
        for dataset in get_datasets_to_judge(user_test.task):
            for operation, priority, timestamp in user_test_get_operations(
                    user_test, dataset):
                if self.enqueue(operation, priority, timestamp):
                    new_operations += 1

        return new_operations
예제 #4
0
    def user_test_enqueue_operations(self, user_test):
        """Push in queue the operations required by a user test.

        user_test (UserTest): a user test.

        return (int): the number of actually enqueued operations.

        """
        new_operations = 0
        for dataset in get_datasets_to_judge(user_test.task):
            for operation, priority, timestamp in user_test_get_operations(
                    user_test, dataset):
                if self.enqueue(operation, priority, timestamp):
                    new_operations += 1

        return new_operations