1 | initial version |
The canonical answer about open source randomly generated exercises is WeBWorK. There are some WeBWorK problems which use the Sage cell server to generate stuff on the fly, and the infrastructure is all there for a lot of interaction back and forth. But what you are looking for is probably done best through them, using Sage to do certain things for them (such as compute the types of things you're looking for). Certainly nontrivial problems of the type you are describing need some finessing, but I think WW is flexible enough for this.