예제 #1
0
        void DisplayButtonLabels(NoteDegreeCorrelation nextExercise)
        {
            List<NoteDegreeCorrelation> allCorrelationsForKey = NoteDegreeCorrelationFactory.GetCorrelationsForKey(nextExercise.Key);

            //Randomize, because otherwise it's too easy, as the degree is ordered.
            allCorrelationsForKey = allCorrelationsForKey.RandomizeOrder();

            for (int i = 0; i < 7; i++)
            {
                if (displayNoteButtons)
                {
                    allButtons[i].Text = allCorrelationsForKey[i].Note;
                }
                else
                {
                    allButtons[i].Text = (i + 1).ToString();
                }
            }
        }
예제 #2
0
        public NoteDegreeCorrelation GetNextExercise()
        {
            //            Log.Debug("harm-numb", "Currently in queue:");
            //            foreach (var kv in unsuccessfullOrSlowAttempts)
            //            {
            //                Log.Debug("harm-numb",kv.Key + "  " + kv.Value.Key+":"+kv.Value.Note);
            //            }

            if (counter % RepeatAfterXExercise == 0 && unsuccessfullOrSlowAttempts.Count > 0)
            {
                //Repeat wrong answers
                int mostUrgentToRepeat = unsuccessfullOrSlowAttempts.Keys.Max();
                currentExercise = unsuccessfullOrSlowAttempts[mostUrgentToRepeat];

                unsuccessfullOrSlowAttempts.Remove(mostUrgentToRepeat);
            }
            else
            {
                //Random exercise
                currentExercise = allCorrelations[rnd.Next(0, allCorrelations.Count)];
            }

            counter++;
            currentExerciseStartedAt = DateTime.Now;

            return currentExercise;
        }
예제 #3
0
        private void DisplayExercise(NoteDegreeCorrelation nextExercise)
        {
            DisplayButtonLabels(nextExercise);

            imgKey.SetImageDrawable(Resources.GetDrawable(keyImagePathResolver.GetKeyDrawableByKey(nextExercise.Key)));
            txtKey.Text = String.Format("{0}",nextExercise.Key);

            if (displayNoteButtons)
            {
                txtHarmNumber.Text = nextExercise.Degree.ToString();
            }
            else
            {
                txtHarmNumber.Text = nextExercise.Note;
            }

            exerciseTimer.Start();
        }