If someone in your class places an apple on your teacher's desk in an ingratiating manner, that means he's making a calculated move to suck up and win your teacher's favor.
The word ingratiating comes from a combination of the Latin prefix in- meaning "in" and gratia meaning "favor, grace." A person who is ingratiating is trying to get in the favor or grace of those around her. But the word doesn't always have to imply a sly attempt at winning others over, sometimes it can simply mean charming or agreeable. A person's smile can be ingratiating, winning people over simply with its charm.