protected override void TransformTaskItems()
        {
            var selectConcept = Lesson.DeepCopy();

            var derConcepts = selectConcept.NamedConcepts["Der"];
            var dieConcepts = selectConcept.NamedConcepts["Die"];
            var dasConcepts = selectConcept.NamedConcepts["Das"];

            var fourPictures = new List <Concept>();

            var random = new Random();

            switch (random.Next(0, 3))
            {
            case 0:
                AddToFourPictures(fourPictures, dieConcepts, derConcepts);
                break;

            case 1:
                AddToFourPictures(fourPictures, derConcepts, dieConcepts);
                break;

            case 2:
                AddToFourPictures(fourPictures, dasConcepts, dieConcepts);
                break;
            }

            BuildFourPictures(null, fourPictures, null);
        }
Beispiel #2
0
        protected override void TransformTaskItems()
        {
            var selectConcept = Lesson.DeepCopy();

            var fröhlich  = selectConcept.NamedConcepts["fröhlich"];
            var traurig   = selectConcept.NamedConcepts["traurig"];
            var weinend   = selectConcept.NamedConcepts["weinend"];
            var wütend    = selectConcept.NamedConcepts["wütend"];
            var angeekelt = selectConcept.NamedConcepts["angeekelt"];
            var lachend   = selectConcept.NamedConcepts["lachend"];
            var zufrieden = selectConcept.NamedConcepts["zufrieden"];

            var concepts = new List <Concept>();

            var random = new Random();

            switch (random.Next(0, 7))
            {
            case 0:
                AddToConcepts(concepts, fröhlich, traurig.Concat(angeekelt.Concat(weinend)).ToList());
                break;

            case 1:
                AddToConcepts(concepts, traurig, wütend.Concat(angeekelt.Concat(lachend)).ToList());
                break;

            case 2:
                AddToConcepts(concepts, weinend, zufrieden.Concat(lachend.Concat(fröhlich)).ToList());
                break;

            case 3:
                AddToConcepts(concepts, wütend, traurig.Concat(fröhlich.Concat(lachend)).ToList());
                break;

            case 4:
                AddToConcepts(concepts, angeekelt, wütend.Concat(zufrieden.Concat(weinend)).ToList());
                break;

            case 5:
                AddToConcepts(concepts, lachend, traurig.Concat(wütend.Concat(zufrieden)).ToList());
                break;

            case 6:
                AddToConcepts(concepts, zufrieden, weinend.Concat(fröhlich.Concat(angeekelt)).ToList());
                break;
            }

            if (exercise == null)
            {
                exercise = new SelectConceptExercise();
            }
            exercise.TaskItems = new List <List <Concept> >();
            int letterCount = 0;
            var row         = new List <Concept>();

            foreach (var concept in concepts)
            {
                var word = concept as Word;
                word.ShowAsPlainText = true;
                if (letterCount + word.Text.Length > LettersPerRow)
                {
                    exercise.TaskItems.Add(row);
                    letterCount = 0;
                    row         = new List <Concept>();
                }

                letterCount += word.Text.Length;
                row.Add(word);
            }
            exercise.TaskItems.Add(row);

            Lesson.LeftAlignItems = Enumerable.Repeat <bool>(true, exercise.TaskItems.Count).ToArray();
        }
Beispiel #3
0
        protected override void TransformTaskItems()
        {
            var selectConcept = Lesson.DeepCopy();

            var artDef       = selectConcept.NamedConcepts["ArtDef"];
            var artUndef     = selectConcept.NamedConcepts["ArtUndef"];
            var persPronSing = selectConcept.NamedConcepts["PersPronSing"];
            var persPronPlu  = selectConcept.NamedConcepts["PersPronPlu"];
            var nounSing     = selectConcept.NamedConcepts["NounSing"];
            var nounPlu      = selectConcept.NamedConcepts["NounPlu"];
            var verbPres     = selectConcept.NamedConcepts["VerbPres"];
            var verbPast     = selectConcept.NamedConcepts["VerbPast"];

            var concepts = new List <Concept>();

            var random = new Random();

            switch (random.Next(0, 8))
            {
            case 0:
                AddToConcepts(concepts, artDef, artUndef.Concat(persPronSing.Concat(nounSing)).ToList());
                break;

            case 1:
                AddToConcepts(concepts, artUndef, artDef.Concat(persPronSing.Concat(nounPlu)).ToList());
                break;

            case 2:
                AddToConcepts(concepts, persPronSing, artUndef.Concat(persPronPlu.Concat(nounSing)).ToList());
                break;

            case 3:
                AddToConcepts(concepts, persPronPlu, artDef.Concat(persPronPlu.Concat(nounPlu)).ToList());
                break;

            case 4:
                AddToConcepts(concepts, nounSing, verbPres.Concat(nounPlu.Concat(persPronSing)).ToList());
                break;

            case 5:
                AddToConcepts(concepts, nounPlu, verbPast.Concat(nounSing.Concat(artUndef)).ToList());
                break;

            case 6:
                AddToConcepts(concepts, verbPres, nounPlu.Concat(verbPast.Concat(persPronPlu)).ToList());
                break;

            case 7:
                AddToConcepts(concepts, verbPast, nounSing.Concat(verbPres.Concat(artDef)).ToList());
                break;
            }

            if (exercise == null)
            {
                exercise = new SelectConceptExercise();
            }
            exercise.TaskItems = new List <List <Concept> >();
            int letterCount = 0;
            var row         = new List <Concept>();

            foreach (var concept in concepts)
            {
                var word = concept as Word;
                word.ShowAsPlainText = true;
                if (letterCount + word.Text.Length > LettersPerRow)
                {
                    exercise.TaskItems.Add(row);
                    letterCount = 0;
                    row         = new List <Concept>();
                }

                letterCount += word.Text.Length;
                row.Add(word);
            }
            exercise.TaskItems.Add(row);

            Lesson.LeftAlignItems = Enumerable.Repeat <bool>(true, exercise.TaskItems.Count).ToArray();
        }