Beispiel #1
0
        public IEnumerable <string> GetDescription(int idx)
        {
            IEnumerable <WordElement> trans = DictService.GetMeansByWord(choices[idx].Item1);

            if (trans == null)
            {
                trans = DictService.GetWordsByMean(choices[idx].Item1);
            }
            return(trans.Select(x => x.GetStr()));
        }
Beispiel #2
0
        private static bool AdaptQuiz(Quiz q, out WordElement[] waitList)
        {
            int r = lastRand;

            while (r == lastRand)
            {
                r = rand.Next(DictService.WrongCount);
            }
            var stat = DictService.EleAt(lastRand = r);

            q.quest = stat.str;

            bool isWord = true;

            waitList = DictService.GetMeansByWord(stat);
            if (waitList == null)
            {
                isWord   = false;
                waitList = DictService.GetWordsByMean(stat);
            }
            return(isWord);
        }