The flight instructor's improper use raising of the flaps. Contributing factors were the student pilot's misunderstanding of the instructor's intentions, the instructor's inadequate supervision of the student pilot, the density altitude, and the soft terrain.