As soon as you're engaged as a professional, the rules of your engagement are clearly spelt out.
If you're a judge, you're not supposed to hold ex partè conversations or meetings. As soon as you do this, you're in breach of your code of ethics.
If you're a lecturer, the university forbids you from having any relationship in whatever form or shape, with your students, whom you have influence over. As soon as you do this, you you're in breach of your code of ethics. It doesn't matter if the student has reached the consensual age limit because the issue of imbalance of power, is till lingering.
An undercover agent or agent provocateur, can hardly catch you in the act under these circumstances where you breach your code in secret.
So what would the agent do? The agent would pose as a person whom you're forbidden per your code, to engage. This agent would then provoke you with questions that would elicit responses and then test these responses against your code of conduct/ethics which you're fully aware of as a professional
If you, in spite of being aware of the code, put out a behaviour in breach of it, then we can conclude that, you're guilty of the crime and that, it is your long-standing behaviour or tradition. Mind you, these agents only come to confirm what is already rife from grapevine sources.
You cannot therefore say, the 'real' crime didn't occur. What real crime are we looking at here? The breach of your code is not real crime? Dead conscience.
Prof Ransford Gyampo is one of my favorite social commentators. You'd find me quote him copiously to advance my arguments in many cases. Prof Gyampo responds to the BBc exposé by saying - no sex occurred, the person wasn't my student.
Dear professor, did the person (BBC reporter) come to you as a student? Yes. Did she tell you to mentor her? Yes. Did you make amorous moves toward her? Yes. Are you aware the university's code forbids completely having a relationship with a student? Yes. So by pursuing the fictional character, are you aware you breached your code? Yes.
Dear Prof, real sex didn't occur because the undercover agent wasn't going to allow that to happen of course. She only wanted to elicit your true behaviour behind the scenes. Everything in you (utterances, moves, etc) was clearly that, you wanted a dive into her body but as an undercover agent, she wouldn't allow the real thing to happen.
My advice to us all is that, whenever you're put in authority, you must act within the confines of the codes or rules that govern your work. Let's clean our conscience and stop justifying wrong.
The bottomline is that, Prof broke his code of ethics by intending to go into an amorous relationship with a student of the university.
NOTE: The BBC accused Prof of sexual harassment not sex for grades. The other Nigerian professors clearly said they give good grades for sex.