Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let explain what I'm trying to create. I'm creating a framework, the idea is to provide base classes to generate a math problem.

Why do I need this framework? Because at first time, I realized when I create a new math problem I always do the same steps.

  • Configuration settings such range numbers. For example if I'm developing multiplications, in beginner level only generate the first number between 2-5 or in advanced level, the first number will be between 6- 9, for example.
  • Generate problem method. All the time I need to invoke a method like this to generate the problem. This one receives the configuration settings and generate the number according to them. And generate the object with the respective data.
  • Validate the problem. Sometimes the problem generated is not valid. For example, supposed I'm creating fractions in most simplified, if I receive 2/4, the program should detect that this is not valid and must generate another like this one, 1/4.
  • Load the view. All of them, have a custom view (please watch below the images).
  • All of the problems must know how to CHECK if the user result is correct.
  • All of this problems has answers. Some of them just require one answer, anothers may require more than one, so I guess a way to maintain flexibility to the developer has all the answers he wanna used.
  • At the beginning I started using PRISM. Generate modules for each math problem was the idea and load it in the main system.

I guess are the most important things of this idea.

Let me showing some problems which I create in a WPF standalone program. Here I have a math problem about areas. When I generate the problem a set to the view the object and it draw it.

enter image description here enter image description here

In beginner level, I set in the configuration settings that just load square types. But in advance level, can load triangles and squares randomly.

In this another, generate a binary problem like addition, subtraction, multiplication or division.

enter image description here enter image description here

Above just generate a single problem. The idea of this is to show a test o quiz, I mean get a worksheet (this I call as a collection of problems) where the user can answer it.

enter image description here

I hope gets the idea with my ugly drawing.

How to load this math problems? As I said above, I started using PRISM, and each module contains a math problem kind. This is a snapshot of my first demo.

enter image description here

Below show the modules loaded, and center the respective configurations or levels.

Until momment, I have no idea to start creating this software. I just know that I need a question | problem class, response class, user class.

But I get lost about what properties should have to contain in it.

Please give a little hand of this framework. I put much effort on this question, so if any isn't clear, let me know to clarify it.

share|improve this question
let me sum up your question: You want to create a framework to generate, configure and validate math problems. By framework, do you mean APIs that can be used? The following would make your question more clear: 1. Drawings are not visible, can you check again? 2. Mention a sample math problem and go through all the steps for it. 3. Your point about PRISM does not fit with the rest of the steps. Consider changing that portion. – TheSilverBullet Sep 13 '12 at 8:20

Turn the problem into a group of smaller problems (Modules if you like) that each have a single responsibility. For example "Generate problem method" is too high level to think about implementing. (considering all the different types of problems you have talked about generating: Worksheets, Diagrams etc.) If you split it into smaller parts you can then focus on solving each of these parts. You can then split these problems further if need be.

It seems to me like it is slightly too early for you to be thinking about classes. A helpful step can be thinking about these different modules of the program and how you will test them, if you cannot think of how you would go about testing them then you don't have a clear picture of their intended purpose.

Also, you will need a strong architecture to be able to build this efficiently, you have a lot of shared components such as validating the problems and the graphical interface but the problems themselves can be very different. I'm currently reading Design Patterns: Elements of Reusable Object-Oriented Software and would recommend it.

share|improve this answer

Great question! The way I see it, you're going to need lots of time, and I'm talking years.

If every problem you envision in your system can be solved with equational reasoning, or term rewriting then start with that.

Once you can get the reasoning down, then use Prolog to generate the problems.

Now you have the problem of accepting various user inputs that would be a valid answer. Use parsing and reasoning to get to the canonical answer.

Lastly, layer on the GUI such that it accepts and returns text strings that can work with the text system.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.