def get_ta_status_flag(funding_status):
    """Generate TA status flag for student entry.

    This flag is from a "teaching preference request" perspective, not a funding
    perspective.

    Arguments:
        funding_status (str): funding entry for current term

    Returns:
        (str) : flag ("" for non-TA, "*" for TA, or "?" for unrecognized)

    """

    if (len(funding_status.split())==0):
        base_status = ""
    else:
        base_status = funding_status.split()[0]

    if (base_status in [
            # standard
            "G","NS","RA","RA-ext","RA-intern","RA-univ","Fellow-ext","Fellow-univ","Fellow-dept",
            # special case
            "TA-NA",  # TA with no assignment (special GA support)
            "Fellow-remote",  # GA funded 20b special arrangement
            "GA",  # special GA support
            # legacy
            "Fellow"
    ]):
        # RA or unfunded or otherwise no teaching duty
        flag=""
    elif (base_status in ["TA","TA/RA"]):
        # TA
        flag="*"
    else:
        # fallthrough
        flag="?"

    return flag