Narrative:

While on a first cross country training flight, the student pilot switched the fuel selector from the right tank position (furthest forward or down position) through the left tank position (center or straight up position) to the off position. Engine was at idle (1700 RPM), propeller was turning, and engine instruments were normal. I declared an emergency situation with partial power and was cleared to land at ZZZ. I made a successful landing on runway 7. No damage or injuries. After landing I attempted a restart without success. When my student moved her seat back, I noticed the fuel selector in the off position. I did not recognize the problem as fuel starvation since the engine instruments were all in green and the engine was developing 1800 RPM. I initially turned on the electric fuel pump (back up) and attempted a restart. From that point on, I concentrated on setting up best glide speed and flying to the closest airport (ZZZ) and making a dead stick landing. Other factors contributing: not recognizing that the fuel was inadvertently turned off. I have flown over 40 hours with this student and each flight required that the tanks be switched from right to left (I always start on the right tank). I am unable to see the switch from my position. The engine did not fail abruptly.

Google
 

Original NASA ASRS Text

Title: A PA28 CFI MADE A DEAD STICK LNDG AT ZZZ AFTER HIS STUDENT INADVERTENTLY PLACED THE FUEL SELECTOR TO 'OFF' DURING A TRAINING FLT IN ZZZ AIRSPACE.

Narrative: WHILE ON A FIRST XCOUNTRY TRAINING FLT, THE STUDENT PLT SWITCHED THE FUEL SELECTOR FROM THE R TANK POS (FURTHEST FORWARD OR DOWN POS) THROUGH THE L TANK POS (CTR OR STRAIGHT UP POS) TO THE OFF POS. ENG WAS AT IDLE (1700 RPM), PROP WAS TURNING, AND ENG INSTS WERE NORMAL. I DECLARED AN EMER SIT WITH PARTIAL PWR AND WAS CLRED TO LAND AT ZZZ. I MADE A SUCCESSFUL LNDG ON RWY 7. NO DAMAGE OR INJURIES. AFTER LNDG I ATTEMPTED A RESTART WITHOUT SUCCESS. WHEN MY STUDENT MOVED HER SEAT BACK, I NOTICED THE FUEL SELECTOR IN THE OFF POS. I DID NOT RECOGNIZE THE PROB AS FUEL STARVATION SINCE THE ENG INSTS WERE ALL IN GREEN AND THE ENG WAS DEVELOPING 1800 RPM. I INITIALLY TURNED ON THE ELECTRIC FUEL PUMP (BACK UP) AND ATTEMPTED A RESTART. FROM THAT POINT ON, I CONCENTRATED ON SETTING UP BEST GLIDE SPD AND FLYING TO THE CLOSEST ARPT (ZZZ) AND MAKING A DEAD STICK LNDG. OTHER FACTORS CONTRIBUTING: NOT RECOGNIZING THAT THE FUEL WAS INADVERTENTLY TURNED OFF. I HAVE FLOWN OVER 40 HRS WITH THIS STUDENT AND EACH FLT REQUIRED THAT THE TANKS BE SWITCHED FROM R TO L (I ALWAYS START ON THE R TANK). I AM UNABLE TO SEE THE SWITCH FROM MY POS. THE ENG DID NOT FAIL ABRUPTLY.

Data retrieved from NASA's ASRS site as of July 2007 and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.