 " Elementary School Musical " was written by Tim Long and directed by Mark Kirkland . The episode features guest appearances from Lea Michele , Cory Monteith , and Amber Riley from the Fox series Glee . The three previously revealed their appearances on Twitter in February 2010 . Physicist Stephen Hawking also made an appearance . Flight of the Conchords members Jemaine Clement and Bret McKenzie first rehearsed their lines over the phone with Nancy Cartwright , the voice of Bart , before flying to the United States to record their parts for the show . Clement , a fan of the show since it first aired as shorts on The Tracey Ullman Show , said that he and McKenzie would play new characters , rather than themselves . He continued : 
