Ejemplo n.º 1
0
        public void WordsBySunMoonTest()
        {
            var builderParams = SetupFakeGame();
            var builder       = new WordsBySunMoonQuestionBuilder(nPacks: nPacks, parameters: builderParams);

            builder.CreateAllQuestionPacks();
        }
Ejemplo n.º 2
0
        public IQuestionBuilder SetupBuilder()
        {
            IQuestionBuilder builder = null;

            int nPacks   = 10;
            int nCorrect = 1;
            int nWrong   = 5;

            var builderParams = new Teacher.QuestionBuilderParameters();

            switch (Variation)
            {
            case ToboganVariation.LetterInAWord:
                builder = new LettersInWordQuestionBuilder(nPacks, nCorrect, nWrong, parameters: builderParams);
                break;

            case ToboganVariation.SunMoon:
                builder = new WordsBySunMoonQuestionBuilder(nPacks, parameters: builderParams);
                break;
            }

            if (builder == null)
            {
                throw new System.Exception("No question builder defined for variation " + Variation.ToString());
            }

            return(builder);
        }
Ejemplo n.º 3
0
        public override IQuestionBuilder SetupBuilder()
        {
            IQuestionBuilder builder = null;

            int nPacks   = 10;
            int nCorrect = 1;
            int nWrong   = 5;

            var builderParams = InitQuestionBuilderParamaters();

            switch (Variation)
            {
            case ToboganVariation.LetterInWord:
                builderParams.wordFilters.excludeLetterVariations = true;
                builderParams.wordFilters.excludeDipthongs        = true;
                builder = new LettersInWordQuestionBuilder(nPacks, nCorrect: nCorrect, nWrong: nWrong, parameters: builderParams);
                break;

            case ToboganVariation.SunMoon:
                builder = new WordsBySunMoonQuestionBuilder(nPacks, parameters: builderParams);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(builder);
        }
Ejemplo n.º 4
0
        private void SimulateQuestionBuilder(QuestionBuilderType builderType)
        {
            LetterAlterationFilters letterAlterationFilters = null;

            switch (lettersVariationChoice)
            {
            case 0:
                letterAlterationFilters = LetterAlterationFilters.FormsOfSingleLetter;
                break;

            case 1:
                letterAlterationFilters = LetterAlterationFilters.FormsOfMultipleLetters;
                break;

            case 2:
                letterAlterationFilters = LetterAlterationFilters.MultipleLetters;
                break;

            case 3:
                letterAlterationFilters = LetterAlterationFilters.PhonemesOfSingleLetter;
                break;

            case 4:
                letterAlterationFilters = LetterAlterationFilters.PhonemesOfMultipleLetters;
                break;

            case 5:
                letterAlterationFilters = LetterAlterationFilters.FormsAndPhonemesOfMultipleLetters;
                break;
            }


            var builderParams        = SetupBuilderParameters();
            IQuestionBuilder builder = null;

            switch (builderType)
            {
            case QuestionBuilderType.RandomLetters:
                builder = new RandomLettersQuestionBuilder(nPacks: nPacks, nCorrect: nCorrectAnswers, nWrong: nWrongAnswers, firstCorrectIsQuestion: true, parameters: builderParams);
                break;

            case QuestionBuilderType.RandomLetterForms:
                builder = new RandomLetterAlterationsQuestionBuilder(nPacks: nPacks, nCorrect: nCorrectAnswers, nWrong: nWrongAnswers, letterAlterationFilters: letterAlterationFilters, parameters: builderParams);
                break;

            case QuestionBuilderType.Alphabet:
                builder = new AlphabetQuestionBuilder(parameters: builderParams);
                break;

            case QuestionBuilderType.LettersBySunMoon:
                builder = new LettersBySunMoonQuestionBuilder(nPacks: nPacks, parameters: builderParams);
                break;

            case QuestionBuilderType.LettersByType:
                builder = new LettersByTypeQuestionBuilder(nPacks: nPacks, parameters: builderParams);
                break;

            case QuestionBuilderType.LettersInWord:
                builder = new LettersInWordQuestionBuilder(nRounds: nPacks, nPacksPerRound: nPacksPerRound, nCorrect: nCorrectAnswers, nWrong: nWrongAnswers, useAllCorrectLetters: true, parameters: builderParams);
                break;

            case QuestionBuilderType.LetterFormsInWords:
                builder = new LetterFormsInWordsQuestionBuilder(nPacks, nPacksPerRound, parameters: builderParams);
                break;

            case QuestionBuilderType.LetterAlterationsInWords:
                builder = new LetterAlterationsInWordsQuestionBuilder(nPacks, nPacksPerRound, parameters: builderParams, letterAlterationFilters: letterAlterationFilters);
                break;

            case QuestionBuilderType.CommonLettersInWords:
                builder = new CommonLetterInWordQuestionBuilder(nPacks: nPacks, nWrong: nWrongAnswers, parameters: builderParams);
                break;

            case QuestionBuilderType.RandomWords:
                builder = new RandomWordsQuestionBuilder(nPacks: nPacks, nCorrect: nCorrectAnswers, nWrong: nWrongAnswers, firstCorrectIsQuestion: true, parameters: builderParams);
                break;

            case QuestionBuilderType.OrderedWords:
                builderParams.wordFilters.allowedCategories = new[] { WordDataCategory.Numbers };
                builder = new OrderedWordsQuestionBuilder(parameters: builderParams);
                break;

            case QuestionBuilderType.WordsWithLetter:
                builder = new WordsWithLetterQuestionBuilder(nRounds: nPacks, nPacksPerRound: nPacksPerRound, nCorrect: nCorrectAnswers, nWrong: nWrongAnswers, parameters: builderParams);
                break;

            case QuestionBuilderType.WordsByForm:
                builder = new WordsByFormQuestionBuilder(nPacks: nPacks, parameters: builderParams);
                break;

            case QuestionBuilderType.WordsByArticle:
                builder = new WordsByArticleQuestionBuilder(nPacks: nPacks, parameters: builderParams);
                break;

            case QuestionBuilderType.WordsBySunMoon:
                builder = new WordsBySunMoonQuestionBuilder(nPacks: nPacks, parameters: builderParams);
                break;

            case QuestionBuilderType.WordsInPhrase:
                builder = new WordsInPhraseQuestionBuilder(nPacks: nPacks, nCorrect: nCorrectAnswers, nWrong: nWrongAnswers, useAllCorrectWords: false, usePhraseAnswersIfFound: true, parameters: builderParams);
                break;

            case QuestionBuilderType.PhraseQuestions:
                builder = new PhraseQuestionsQuestionBuilder(nPacks: nPacks, nWrong: nWrongAnswers, parameters: builderParams);
                break;
            }

            var questionPacksGenerator = new QuestionPacksGenerator();

            questionPacksGenerator.GenerateQuestionPacks(builder);
        }