mathmaker  0.4(alpha)
mathmaker_dev/sheet/AlgebraBalance_01.py
00001 # -*- coding: utf-8 -*-
00002 
00003 # Mathmaker creates automatically maths exercises sheets
00004 # with their answers
00005 # Copyright 2006-2014 Nicolas Hainaux <nico_h@users.sourceforge.net>
00006 
00007 # This file is part of Mathmaker.
00008 
00009 # Mathmaker is free software; you can redistribute it and/or modify
00010 # it under the terms of the GNU General Public License as published by
00011 # the Free Software Foundation; either version 3 of the License, or
00012 # any later version.
00013 
00014 # Mathmaker is distributed in the hope that it will be useful,
00015 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 # GNU General Public License for more details.
00018 
00019 # You should have received a copy of the GNU General Public License
00020 # along with Mathmaker; if not, write to the Free Software
00021 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023 import machine
00024 import exercise
00025 
00026 from S_Structure import S_Structure
00027 
00028 FONT_SIZE_OFFSET = 0
00029 SHEET_LAYOUT_TYPE = 'std'
00030 SHEET_LAYOUT_UNIT = "cm"
00031 # -----------------------  lines_nb    col_widths   exercises
00032 SHEET_LAYOUT = { 'exc' : [ None,                    'all'
00033                          ],
00034                  'ans' : [ None,                    'all'
00035                          ]
00036                }
00037 
00038 # ------------------------------------------------------------------------------
00039 # --------------------------------------------------------------------------
00040 # ------------------------------------------------------------------------------
00041 ##
00042 # @class AlgebraBalance_01
00043 # @brief A complete expansion&reduction training sheet. 01 without binomials
00044 class AlgebraBalance_01(S_Structure):
00045 
00046 
00047 
00048 
00049 
00050     # --------------------------------------------------------------------------
00051     ##
00052     #   @brief Constructor
00053     #   @param embedded_machine The machine to be used
00054     #   @param **options Any options
00055     #   @return One instance of sheet.AlgebraBalance_01
00056     def __init__(self, embedded_machine, **options):
00057         self.derived = True
00058         S_Structure.__init__(self, embedded_machine, FONT_SIZE_OFFSET,
00059                              SHEET_LAYOUT_UNIT, SHEET_LAYOUT,
00060                              SHEET_LAYOUT_TYPE)
00061 
00062         # BEGINING OF THE ZONE TO REWRITE (see explanations below) ------------
00063         self.header = ""
00064         self.title = _("Training exercises sheet :")
00065         self.subtitle = _("Expanding and reducing algebraic expressions")
00066         self.text = ""
00067         self.answers_title = _("Examples of answers")
00068 
00069         # Exercises list :
00070         ex1 = exercise.X_AlgebraExpressionReduction(self.machine,
00071                                                   x_kind='short_test',
00072                                                   x_subkind='easy')
00073 
00074         ex2 = exercise.X_AlgebraExpressionExpansion(self.machine,
00075                                                   x_kind='bypass',
00076                                                   x_subkind='sign_expansion',
00077                                                   number_of_questions=4,
00078                                                   start_number=3)
00079 
00080         ex3 = exercise.X_AlgebraExpressionExpansion(self.machine,
00081                                                   x_kind='bypass',
00082                                                   x_subkind='any_basic_expd',
00083                                                   number_of_questions=5,
00084                                                   start_number=7)
00085 
00086         ex4 = exercise.X_AlgebraExpressionExpansion(self.machine,
00087                                                   x_kind='bypass',
00088                                             x_subkind='sum_of_any_basic_expd',
00089                                                   number_of_questions=3,
00090                                                   start_number=12)
00091 
00092         self.exercises_list.append(ex1)
00093         self.exercises_list.append(ex2)
00094         self.exercises_list.append(ex3)
00095         self.exercises_list.append(ex4)
00096 
00097 
00098 
00099 
00100 
00101 
00102     # END ---------------------------------------------------------------------