Menu

The Way It Works

Nicolas Hainaux

Mathmaker creates Sheets of maths Exercises. Each Exercise contains Questions. Each Question uses objects from the core, that embbed enough information to compute and write the text of the Question and also the answer.

The main executable performs following steps:

  • Read command line option and verify them (especially the language)
  • Check that a correct version of euktoeps is installed and working
  • Then a Machine object is instanciated (to write LaTeX output, as of today)
  • Check that the sheet required by the user (as command line parameter) does exist
  • If everything's ok, the Machine writes the output of the required sheet to stdout

The Machine object can be seen as a typewriter : it takes the mathematical objects and turns them into the output format (LaTeX, so far) ; it draws figures from the geometrical objects (using eukleides) etc.

The Sheet objects given to a Machine are a guideline for the Machine to type what is expected on output: the layout of the Sheet, which kind of Exercises it embedds, how many Exercises etc.

The Exercise objects contains Questions and also layout informations that might be specific to the exercise (for instance, display the equations' resolutions in two columns).

The Question objects contains basic objects from the core and uses them to compute texts and answers.

The informations embedded by the core objects are independant from the output format. For instance, a Question about Pythagora's theorem would embed an object RightTriangle (which itself embeds information on its sides' lengths for instance ; and enough methods to create a picture of it) but also fields telling if the figure should be drawn in the Question's text or if only a description of the figure should be given ; if the hypotenuse should be calculated or another side ; if the result should be a rounded decimal and how precise it should be etc.

When a new Sheet is created, all objects it contains are created randomly, following some rules, though.

An example to understand globally how it works.

Some details before diving into core :

  • The file mathmaker.cfg contains some variable the user might like to change easily without having to dive into the code
  • The lib directory contains various methods and variables, mainly used by core objects but also Question objects
  • The locale directory contains all stuff related to internationalization (here are the po files to edit with poedit)
  • The maintenance directory contains anything related to debugging and to tests.

Related

Doc for dev: Home