In English this phrase would probably sound more natural as "If I had only known," despite only usually being before the word it describes.
We know, we just put the words in the same order as in Swedish to make it easier on learners when translating the other way. It's not incorrect the way it is. But it's good that you're pointing it out, especially for the sake of the people who use the course to improve their English.
Yeah, I agree. "If I had only known" (or "had I only known") may be idiomatic, but it's a more natural construction in this case than "If I only had known."
I think I'd be most likely to say "If only I had known". Preference is probably somewhat regional. That said, "If I only had known" seems the most awkward of the bunch to my ears, too.
That's correct. In a subclause, a satsadverbial, which this is, must go before the verb. Other adverbials go after, like adverbials of degree, time etc.
sentence adverb (or sentence adverbial), which modifies a sentence, or a clause within a sentence, to convey the mood, attitude or sentiments of the speaker,
You can, but not with all possible word orders. So you can say If only I had known, but If just I had known does not work. I'll leave it to some native speaker of English to explain in which cases just works and why.
If I just had known and If I had just known both sound okay, but for me they usually are connected to another phrase. "If I just had known that, I wouldn't have picked up the spoon." Using just also gives the phrase a more petulant/exasperated/defensive tone, as well as making the phrase sound more conversational than literary.
There are subtle distinctions between all the varieties of this phrase, especially when spoken. It's just one of those phrases. :)