示例#1
0
 def __init__(self, connue, composite):
     # on appelle Exercice.__init__ pour remplir tous les champs
     # mais self.datasets sera en fait rempli plus tard
     # une petite clôture..
     def target(inconnue): 
         return composite
     Exercice.__init__(self, target, None)
     self.connue = connue
     self.composite = composite
示例#2
0
 def correction(self, student_diff, extended, abbreviated):
     # start with the full dataset
     self.datasets = [Args(extended, abbreviated)]
     # make up a samples by taking only <sample> entries in each
     for sample in [10, 20, 40]:
         extended_sample = copy.deepcopy(extended[:sample])
         abbreviated_sample = copy.deepcopy(abbreviated[:sample])
         self.datasets.append(Args(extended_sample, abbreviated_sample))
     return Exercice.correction(self, student_diff)
示例#3
0
 def correction(self, student_comptage):
     # call the decorator on the student code
     return Exercice.correction(self, exercice_compliant(student_comptage))
示例#4
0
 def correction(self, student_decode_zen, this):
     self.datasets = [Args(this)]
     return Exercice.correction(self, student_decode_zen)
示例#5
0
 def correction(self, student_index, bateaux):
     self.datasets = [Args(bateaux)]
     return Exercice.correction(self, student_index)
示例#6
0
 def correction(self, student_merge, extended, abbreviated):
     self.datasets = [Args(extended, abbreviated)]
     return Exercice.correction(self, student_merge)
示例#7
0
 def correction(self, inconnue):
     # dans notre cas il n'y a qu'un seul jeu d'entrées
     self.datasets = [ Args(inconnue) ]
     def check(inconnue):
         return self.connue + inconnue + self.connue
     return Exercice.correction(self, check)