Exemple #1
0
 public Question(int index, string sentence, int[] scores)
 {
     Index    = index;
     Sentence = sentence;
     Scores   = scores;
     Answer   = AnswerValType.None;
 }
Exemple #2
0
        public int?GetScore(AnswerValType answer)
        {
            int?newScore = null;

            switch (answer)
            {
            case AnswerValType.None:
                newScore = 0;
                break;

            case AnswerValType.Val1:
                if (Scores.Length > 0)
                {
                    newScore = Scores[0];
                }
                break;

            case AnswerValType.Val2:
                if (Scores.Length > 1)
                {
                    newScore = Scores[1];
                }
                break;

            case AnswerValType.Val3:
                if (Scores.Length > 2)
                {
                    newScore = Scores[2];
                }
                break;

            case AnswerValType.Val4:
                if (Scores.Length > 3)
                {
                    newScore = Scores[3];
                }
                break;

            case AnswerValType.Val5:
                if (Scores.Length > 4)
                {
                    newScore = Scores[4];
                }
                break;

            case AnswerValType.Val6:
                if (Scores.Length > 5)
                {
                    newScore = Scores[5];
                }
                break;

            case AnswerValType.Val7:
                if (Scores.Length > 6)
                {
                    newScore = Scores[6];
                }
                break;

            case AnswerValType.Val8:
                if (Scores.Length > 7)
                {
                    newScore = Scores[7];
                }
                break;
            }
            return(newScore);
        }