It's correct both in British English https://www.lexico.com/en/definition/ma%27am and American English https://www.merriam-webster.com/dictionary/ma%27am
mea domina -> ma dame -> madam -> ma’am (for centuries one word).
I don't see the point in using "ma'am" rather than "madam".
Ok from what I see in Wiktionary it's rather an American way of politeness. My English education is mainly British so I was very puzzled:
Wiktionary: In British English, ma'am has become uncommon In American English, the full form madam is limited as a form of address to certain highly formal environments, while ma'am is the usual term. Ma'am is not often used in the other sense of madam, but is used as a polite form of address toward: - a female teacher or school official in a school which emphasizes formality
The choices that were given in English didn't match the meaning of this sentence. The word "ma" in English is a slang term for mother and did not register in my mind as a shortened form for "ma'am." I understood the sentence but could not translate it properly given the choices.