Beispiel #1
0
        private string CheckAns()
        {
            int userAns = Judge.RIGHT;

            if (right.Checked == true)
            {
                userAns = Judge.RIGHT;
            }
            else if (wrong.Checked == true)
            {
                userAns = Judge.WRONG;
            }

            if (judge.isDone == 0)
            {
                QuestionHistory.SaveProblemIsDone(judge.id, QuestionHistory.TYPE_CHOICE);
            }

            if (userAns == judge.ans)
            {
                QuestionHistory.UpdateHistory(judge, QuestionHistory.RESULT_RIGHT);
                MyApp.judgeCount++;
                return("");
            }
            else
            {
                QuestionHistory.UpdateHistory(judge, QuestionHistory.RESULT_WRONG);
                MyApp.judgeCount++;
                MyApp.judgeWrongCount++;
                return("你的选择是" + TranslateAns(userAns) + "\n\n" + "正确答案为" + TranslateAns(judge.ans));
            }
        }
Beispiel #2
0
        private string CheckAns()
        {
            string userAns = "";

            if (aska.Checked == true)
            {
                userAns = "A";
            }
            else if (askb.Checked == true)
            {
                userAns = "B";
            }
            else if (askc.Checked == true)
            {
                userAns = "C";
            }
            else if (askd.Checked == true)
            {
                userAns = "D";
            }

            if (choice.isDone == 0)
            {
                QuestionHistory.SaveProblemIsDone(choice.id, QuestionHistory.TYPE_CHOICE);
            }

            if (userAns.Equals(choice.ans))
            {
                QuestionHistory.UpdateHistory(list[index], QuestionHistory.RESULT_RIGHT);
                MyApp.choiceCount++;
                return("");
            }
            else
            {
                QuestionHistory.UpdateHistory(list[index], QuestionHistory.RESULT_WRONG);
                MyApp.choiceCount++;
                MyApp.choiceWrongCount++;
                return("你的选择是" + userAns + "\n\n" + "正确答案为" + choice.ans);
            }
        }