Incompetent/bored math teacher < khan academy < better online learning platform < Good math teacher.
The number of bad math teachers across the whole planet is staggering considering that we are nearly 7 billion people on the planet especially more so in the developing and underdeveloped countries. Khan academy sets a reasonable good lowest common denominator education that our next generation of students can receive both in quality and coverage. Competition will just push this bar even higher.
To replace good teachers we may have to wait for deep AI even if wanted to do that. Till then KA, Udacity etc. can produce more autonomous students who can make better use of a great teacher's time.