Embed IDE on courses

I run some courses that require students to write code (Python PHP, Ruby on Rails etc) and I want to find a solution to embed an IDE inside my courses for students to use and debug their code. Most preferably, their code could be submitted for grading or be graded automatically.
Have you ever used such a funcionality? I was thinking of using Repl.it or trinket.io. Does anybody have an alternative that can work with LTI or can be easily embedded in my courses?