I was about to report Glenn's patch. I have just pulled it into master and submitted and pulled a duplicate into develop.
Danny Glin's comment about trying to refactor the way past answers and sticky answers are stored so that Problem.pm and GatewayQuiz.pm can use exactly the same subroutines is still relevant.
Refactoring will make maintenance easier and might possibly clean up some of the squirrelier aspects of the code. Is anyone interested?
Also see https://github.com/orgs/openwebwork/projects/6 where this issue has now been moved to "Done". :-)