Exemplo n.º 1
0
        /// <summary>
        /// Puts the answers to survey instance.
        /// </summary>
        /// <returns>The answers to survey instance.</returns>
        /// <param name="currentViews">Current views.</param>
        /// <param name="surveyScheme">Survey scheme.</param>
        private static SurveyAnswer PutAnswersToSurveyInstance(ICollection <QuestionView> currentViews, Survey surveyScheme)
        {
            UserData user = new UserData();

            user.Username = "******";
            user.ID       = "test_ID";

            SurveyAnswer sa = new SurveyAnswer(surveyScheme, user);

            sa.Answers = new List <Answer> ();

            foreach (QuestionView qv in currentViews)
            {
                Answer a = new Answer();
                a.QuestionRef = new QuestionReference();
                Question temporaryQuestion = qv.question.Question;

                a.QuestionRef.Question = new Question {
                    QuestionId = temporaryQuestion.QuestionId
                };

                foreach (AnswerOption ao in qv.answers)
                {
                    a.AnsweredOption = new AnswerOption {
                        Content = ao.Content
                    };
                }
                sa.Answers.Add(a);
            }
            return(sa);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Surveys.ViewGenerator"/> class.
 /// </summary>
 /// <param name="s">S.</param>
 public ViewGenerator(Survey s)
 {
     SurveyScheme = s;
 }
Exemplo n.º 3
0
 public SurveyAnswer(Survey surv, UserData data)
 {
     Survey   = surv;
     UserData = data;
     this.Survey.SurveyAnswers.AddLast(this);
 }
Exemplo n.º 4
0
        public DummyContentProvider()

        {
            s = new Survey();
        }