Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
gnumch.InequalityLevelset Class Reference
Inheritance diagram for gnumch.InequalityLevelset:
Inheritance graph
[legend]
Collaboration diagram for gnumch.InequalityLevelset:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getTitle
def getNumber
def setLevel
def getError
def getNumberWithAnswer
def getPlus
def getMinus
def getTimes
def getDivide

Public Attributes

 answermin
 curlevel
 cur_sublevel
 answer
 numlevels
 num_sublevels
 levelops

Detailed Description

Definition at line 290 of file gnumch.py.


Member Function Documentation

def gnumch.ExpressionLevelset.getDivide (   self,
  answer 
) [inherited]

Definition at line 261 of file gnumch.py.

00261 
00262     def getDivide(self, answer):
00263         n = random.randint(1, 5)
00264         return Number( _(u'%d \u00f7 %d') % (answer*n, n), 1 )

def gnumch.ExpressionLevelset.getError (   self,
  num 
) [inherited]

Definition at line 237 of file gnumch.py.

00237 
00238     def getError(self, num):
00239         fmt = _('%s = %d')
00240         return fmt % (num.text, num.value)

def gnumch.ExpressionLevelset.getMinus (   self,
  answer 
) [inherited]

Definition at line 252 of file gnumch.py.

00252 
00253     def getMinus(self, answer):
00254         n = random.randint(answer, answer*2)
00255         num = Number( _(u'%d \u2212 %d') % (n, n-answer), 1 )
00256         return num

Reimplemented from gnumch.EqualityLevelset.

Definition at line 294 of file gnumch.py.

00294 
00295     def getNumber(self):
00296         num = super(InequalityLevelset, self).getNumber()
00297         if num.good:
00298             num.good = 0
00299         else:
00300             num.good = 1
00301         return num

def gnumch.ExpressionLevelset.getNumberWithAnswer (   self,
  answer 
) [inherited]

Definition at line 241 of file gnumch.py.

00241 
00242     def getNumberWithAnswer(self, answer):
00243         fn = random.choice( self.levelops[self.curlevel-1] )
00244         num = fn(answer)
00245         num.value = answer
00246         return num

Here is the caller graph for this function:

def gnumch.ExpressionLevelset.getPlus (   self,
  answer 
) [inherited]

Definition at line 247 of file gnumch.py.

00247 
00248     def getPlus(self, answer):
00249         n = random.randint(0, answer)
00250         num = Number( _(u'%d + %d') % (n, answer-n), 1 )
00251         return num

def gnumch.ExpressionLevelset.getTimes (   self,
  answer 
) [inherited]

Definition at line 257 of file gnumch.py.

00257 
00258     def getTimes(self, answer):
00259         n = random.choice( getFactors(answer) )
00260         return Number( _(u'%d \u00d7 %d') % (n, answer/n), 1 )

Here is the call graph for this function:

Reimplemented from gnumch.EqualityLevelset.

Definition at line 291 of file gnumch.py.

00291 
00292     def getTitle(self):
00293         return _('Not equal to %d') % (self.answer,)

def gnumch.EqualityLevelset.setLevel (   self,
  level,
  sublevel 
) [inherited]

Definition at line 273 of file gnumch.py.

00273 
00274     def setLevel(self, level, sublevel):
00275         self.curlevel = level
00276         self.cur_sublevel = sublevel
00277         self.answer = self.answermin + self.cur_sublevel


Member Data Documentation

Definition at line 276 of file gnumch.py.

Definition at line 268 of file gnumch.py.

Reimplemented from gnumch.ExpressionLevelset.

Definition at line 275 of file gnumch.py.

Reimplemented from gnumch.ExpressionLevelset.

Definition at line 274 of file gnumch.py.

Definition at line 226 of file gnumch.py.

Definition at line 225 of file gnumch.py.

Definition at line 224 of file gnumch.py.


The documentation for this class was generated from the following file: