The governing board of a school district may exempt any pupil enrolled in his last semester or quarter, as the case may be, of the 12th grade who, pursuant to Section 46145 or 46147, is permitted to attend school less than 240 or 180 minutes per day, from attending courses of physical education; provided, however, that such pupil may not be exempted pursuant to this section from attending courses of physical education if such pupil would, after such exemption, attend school for 240 minutes or more per day.