Ejemplo n.º 1
0
        private void setAvailableResponsesForQuestion(long surveyId, Question question)
        {
            if (surveyId == 3 && question.QuestionId == 1)
            {
                AvailableResponse r1 = new AvailableResponse()
                {
                    Id = 1,
                    LikertScaleNumber = 1,
                    Text = "Strongly Disagree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 2,
                    LikertScaleNumber = 2,
                    Text = "Disagree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 3,
                    LikertScaleNumber = 3,
                    Text = "Neither Agree nor Disagree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 4,
                    LikertScaleNumber = 4,
                    Text = "Agree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 5,
                    LikertScaleNumber = 5,
                    Text = "Strongly Agree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);
            }

            if (surveyId == 3 && question.QuestionId == 2)
            {
                AvailableResponse r1 = new AvailableResponse()
                {
                    Id = 6,
                    LikertScaleNumber = 1,
                    Text = "Strongly Disagree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 7,
                    LikertScaleNumber = 2,
                    Text = "Disagree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 8,
                    LikertScaleNumber = 3,
                    Text = "Neither Agree nor Disagree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 9,
                    LikertScaleNumber = 4,
                    Text = "Agree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);

                r1 = new AvailableResponse()
                {
                    Id = 10,
                    LikertScaleNumber = 5,
                    Text = "Strongly Agree",
                    Question = question
                };
                _availableResponses.Add(r1);
                question.AvailableResponses.Add(r1);
            }
        }
 public long AddQuestion(Question question)
 {
     _unitOfWork.Questions.Add(question);
     _unitOfWork.SaveChanges();
     return question.QuestionId;     //  Return the Id of the question.
 }