A filtering of the given Submission queryset for all submissions that were successfully validated. This includes the following cases:

            - The submission was submitted and there are no tests.
            - The submission was successfully validity-tested, regardless of the full test status (not existent / failed / success).
            - The submission was graded or the grading was already started.
            - The submission was closed.

            The idea is to get all submissions that were a valid solution, regardless of the point in time where you check the list.

def qs_valid(qs):
        '''
            A filtering of the given Submission queryset for all submissions that were successfully validated. This includes the following cases:

            - The submission was submitted and there are no tests.
            - The submission was successfully validity-tested, regardless of the full test status (not existent / failed / success).
            - The submission was graded or the grading was already started.
            - The submission was closed.

            The idea is to get all submissions that were a valid solution, regardless of the point in time where you check the list.
        '''
        return qs.filter(state__in=[Submission.SUBMITTED, Submission.SUBMITTED_TESTED, Submission.TEST_FULL_FAILED, Submission.GRADING_IN_PROGRESS, Submission.GRADED, Submission.CLOSED, Submission.CLOSED_TEST_FULL_PENDING])