[gcompris] lang, fix a bug in case of excactly 12 triplets in the dataset



commit b058bdca7687570977e637caa5785a0f9a0460bd
Author: Jan Boon <janboon438%40gmail.com>
Date:   Sat Jan 10 23:41:26 2015 +0100

    lang, fix a bug in case of excactly 12 triplets in the dataset
    
    Two small changes in langLib.py to append all triplets to a lesson in Enrich
    your Vocabulary and all lessons to chapter (especially lessons with exactly 12
    triplets)

 src/lang-activity/langLib.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/lang-activity/langLib.py b/src/lang-activity/langLib.py
index cb723b8..bedb21c 100644
--- a/src/lang-activity/langLib.py
+++ b/src/lang-activity/langLib.py
@@ -119,9 +119,10 @@ class LessonCreator:
                     else:
                         self.lessons.append(lesson)
                         lesson = Lesson(lesson)
+                        lesson.triplets.append( triplet )
 
                         
-        if len(lesson.triplets) and len(lesson.triplets) < self.MAX_TRIPLETS:
+        if len(lesson.triplets) and len(lesson.triplets) <= self.MAX_TRIPLETS:
             # There is no enough triplet for this level, add the first
             # of the first lesson
             if len(self.lessons):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]