One of the features of Desire 2 Learn that I really like is the ability to include code in many places including test questions. However, there's a little tweak that must be done to make it work. Only the portion of the code included between the embed tags needs to be included. The rest can be deleted. Below is a demonstration of how this can be done in D2L.