
    Create a function that helps students practice phonetic awareness by rearranging only the vowel sounds in their written responses while keeping consonants in place, supporting their understanding of vowel patterns and pronunciation in language learning. The function should maintain all consonants and non-alphabetic characters in their original positions while reversing only the placement of vowels (a, e, i, o, u) within the text.
    

    
def reverse_vowels(str1):
    """
    Create a function that helps students practice phonetic awareness by rearranging only the vowel sounds in their written responses while keeping consonants in place, supporting their understanding of vowel patterns and pronunciation in language learning. The function should maintain all consonants and non-alphabetic characters in their original positions while reversing only the placement of vowels (a, e, i, o, u) within the text.
    

    """
def reverse_vowels(str1):
    """
    Create a function that helps students practice phonetic awareness by rearranging only the vowel sounds in their written responses while keeping consonants in place, supporting their understanding of vowel patterns and pronunciation in language learning. The function should maintain all consonants and non-alphabetic characters in their original positions while reversing only the placement of vowels (a, e, i, o, u) within the text.
    

    """
    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