文字列にリストのすべての入力が含まれているかどうかを確認して試し てみましたが、「オーストラリアを発見したのは誰ですか」などの基本的な質問があり、答えに「キャプテン、クック」のようにキーワードを入れた場合それは私が質問を間違えたと言うでしょう。
私が間違っていることを考えてください。使用しているコード:
GivenAnswer = textBox1.Text;
String invariantText = textBox1.Text.ToUpperInvariant();
bool matches = KeyWords.All(kw => invariantText.Contains(kw.ToUpperInvariant()));
if (matches)
{
correct++;
if (InstantResult) { MessageBox.Show("Questions Answered Correctly", "Answer Results", MessageBoxButtons.OK, MessageBoxIcon.Information); }
}
else
{
incorrect++;
if (InstantResult) { MessageBox.Show("Question Answered Wrong, sorry!", "Answer Result", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
}
Study_Helper.Form1.QuestionResults.Add(Question + "|" + (matches ? "true" : "false") + "|" + (Exact? "N/A" : KeyWords_Found()) + "|" + (Hint_Used ? "true" : "false") + "|" + GivenAnswer.ToLowerInvariant());
LoadUp();
textBox1.Clear();
textBox1.Focus();