To let students skip unnecessary work in an AP class, you could factor in AP exam scores into class grades, either in a linear way

class_grade = w1*AP_exam_score + w2*coursework_grade

or in a nonlinear way

class_grade = max(AP_exam_score,coursework_grade)

where a student who does not do all the coursework but still gets a 5 on the AP exam gets an A for the course. Teachers may not welcome grading systems that reduce their control.