Requesting a recommendation before the end of the course I am applying for PhD school and I need to 3-4 reference letters. I have 3 references but 2 of them are from my undergraduate institution and the 3rd is my current master's thesis advisor. I was told that it is not good to have just one recommendation from my graduate institution. I decided to try to get a fourth letter.  

I took courses with many professors during my master's study but none of them really know me that well. I am taking a course this semester with a professor for the first time and I don't know what he thinks of me, but we have a final project which I tried to do so well that I can get a very good recommendation. After showing my project to my peers who already took the course they said that he will like it a lot and you can expect a very good impression. The problem that I have now is that the deadlines are very close to the final project presentation (only four days apart).

Also, We still have a final exam so I really don't know if it would be ok to get a recommendation is such a circumstances.

Is it OK to explain the situation to the professor and give him an early presentation of my work so that he can use it in his recommendation?
I don't see how what you suggest isn't worth a shot, if you explain the professor your reasons? It's what I would naturally try. I would go further and offer to hand it in early. Just be ready to back off gracefully if you hear that he is too busy now or doesn't want to do it like this, in which case I would ask if he has suggestions how to handle this respecting both your schedules and commitments (after confirming that he is open to help in principle).