Exemplo n.º 1
0
        /// <summary>
        /// Shows the questions.
        /// </summary>
        private void ShowQuestions()
        {
            pnlInstructions.Visible = false;
            pnlQuestion.Visible     = true;
            pnlResult.Visible       = false;
            _assessmentResponses    = MotivatorService.GetQuestions()
                                      .Select(a => new AssessmentResponse()
            {
                Code       = a.Id,
                Question   = a.Question,
                OptionType = a.OptionType
            }).ToList();

            // If _maxQuestions has not been set yet...
            if (QuestionCount == 0 && _assessmentResponses != null)
            {
                // Set the max number of questions to be no greater than the actual number of questions.
                int numQuestions = this.GetAttributeValue(AttributeKey.NumberOfQuestions).AsInteger();
                QuestionCount = (numQuestions > _assessmentResponses.Count) ? _assessmentResponses.Count : numQuestions;
            }

            BindRepeater(0);
        }