
    Design a function that modifies a student's pronunciation exercise by reversing only the vowel sounds in their written response, while keeping all consonants in their original positions, to create vocal awareness drills. The function should treat 'y' as a consonant and maintain the case sensitivity of the original text while only swapping the positions of a, e, i, o, and u characters.
    

    
def reverse_vowels(str1):
    """
    Design a function that modifies a student's pronunciation exercise by reversing only the vowel sounds in their written response, while keeping all consonants in their original positions, to create vocal awareness drills. The function should treat 'y' as a consonant and maintain the case sensitivity of the original text while only swapping the positions of a, e, i, o, and u characters.
    

    """
def reverse_vowels(str1):
    """
    Design a function that modifies a student's pronunciation exercise by reversing only the vowel sounds in their written response, while keeping all consonants in their original positions, to create vocal awareness drills. The function should treat 'y' as a consonant and maintain the case sensitivity of the original text while only swapping the positions of a, e, i, o, and u characters.
    

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