In fall 2013, Samir Nurmohamed wanted desperately to go out with Salimah Nooruddin. There was only one problem: He had decided that she had to ask him out first.

He was — and is — an assistant professor of management at the Wharton School in Philadelphia who is known by his students for rapping his course concepts. And Ms. Nooruddin was a student there.

They had met car-pooling to their place of worship, which was 40 minutes away, since both are members of a small sect of Islam called Shia Imami Ismaili. And it didn’t take long for Mr. Nurmohamed to become smitten.

And he didn’t figure it would look quite right for a professor to ask out a student — that she might feel pressured to say yes to a member of the faculty, even though she was not in any of his classes and they were both 27 at the time.