If necessary, click the Sketchbook menu link in the left navigation panel to display the Sketchbook menu options in the middle panel.
All of your saved sketches are listed in the middle panel. If you have lots of saved sketches, you can order the list by name or by last modified date. You can also search by name.
Once you find the sketch you want to download, you can click the drop-down arrow next to the sketch name, and in the pop-up menu, select "Download Sketch."
Alternatively, you can click on the sketch's name to load the sketch into the code editor panel. Then click the 3-dot button at the top of the code editor panel, and select "Download Sketch."
The sketch will be downloaded as a ZIP file (compressed file). After the download is complete, locate the ZIP file in the Downloads folder on your computer, and uncompress the ZIP file:
On a Windows computer, right-click the ZIP file, and select "Extract All." Browse to the destination where you want to save the uncompressed file folder, and click "Extract."
On a Mac computer, just double-click the ZIP file. The uncompressed file folder will appear in your Downloads folder.
The uncompressed sketch will be contained inside a file folder with the same name as your sketch. Open the sketch's file folder. The sketch's filename will have an extension of .ino (which identifies it as an Arduino program). For example: hello_world.ino
The folder will also contain a file named ReadMe.adoc and another file named sketch.json. You don't need to submit those two files to your teacher.
Arduino IDE (Desktop Editor)
All of your sketches (apps/programs) are saved on your computer and can be easily located.
Open the Documents folder on your computer, and locate the folder named Arduino (which was automatically created when you first installed the Arduino IDE desktop editor).
Inside the Arduino folder, there is a subfolder for each of your sketches. (There will also be a folder named libraries that contains any libraries that you installed, such as the SparkFun RedBot Library.)
Open the subfolder for the sketch that you need. The sketch's filename will have an extension of .ino (which identifies it as an Arduino program). For example: hello_world.ino