private void Add(PairModel pair) { if (!File.Exists(DbFile)) { ApplyMigrations(); } using (var cnn = SimpleDbConnection()) { cnn.Open(); pair.Id = cnn.Query <long>( @"INSERT INTO Words ( OriginWord, Translation, Transcription, Created, LastExam, PassedScore, AggregateScore, Examed, AllMeanings,Revision ) VALUES( @OriginWord, @Translation, @Transcription, @Created, @LastExam, @PassedScore, @AggregateScore, @Examed, @AllMeanings, @Revision ); select last_insert_rowid()", pair).First(); if (pair.Phrases != null) { foreach (var phrase in pair.Phrases) { phrase.Created = DateTime.Now; cnn.Execute( @"INSERT INTO ContextPhrases ( Origin, Translation, Created, OriginWord, TranslationWord) VALUES( @Origin, @Translation, @Created, @OriginWord, @TranslationWord)", phrase); } } } }
public void RegistrateSuccess(PairModel model) { model.OnExamPassed(); model.UpdateAgingAndRandomization(); _repository.UpdateScores(model); }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { Console.WriteLine("=====> " + word.OriginWord + " <====="); Console.WriteLine("Press any key to see the translation..."); Console.ReadKey(); Console.WriteLine("Translation is \r\n" + word.Translation + "\r\n Did you guess?"); Console.WriteLine("[Y]es [N]o [E]xit"); var answer = Console.ReadKey(); switch (answer.Key) { case ConsoleKey.Y: service.RegistrateSuccess(word); return(ExamResult.Passed); case ConsoleKey.N: service.RegistrateFailure(word); return(ExamResult.Failed); case ConsoleKey.E: return(ExamResult.Exit); case ConsoleKey.Escape: return(ExamResult.Exit); default: return(ExamResult.Retry); } }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { var variants = examList.Randomize().Select(e => e.OriginWord).ToArray(); Console.WriteLine("=====> " + word.Translation + " <====="); for (int i = 1; i <= variants.Length; i++) { Console.WriteLine($"{i}: " + variants[i - 1]); } Console.Write("Choose the translation: "); var selected = Console.ReadLine(); if (selected == null || selected.ToLower().StartsWith("e")) { return(ExamResult.Exit); } if (!int.TryParse(selected, out var selectedIndex) || selectedIndex > variants.Length || selectedIndex < 1) { return(ExamResult.Retry); } if (variants[selectedIndex - 1] == word.OriginWord) { service.RegistrateSuccess(word); return(ExamResult.Passed); } service.RegistrateFailure(word); return(ExamResult.Failed); }
public DataTable GetListofDirector() { MediaLogic mediaLogic = new MediaLogic(); PairModel pairModel = new PairModel(); List <PairModel> pair = mediaLogic.ListDirector(); return(AppUtil.ToDataTable(pair)); //return this in the form of xnl to be sent via the internet or local network }
public PairModel CreateNew(string word, string translation, string[] allMeanings, string transcription, Phrase[] phrases = null) { var pair = PairModel.CreatePair(word, translation, allMeanings, transcription, phrases); pair.Revision = 1; pair.UpdateAgingAndRandomization(); Add(pair); return(pair); }
public void Collision(CollisionModel model) { var pair = PairModel.New <string, string> (model.mainCollider.tag, model.CollidedWith.tag); if (collisionDictionary.ContainsKey(pair)) { collisionDictionary [pair].Invoke(model); } }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { var words = word.OriginWord.Split(',').Select(s => s.Trim()); var minCount = words.Min(t => t.Count(c => c == ' ')); if (minCount > 0 && word.PassedScore < minCount * 4) { return(ExamResult.Impossible); } Console.WriteLine("=====> " + word.Translation + " <====="); Console.Write("Write the translation: "); var userEntry = Console.ReadLine(); if (string.IsNullOrEmpty(userEntry)) { return(ExamResult.Retry); } if (words.Any(t => string.Compare(userEntry, t, StringComparison.OrdinalIgnoreCase) == 0)) { service.RegistrateSuccess(word); return(ExamResult.Passed); } else { //search for other translation var translationCandidate = service.Get(userEntry.ToLower()); if (translationCandidate != null) { if (translationCandidate.GetTranslations().Any(t1 => word.GetTranslations().Any(t2 => string.CompareOrdinal(t1.Trim(), t2.Trim()) == 0))) { //translation is correct, but for other word Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"the translation was correct, but the question was about the word '{word.OriginWord}'\r\nlet's try again"); Console.ResetColor(); Console.ReadLine(); return(ExamResult.Retry); } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"'{userEntry}' translates as {translationCandidate.Translation}"); Console.ResetColor(); service.RegistrateFailure(word); return(ExamResult.Failed); } } Console.WriteLine("The translation was: " + word.OriginWord); service.RegistrateFailure(word); return(ExamResult.Failed); } }
public static IExam GetNextExamFor(bool isFirstExam, PairModel model) { if (isFirstExam && model.PassedScore < 7) { var list = new[] { EngChoose.Exam, RuChoose.Exam, RuPhraseChoose.Exam, EngPhraseChoose.Exam, EngChooseWordInPhrase.Exam, }; return(list.GetRandomItem()); } int score = model.PassedScore - (isFirstExam ? 2 : 0); if (model.PassedScore < 4) { return(ChooseExam(score, new [] { EngChoose, RuChoose, EngTrust, RuTrust, HideousRuTrust, HideousEngTrust, })); } return(ChooseExam(score, new [] { EngChoose, RuChoose, EngPhraseChoose, RuPhraseChoose, EngTrust, RuTrust, EngWrite, RuWrite, HideousRuPhraseChoose, HideousEngPhraseChoose, HideousEngTrust, HideousRuTrust, HideousEngWriteExam, HideousRuWriteExam, ClearEngPhraseSubstitude, ClearRuPhraseSubstitude, EngPhraseSubstitude, RuPhraseSubstitude, EngChooseWordInPhrase, ClearEngChooseWordInPhrase, ClearEngAssemblePhraseExam, })); }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var targetPhrase = word.Phrases.GetRandomItem(); var other = examList.SelectMany(e => e.Phrases) .Where(p => !string.IsNullOrWhiteSpace(p?.Origin) && p != targetPhrase) .Take(8); if (!other.Any()) { return(ExamResult.Impossible); } var variants = other .Append(targetPhrase) .Randomize() .Select(e => e.Translation) .ToArray(); Console.WriteLine("=====> " + targetPhrase.Origin + " <====="); for (int i = 1; i <= variants.Length; i++) { Console.WriteLine($"{i}: " + variants[i - 1]); } Console.Write("Choose the translation: "); var selected = Console.ReadLine(); if (selected.ToLower().StartsWith("e")) { return(ExamResult.Exit); } if (!int.TryParse(selected, out var selectedIndex) || selectedIndex > variants.Length || selectedIndex < 1) { return(ExamResult.Retry); } if (variants[selectedIndex - 1] == targetPhrase.Translation) { service.RegistrateSuccess(word); return(ExamResult.Passed); } service.RegistrateFailure(word); return(ExamResult.Failed); }
private void dgvGenre_CellClick(object sender, DataGridViewCellEventArgs e) { int row = e.RowIndex; if (row > -1) { List <PairModel> pairs = (List <PairModel>)dgvGenre.DataSource; _selectedPair = pairs.ElementAt <PairModel>(row); txtGenreID.Text = _selectedPair.PairID.ToString(); txtGenreName.Text = _selectedPair.PairName; } }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { var words = word.OriginWord.Split(',').Select(s => s.Trim()); var minCount = words.Min(t => t.Count(c => c == ' ')); if (minCount > 0 && word.PassedScore < minCount * 4) { return(ExamResult.Impossible); } await chat.SendMessage($"=====> {word.Translation} <=====\r\nWrite the translation... "); var userEntry = await chat.WaitUserTextInput(); if (string.IsNullOrEmpty(userEntry)) { return(ExamResult.Retry); } if (words.Any(t => string.Compare(userEntry, t, StringComparison.OrdinalIgnoreCase) == 0)) { service.RegistrateSuccess(word); return(ExamResult.Passed); } else { //search for other translation var translationCandidate = service.Get(userEntry.ToLower()); if (translationCandidate != null) { if (translationCandidate.GetTranslations().Any(t1 => word.GetTranslations().Any(t2 => string.CompareOrdinal(t1.Trim(), t2.Trim()) == 0))) { //translation is correct, but for other word await chat.SendMessage($"the translation was correct, but the question was about the word '{word.OriginWord}'\r\nlet's try again"); //Console.ReadLine(); return(ExamResult.Retry); } else { await chat.SendMessage($"'{userEntry}' translates as {translationCandidate.Translation}"); service.RegistrateFailure(word); return(ExamResult.Failed); } } await chat.SendMessage("The translation was: " + word.OriginWord); service.RegistrateFailure(word); return(ExamResult.Failed); } }
private static QuestionMetric CreateQuestionMetric(PairModel pairModel, IExam exam) => new QuestionMetric { AggregateScoreBefore = pairModel.AggregateScore, WordId = pairModel.Id, Created = DateTime.Now, ExamsPassed = pairModel.Examed, PassedScoreBefore = pairModel.PassedScore, PhrasesCount = pairModel.Phrases?.Count ?? 0, PreviousExam = pairModel.LastExam, Type = exam.Name, WordAdded = pairModel.Created };
private void buildDictionray() { collisionDictionary = new Dictionary <PairModel <string, string>, Action <CollisionModel> > { { PairModel.New <string, string>("Enemy", "Player"), collisionLogic.EnemyCollidedWithPlayer }, { PairModel.New <string, string>("Enemy", "Enemy"), doNothing }, { PairModel.New <string, string>("Enemy", "PowerUp"), doNothing }, { PairModel.New <string, string>("Enemy", "Wall"), doNothing }, { PairModel.New <string, string>("Player", "PowerUp"), collisionLogic.playerCollideWithPowerUp }, { PairModel.New <string, string>("Player", "Wall"), collisionLogic.playerCollidedWithWall }, { PairModel.New <string, string>("Player", "Enemy"), collisionLogic.playerCollideWithEnemy }, }; }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { var msg = $"=====> {word.OriginWord} <=====\r\nDo you know the translation?"; var _ = chat.SendMessage(msg, new InlineKeyboardButton() { CallbackData = "1", Text = "See the translation" }); await chat.WaitInlineIntKeyboardInput(); _ = chat.SendMessage("Translation is \r\n" + word.Translation + "\r\n Did you guess?", new InlineKeyboardButton { CallbackData = "1", Text = "Yes" }, new InlineKeyboardButton { CallbackData = "0", Text = "No" }); var choice = await chat.WaitInlineIntKeyboardInput(); if (choice == 1) { service.RegistrateSuccess(word); return(ExamResult.Passed); } else { service.RegistrateFailure(word); return(ExamResult.Failed); } /*var answer = Console.ReadKey(); * switch (answer.Key) * { * case ConsoleKey.Y: * service.RegistrateSuccess(word); * return ExamResult.Passed; * case ConsoleKey.N: * service.RegistrateFailure(word); * return ExamResult.Failed; * case ConsoleKey.E: return ExamResult.Exit; * case ConsoleKey.Escape: return ExamResult.Exit; * default: return ExamResult.Retry; * }*/ }
private void GenreGridView_CellClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; if (rowIndex >= 0) { List <PairModel> genres = (List <PairModel>)genreGridView.DataSource; selectedTitle = genres.ElementAt(rowIndex); selectedView.Text = "Selected Genre: " + selectedTitle.Name; } }
private void LanguageMaintainanceView_CellClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; if (rowIndex >= 0) { List <PairModel> languages = (List <PairModel>)languageMaintainanceView.DataSource; selectedTitle = languages.ElementAt(rowIndex); selectedView.Text = "Selected Language: " + selectedTitle.Name; } }
private void DirectorMaintainanceView_CellClick(object sender, DataGridViewCellEventArgs e) { int rowIndex = e.RowIndex; if (rowIndex >= 0) { List <PairModel> directors = (List <PairModel>)directorMaintainanceView.DataSource; selectedTitle = directors.ElementAt(rowIndex); selectedView.Text = "Selected Director: " + selectedTitle.Name; } }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var targetPhrase = word.Phrases.GetRandomItem(); string shuffled; while (true) { var split = targetPhrase.Origin.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (split.Length < 2) { return(ExamResult.Impossible); } shuffled = string.Join(" ", split.Randomize()); if (shuffled != targetPhrase.Origin) { break; } } await chat.SendMessage("Words in phrase are shuffled. Write them in correct order:\r\n'" + shuffled + "'"); string entry = null; while (string.IsNullOrWhiteSpace(entry)) { entry = await chat.WaitUserTextInput(); entry = entry.Trim(); } if (string.CompareOrdinal(targetPhrase.Origin, entry) == 0) { service.RegistrateSuccess(word); return(ExamResult.Passed); } await chat.SendMessage($"Original phrase was: '{targetPhrase.Origin}'"); service.RegistrateFailure(word); return(ExamResult.Failed); }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var targetPhrase = word.Phrases.GetRandomItem(); string shuffled; while (true) { var split = targetPhrase.Origin.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (split.Length < 2) { return(ExamResult.Impossible); } shuffled = string.Join(" ", split.Randomize()); if (shuffled != targetPhrase.Origin) { break; } } Console.WriteLine("Words in phrase are shuffled. Write them in correct order:\r\n'" + shuffled + "'"); string entry = null; while (string.IsNullOrWhiteSpace(entry)) { Console.WriteLine(":"); entry = Console.ReadLine().Trim(); } if (string.CompareOrdinal(targetPhrase.Origin, entry) == 0) { service.RegistrateSuccess(word); return(ExamResult.Passed); } Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Original phrase was: '{targetPhrase.Origin}'"); Console.ResetColor(); service.RegistrateFailure(word); return(ExamResult.Failed); }
private void InsertOneTutorPair(PairModel pair, int rowIndex, int columnIndex, ref int countOfSplit, ref bool splitInCurrentTime) { if (pair.Weekend == Constants.Weekends[0]) { Table.Cell(rowIndex + countOfSplit, columnIndex + 3).Range.Text = pair.ToString(); } else { if (!splitInCurrentTime) { Table.Cell(rowIndex + countOfSplit, columnIndex + 3).Split(Constants.CreatorConstants.SplitNums); } else { Table.Cell(rowIndex + countOfSplit - 1, columnIndex + 3).Split(Constants.CreatorConstants.SplitNums); } if (pair.Weekend == Constants.Weekends[1]) { if (!splitInCurrentTime) { Table.Cell(rowIndex + countOfSplit, columnIndex + 3).Range.Text = pair.ToString(); } else { Table.Cell(rowIndex + countOfSplit - 1, columnIndex + 3).Range.Text = pair.ToString(); } } else { if (splitInCurrentTime) { Table.Cell(rowIndex + countOfSplit, columnIndex + 3).Range.Text = pair.ToString(); } else { Table.Cell(rowIndex + countOfSplit + 1, columnIndex + 3).Range.Text = pair.ToString(); } } if (!splitInCurrentTime) { countOfSplit += 1; splitInCurrentTime = true; } } }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var phrase = word.Phrases.GetRandomItem(); var replaced = phrase.Origin.Replace(phrase.OriginWord, "..."); if (replaced == phrase.Origin) { return(ExamResult.Impossible); } var sb = new StringBuilder(); sb.AppendLine($"\"{phrase.Translation}\""); sb.AppendLine(); sb.AppendLine($" translated as "); sb.AppendLine(); sb.AppendLine($"\"{replaced}\""); sb.AppendLine($"Choose missing word..."); var variants = examList.Randomize().Select(e => e.OriginWord).ToArray(); var _ = chat.SendMessage(sb.ToString(), InlineButtons.CreateVariants(variants)); var choice = await chat.TryWaitInlineIntKeyboardInput(); if (choice == null) { return(ExamResult.Retry); } if (variants[choice.Value] == word.OriginWord) { service.RegistrateSuccess(word); return(ExamResult.Passed); } await chat.SendMessage($"Origin was: \"{phrase.Origin}\""); service.RegistrateFailure(word); return(ExamResult.Failed); }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var phrase = word.Phrases.GetRandomItem(); var replaced = phrase.Translation.Replace(phrase.TranslationWord, "..."); if (replaced == phrase.Translation) { return(ExamResult.Impossible); } var sb = new StringBuilder(); sb.AppendLine($"\"{phrase.Origin}\""); sb.AppendLine($" translated as "); sb.AppendLine($"\"{replaced}\""); sb.AppendLine(); sb.AppendLine($"Enter missing word: "); while (true) { var enter = await chat.WaitUserTextInput(); if (string.IsNullOrWhiteSpace(enter)) { continue; } if (string.CompareOrdinal(phrase.TranslationWord.ToLower().Trim(), enter.ToLower().Trim()) == 0) { service.RegistrateSuccess(word); return(ExamResult.Passed); } await chat.SendMessage($"Origin phrase was \"{phrase.Translation}\""); service.RegistrateFailure(word); return(ExamResult.Failed); } }
public void UpdateScores(PairModel word) { if (!File.Exists(DbFile)) { return; } using (var cnn = SimpleDbConnection()) { cnn.Open(); var op = $"Update words set AggregateScore = @AggregateScore," + $"PassedScore = @PassedScore, " + $"Created = @Created," + $"LastExam = @LastExam," + $"Examed = @Examed where Id = @Id"; cnn.Execute(op, word); } }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { var translations = word.GetTranslations(); var minCount = translations.Min(t => t.Count(c => c == ' ')); if (minCount > 0 && word.PassedScore < minCount * 4) { return(ExamResult.Impossible); } Console.WriteLine("=====> " + word.OriginWord + " <====="); Console.Write("Write the translation: "); var translation = Console.ReadLine(); if (string.IsNullOrEmpty(translation)) { return(ExamResult.Retry); } if (translations.Any(t => string.Compare(translation, t, StringComparison.OrdinalIgnoreCase) == 0)) { service.RegistrateSuccess(word); return(ExamResult.Passed); } else { if (word.GetAllMeanings() .Any(t => string.Compare(translation, t, StringComparison.OrdinalIgnoreCase) == 0)) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Choosen translation is out of scope (but it is correct). Expected translations are: " + word.Translation); Console.ResetColor(); Console.WriteLine(); return(ExamResult.Impossible); } Console.WriteLine("The translation was: " + word.Translation); service.RegistrateFailure(word); return(ExamResult.Failed); } }
public ExamResult Pass(NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var phrase = word.Phrases.GetRandomItem(); var replaced = phrase.Translation.Replace(phrase.TranslationWord, "..."); if (replaced == phrase.Translation) { return(ExamResult.Impossible); } Console.WriteLine($"\"{phrase.Origin}\""); Console.WriteLine($" translated as "); Console.WriteLine($"\"{replaced}\""); Console.WriteLine(); Console.Write($"Enter missing word: "); while (true) { var enter = Console.ReadLine(); if (string.IsNullOrWhiteSpace(enter)) { continue; } if (string.CompareOrdinal(phrase.TranslationWord.ToLower().Trim(), enter.ToLower().Trim()) == 0) { service.RegistrateSuccess(word); return(ExamResult.Passed); } Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Origin phrase was \"{phrase.Translation}\""); Console.ResetColor(); service.RegistrateFailure(word); return(ExamResult.Failed); } }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { var translations = word.GetTranslations(); var minCount = translations.Min(t => t.Count(c => c == ' ')); if (minCount > 0 && word.PassedScore < minCount * 4) { return(ExamResult.Impossible); } await chat.SendMessage($"=====> {word.OriginWord} <=====\r\nWrite the translation... "); var translation = await chat.WaitUserTextInput(); if (string.IsNullOrEmpty(translation)) { return(ExamResult.Retry); } if (translations.Any(t => string.Compare(translation, t, StringComparison.OrdinalIgnoreCase) == 0)) { service.RegistrateSuccess(word); return(ExamResult.Passed); } else { if (word.GetAllMeanings() .Any(t => string.Compare(translation, t, StringComparison.OrdinalIgnoreCase) == 0)) { await chat.SendMessage($"Choosen translation is out of scope (but it is correct). Expected translations are: " + word.Translation); return(ExamResult.Impossible); } await chat.SendMessage("The translation was: " + word.Translation); service.RegistrateFailure(word); return(ExamResult.Failed); } }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { var variants = examList.Randomize().Select(e => e.Translation).ToArray(); var msg = $"=====> {word.OriginWord} <=====\r\nChoose the translation"; await chat.SendMessage(msg, InlineButtons.CreateVariants(variants)); var choice = await chat.TryWaitInlineIntKeyboardInput(); if (choice == null) { return(ExamResult.Retry); } if (variants[choice.Value] == word.Translation) { service.RegistrateSuccess(word); return(ExamResult.Passed); } service.RegistrateFailure(word); return(ExamResult.Failed); }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { var msg = $"=====> {word.Translation} <=====\r\nDo you know the translation?"; var _ = chat.SendMessage(msg, new InlineKeyboardButton() { CallbackData = "1", Text = "See the translation" }); await chat.WaitInlineIntKeyboardInput(); _ = chat.SendMessage("Translation is \r\n" + word.OriginWord + "\r\n Did you guess?", new InlineKeyboardButton { CallbackData = "1", Text = "Yes" }, new InlineKeyboardButton { CallbackData = "0", Text = "No" }); var choice = await chat.WaitInlineIntKeyboardInput(); if (choice == 1) { service.RegistrateSuccess(word); return(ExamResult.Passed); } else { service.RegistrateFailure(word); return(ExamResult.Failed); } }
public async Task <ExamResult> Pass(Chat chat, NewWordsService service, PairModel word, PairModel[] examList) { if (!word.Phrases.Any()) { return(ExamResult.Impossible); } var targetPhrase = word.Phrases.GetRandomItem(); var other = examList.SelectMany(e => e.Phrases) .Where(p => !string.IsNullOrWhiteSpace(p?.Origin) && p != targetPhrase) .Take(8); if (!other.Any()) { return(ExamResult.Impossible); } var variants = other .Append(targetPhrase) .Randomize() .Select(e => e.Translation) .ToArray(); var msg = $"=====> {targetPhrase.Origin} <=====\r\nChoose the translation"; await chat.SendMessage(msg, InlineButtons.CreateVariants(variants)); var choice = await chat.TryWaitInlineIntKeyboardInput(); if (choice == null) { return(ExamResult.Retry); } if (variants[choice.Value] == targetPhrase.Translation) { service.RegistrateSuccess(word); return(ExamResult.Passed); } service.RegistrateFailure(word); return(ExamResult.Failed); /* * Console.WriteLine("=====> " + targetPhrase.Origin + " <====="); * * for (int i = 1; i <= variants.Length; i++) * { * Console.WriteLine($"{i}: " + variants[i - 1]); * } * * Console.Write("Choose the translation: "); * * var selected = Console.ReadLine(); * if (selected.ToLower().StartsWith("e")) * return ExamResult.Exit; * * if (!int.TryParse(selected, out var selectedIndex) || selectedIndex > variants.Length || * selectedIndex < 1) * return ExamResult.Retry; * * if (variants[selectedIndex - 1] == targetPhrase.Translation) * { * service.RegistrateSuccess(word); * return ExamResult.Passed; * } * service.RegistrateFailure(word); * return ExamResult.Failed;*/ }