def check_or(state, *tests):
    """Test whether at least one SCT passes.

    If all of the tests fail, the feedback of the first test will be presented to the student.

    Args:
        state: State instance describing student and solution code, can be omitted if used with Ex()
        tests: one or more sub-SCTs to run

    :Example:
        The SCT below tests that the student typed either 'SELECT' or 'WHERE' (or both).. ::

            Ex().check_or(
                has_code('SELECT'),
                has_code('WHERE')
            )

        The SCT below checks that a SELECT statement has at least a WHERE c or LIMIT clause.. ::

            Ex().check_node('SelectStmt', 0).check_or(
                check_edge('where_clause'),
                check_edge('limit_clause')
            )
    """
    success = False
    first_feedback = None

    for test in iter_tests(tests):
        try:
            multi(state, test)
            success = True
        except TestFail as e:
            if not first_feedback:
                first_feedback = e.feedback
        if success:
            return state  # todo: add test

    state.report(first_feedback)
def check_or ( state , * tests ) : success = False first_feedback = None for test in iter_tests ( tests ) : try : multi ( state , test ) success = True except TestFail as e : if not first_feedback : first_feedback = e . feedback if success : return state state . report ( first_feedback )
Test whether at least one SCT passes.

    If all of the tests fail, the feedback of the first test will be presented to the student.

    Args:
        state: State instance describing student and solution code, can be omitted if used with Ex()
        tests: one or more sub-SCTs to run

    :Example:
        The SCT below tests that the student typed either 'SELECT' or 'WHERE' (or both).. ::

            Ex().check_or(
                has_code('SELECT'),
                has_code('WHERE')
            )

        The SCT below checks that a SELECT statement has at least a WHERE c or LIMIT clause.. ::

            Ex().check_node('SelectStmt', 0).check_or(
                check_edge('where_clause'),
                check_edge('limit_clause')
            )