def is_valid_choice(choice_str, num_choices):
    """Check that the choice is a valid integer"""
    if not isinstance(num_choices, int):
        return False

    if num_choices < 1:
        return False

    if not isinstance(choice_str, str):
        return False

    if not choice_str.isdigit():
        return False

    choice_int = int(choice_str)

    if choice_int < 1 or choice_int > num_choices:
        return False

    return True