Hello, my name is George Bouris.
In addition to my Javascript proficiency, I have a very strong background in math.
This game cannot really produce unlimited different questions, since the folding axes are very limited (16) and many of them are symmetric in rotation, but it can produce a relatively big number.
I can write for you a Javascript class, which will accept a HTML div as an argument, when it is instantiated. It will create a canvas inside this div and draw the calculated image inside it.
Behind the scene, it will use a matrix of simple objects, with a single property, which is also a matrix, for the representation of multiple hole positions. So, when a folding happens, some of the hole positions will overlap, hence coexist with other, occupying more elements inside these arrays.
When a new round initiated, it will generate a random number of folds and select them in random order from the 16 possible. For each of these foldings, based on the number of it, it will move the values of the property arrays in the aforementioned object array.
Finally, it will generate a random number of punches and apply them on the occupied hole positions, appending the respective numbers from the property array to a single dimension array.
The shapes of the folded paper will be created using the generated folds.
Using the one dimension array, it will create the correct answer.
The wrong answers will be produced by arrays filled with random numbers.
I hope my description to be clear