Пример #1
0
 public void AddAnswerValue(AnswerValue answerValue)
 {
     foreach (string key in answerValue.GetKeys())
     {
         AddValueToDictionary(key, answerValue.GetValue(key));
     }
 }
        static public List <Question> GetBaseQuestionSet()
        {
            List <Question> baseQuestions = new List <Question>();
            List <Answer>   answers       = new List <Answer>();
            AnswerValue     answerValue   = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 4).with("mid", 10);
            Answer          answer        = new Answer("Super dobrze", answerValue);

            answers.Add(answer);

            answerValue = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 10).with("mid", 2).with("senior", 5);
            answer      = new Answer("Myślę, że dobrze", answerValue);
            answers.Add(answer);

            answerValue = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 2).with("senior", 10);
            answer      = new Answer("Nie umiem pisać", answerValue);
            answers.Add(answer);

            answerValue = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 2).with("mid", 5).with("senior", 2);
            answer      = new Answer("Ok", answerValue);
            answers.Add(answer);

            Question question = new Question("Jak Ci idzie programowańsko?", answers);

            baseQuestions.Add(question);

            answers = new List <Answer>();

            answerValue = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 10).with("mid", 2).with("senior", 5);
            answer      = new Answer("NIE!", answerValue);
            answers.Add(answer);

            answerValue = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 2).with("senior", 10);
            answer      = new Answer("Co? To ja jestem w pracy?", answerValue);
            answers.Add(answer);

            answerValue = AnswerValue.AnswerValueCreator.CreateAnswerValue().with("junior", 2).with("mid", 5).with("senior", 2);
            answer      = new Answer("Tak", answerValue);
            answers.Add(answer);

            question = new Question("Chcesz przerwę?", answers);
            baseQuestions.Add(question);

            return(baseQuestions);
        }
Пример #3
0
 public Answer(string answerContent, AnswerValue answerValue)
 {
     AnswerValue   = answerValue ?? throw new ArgumentNullException(nameof(answerValue));
     AnswerContent = answerContent ?? throw new ArgumentNullException(nameof(answerContent));
 }