Exemple #1
0
        public static Question Load(Stream stream)
        {
            Question question = null;

            int type = (int)QuestionData.ReadValue(stream);

            if (type == Question_a_b_c.type)
            {
                question = new Question_a_b_c();
            }

            question.LoadQuestion(stream);

            return(question);
        }
Exemple #2
0
        private string CreateQuestionBlock(Question question, bool showAnswer, bool showResult)
        {
            if (question is Question_a_b_c)
            {
                Question_a_b_c abcQuestion  = question as Question_a_b_c;
                string         questionText = question.ToString();
                if (showResult && abcQuestion.Result != null)
                {
                    questionText += abcQuestion.Result.Value;
                }
                if (showAnswer)
                {
                    questionText += string.Format("\t{0}", abcQuestion.C);
                }

                return(questionText);
            }

            return(string.Empty);
        }