
    Create a function that helps students practice phonetic awareness by reversing only the vowel positions in their written responses while keeping consonants in place, where 'y' is treated as a consonant. The function should maintain the original character casing and leave all non-vowel characters unchanged, serving as an interactive tool for analyzing vowel patterns in words.
    

    
def reverse_vowels(str1):
    """
    Create a function that helps students practice phonetic awareness by reversing only the vowel positions in their written responses while keeping consonants in place, where 'y' is treated as a consonant. The function should maintain the original character casing and leave all non-vowel characters unchanged, serving as an interactive tool for analyzing vowel patterns in words.
    

    """
def reverse_vowels(str1):
    """
    Create a function that helps students practice phonetic awareness by reversing only the vowel positions in their written responses while keeping consonants in place, where 'y' is treated as a consonant. The function should maintain the original character casing and leave all non-vowel characters unchanged, serving as an interactive tool for analyzing vowel patterns in words.
    

    """
    vowels = ''
    for char in str1:
        if char in 'aeiouAEIOU':
            vowels += char
    result_string = ''
    for char in str1:
        if char in 'aeiouAEIOU':
            result_string += vowels[-1]
            vowels = vowels[:-1]
        else:
            result_string += char
    return result_string