"He is not playing with our elephants."
Translation:Er spielt nicht mit unseren Elefanten.
It is written in one of the sites about german grammar that
"In sentences with direct or indirect object "nicht" is located in the end of sentence."
Therefore I wrote "Er spielt mit unseren Elefanten nicht" and DL accepted it but it proposed the other, alternative translation "Er spielt nicht mit unseren Elefanten."
It doesn't obey the above rule. Is it correct?
Yes, it's correct. In fact, "Er spielt nicht mit unseren Elefanten" sounds much better than what you wrote. The reason for this is that "mit unseren Elefanten" contains a preposition ("mit"). Therefore, it follows the rules mentioned under the heading "prepositional phrases" in your link, not the ones for direct/indirect (accusative/dative) objects.
See also the information about "nicht" in connection with prepositional objects here (bottom of page): http://www.canoo.net/services/OnlineGrammar/Satz/Negation/Stellung/nichtkontrast.html?lang=en