The correct answer is- The ending of the play surprised the audience.
Additional Information
The given sentence is in a passive voice form, hence we need to convert it into an active voice form.
Find the subject (The audience) and object (the ending of the play) of the sentence and exchange their places.
The given sentence is in the simple past tense.
The active verb form for simple past is: Subject + past participle form of the verb + Object.
So, 'was surprised' changes to 'surprised'. At last line up the remaining part.
Following these steps, we finally get- The ending of the play surprised the audience.