I agree with my colleague that "Only if A, then B" is not idiomatic English, and so it's hard to know what your teacher meant. In teaching logic over the years, I've seen many examples that take this form: "Only if A, B" — leaving the word "then" out. An English example might be the somewhat stilted but acceptable "Only if you're at least 18 are you eligible to vote." That's the same as saying "You are eligible to vote only if you're at least 18." And that's different from saying "If you're at least 18, you're eligible to vote." Saying "If you're at least 18, you're eligible to vote" means that there are no other qualifications needed; being 18 or older is enough. Saying "You're eligible to vote only if you're at least 18" allows that there may be other requirements as well, such as being a citizen. So if what your teacher meant was "Only if A, B," then perhaps my example shows that this isn't the same as "If A then B."
Our panel of 91 professional philosophers has responded to
Question of the Day
It sounds to me as though your teacher may be using the awkward expression "Only if A, then B" as a way of asserting the biconditional "A if and only if B," which is equivalent to the biconditional "B if and only if A." As I say, the expression is awkward, but in any case I wouldn't read it as adding a modal operator like "Necessarily" to the conditional "If A, then B." Whoever wants to say "necessarily" really needs to use that word.
Other than your teacher's decision, I can't think of any reason to treat "Only if A, then B" as the biconditional "A if and only if B." The form "Only if A, then B" isn't something you'll encounter in idiomatic English. Competent speakers wouldn't say, "Only if all humans are mortals, then all nonmortals are nonhuman." Instead, they'd say "All humans are mortals if and only if all nonmortals are nonhumans." But it's probably wise to follow your teacher's decision, at least until you're done with the course!