Ask for a recommendation letter from a teacher in the university I'm applying to My situation is a bit unusual: I plan to apply for a second Master's degree in a foreign university I did an exchange semester in. It is pretty well-ranked compared to my current one. The Master's is related to my current one, but contains more theory (from a computer science degree with data science courses to a machine learning degree).

I need two letters of recommendation, and I am thinking about asking professors whose courses I followed during my exchange semester. Since my application is borderline (good grades lately, less so in my first two years of bachelor's) and the program is competitive, I assume that a letter of recommendation from professors at the same university would give my application a much-needed boost, especially since they teach courses in the program I am applying to.

I don't know how to ask for letters. I have never done it, and while I passed these courses, I didn't have the kind of stellar results that would make them call me a genius in the letter, though I think that they would be willing to help if I asked.

Is a good letter from my current university a better bet than an okay one from the university I apply to? Should I send one letter from my current uni, and one from the one I want? Is it even a good idea to ask these teachers for letters if I didn't have a close working relationship with them? If so, how would I go about asking them for a letter?
I doubt that the letter from a professor at the other university, especially if just "okay" is going to help you much, if at all. If s/he writes you a letter, ethics might require that they can't participate in your admission in any other way. I'd suggest it is better to get good letters from those who know you well, and if the other's remember you positively it will just be an added bonus. 

Of course, if someone knows you, they might also be limited in how they can participate, depending on the nature of the rules in place.