Ejemplo n.º 1
0
        private void Chk_randomOrderQuestions_CheckedChanged(object sender, EventArgs e)
        {
            Quiz.ProgressData.AskQuestionsInRandomOrder = chk_randomOrderQuestions.Checked;

            CardPicker.NewRound(Quiz);
            Program.frmQuizPractise.SetCard();
            QuizCore.SaveQuizProgress(Quiz);
        }
Ejemplo n.º 2
0
 private void InQuiz_FormClosing(object sender, FormClosingEventArgs e)
 {
     QuizCore.SaveQuizProgress(Quiz);
     if (exitAppOnClose)
     {
         Application.Exit();
     }
 }
Ejemplo n.º 3
0
        private void Chk_intelligentLearning_CheckedChanged(object sender, EventArgs e)
        {
            Quiz.ProgressData.FullTestInProgress = !chk_intelligentLearning.Checked;

            CardPicker.NewRound(Quiz);
            Program.frmQuizPractise.SetCard();
            Program.frmQuizPractise.UpdateCardSideTypeLabels();
            QuizCore.SaveQuizProgress(Quiz);
        }
Ejemplo n.º 4
0
        private void Rdo_answerFront_CheckedChanged(object sender, EventArgs e)
        {
            Quiz.ProgressData.AnswerCardSide = rdo_answerFront.Checked ? QuizProgressData.CardSide.Front : QuizProgressData.CardSide.Back;

            CardPicker.NewRound(Quiz);
            Program.frmQuizPractise.SetCard();
            Program.frmQuizPractise.UpdateCardSideTypeLabels();
            QuizCore.SaveQuizProgress(Quiz);
        }
Ejemplo n.º 5
0
        private void nud_minAnsTriesSkip_ValueChanged(object sender, EventArgs e)
        {
            Quiz.ProgressData.MinimumTriesCountToConsiderSkippingQuestion = (int)nud_minAnsTriesSkip.Value;

            if (!Quiz.ProgressData.FullTestInProgress)
            {
                CardPicker.NewRound(Quiz);
                Program.frmQuizPractise.SetCard();
                QuizCore.SaveQuizProgress(Quiz);
            }
        }
Ejemplo n.º 6
0
        private void Rdo_lastNattemptsIntelligentLearning_CheckedChanged(object sender, EventArgs e)
        {
            if (rdo_lastNattemptsIntelligentLearning.Checked)
            {
                Quiz.ProgressData.IntelligentLearningLastAnswersBasisCount = (int)nud_intelligentLearningAttempsCount.Value;

                if (!Quiz.ProgressData.FullTestInProgress)
                {
                    CardPicker.NewRound(Quiz);
                    Program.frmQuizPractise.SetCard();
                    QuizCore.SaveQuizProgress(Quiz);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Marks all Cards as not answered this round, lowers the RoundToSkip variables and updated CurrentCards with a new selection.
        /// </summary>
        /// <param name="quiz"></param>
        public static void NewRound(Quiz quiz)
        {
            quiz.ProgressData.CorrectAnswersThisRound = 0;
            if (!quiz.ProgressData.FullTestInProgress)
            {
                var possibleCards = (from x in quiz.Cards
                                     let progress = x.GetProgressData(quiz)
                                                    where progress.RoundsToSkip == 0
                                                    orderby progress.GetLearningProgress(quiz.ProgressData) ascending
                                                    select x.Guid).ToList();

                if (possibleCards.Count > 0)
                {
                    quiz.ProgressData.CurrentCards = possibleCards.Take(10).ToList();
                }
                else
                {
                    var indexes = Enumerable.Range(0, 5).ToList();
                    Shuffle(indexes);
                    quiz.ProgressData.CurrentCards = indexes
                                                     .Where(i => i <= quiz.Cards.Count() - 1)
                                                     .Select(i => quiz.Cards[i].Guid).ToList();
                }
            }
            else
            {
                quiz.ProgressData.CurrentCards = quiz.Cards.Select(x => x.Guid).ToList();
                Shuffle(quiz.ProgressData.CurrentCards);
            }

            quiz.ProgressData.CurrentCard = Guid.Empty;

            // Update RoundsToSkip
            foreach (var cardProgress in quiz.ProgressData.CardProgress)
            {
                cardProgress.AskedThisRound = false;

                if (cardProgress.RoundsToSkip > 0)
                {
                    --cardProgress.RoundsToSkip;
                }
            }

            QuizCore.SaveQuizProgress(quiz);
        }