Students walk to and from class along the hallways of the former Cardozo Senior High School. (Marvin Joseph/The Washington Post)

Twenty years ago, Shermaine Mitchell-Ryan was a student at the former Cardozo High School thinking about college. She realized the level of instruction at most D.C. schools was so low that higher education for her could be a disaster.

So she enrolled in the TransTech (now TransSTEM) Academy. It was a school within a school designed to give disadvantaged teenagers full-strength courses and college-level exams. The hope was that it would prepare them for the rigor of heavy reading lists and long lectures in college.

The program celebrates its 25th anniversary Tuesday, as founder Shirley McCall retires and star Advanced Placement English teacher Frazier O’Leary welcomes the alumni. Mitchell-Ryan is now a science and technology policy fellow at the American Association for the Advancement of Science. She has a doctorate in cancer biology from Wayne State University’s School of Medicine.

Like nearly all Cardozo students before and since, she failed the three-hour AP English exam she took during her senior year. The program’s students were too far behind to achieve AP proficiency, but they learned more than they would have in a non-AP course, Cardozo graduates tell me. Mitchell-Ryan said O’Leary’s class for the first time “required me to develop my own thoughts rather than regurgitating information.”

AP, International Baccalaureate and Cambridge courses are increasing rapidly in high schools. This includes places like Cardozo, where 99 percent of the students are low-income and few land on the high-achievement end of any bell curve. “AP classes should be for those at the right of the curve,” a reader commented on one of my columns online. Many agree.

But teachers and students at schools like Cardozo have a different attitude. Katherine Arias, who just graduated from Cardozo, thought that before she encountered O’Leary, her English courses “were always too slow paced, the assignments were too simple. . . . When I realized my AP class was the complete opposite, I was ecstatic.” She said, “Everyone expects the bare minimum from” inner-city students, “but our teacher always pushed us to exceed our grasp.”

Preuss, a public charter high school at the University of California at San Diego, requires that students be from low-income families. Most take at least six AP classes, and just 31 percent of their AP exams earn passing marks. But after dealing with AP courses and tests and a longer school day and year, Preuss STEM coordinator Anne Artz said, they can handle college classes that have “over 100 students in a lecture hall” and that give “them little opportunity to ask questions or get individual help.”

“Our teachers, working with some of the neediest students in San Diego, will tell you that the students rise to the challenge,” Artz said. “They do not drag down the upper-end students.”

Kelly H. Ginley, a former AP English teacher who now runs the Advancement Via Individual Determination program at Falls Church High School, said the same happened at his school, part of Fairfax County’s two-decade commitment to AP and IB for all who want it.

Ginley did not like having average students in his AP classes when he was a high-performing student at Fairfax’s Madison High School. But when he became a teacher, he remembered his favorite instructor, Sherry Levitt, “did not let the fact that there were many different skill levels in her class get in the way of teaching me up to a 5 on the exam,” the highest score.

Alumni of the Cardozo program gather every year to thank their teachers and report their successes after they failed the AP exam. I have attended some of these reunions. Graduates have many tough teacher stories.

“Thank you, Dr. O’Leary,” recent graduate Karie Paz said in an essay, “for telling me to get out of your face because I was not dropping the class.”

Educators like that develop character. Hard courses and tests help. All of us flunk something in life, which teaches us how to handle the next challenge.