/// <summary>
        /// Loads the question views.
        /// </summary>
        private void LoadQuestionViews()
        {
            GlobalModel.CleanGlobalModel();

            QuestionsModel _nextQuestion = QuestionJsonDeserializer.GetFirstQuestion(0);

            //Set Main Category to cart
            FeedbackCart._mainCatId = Convert.ToInt32(_nextQuestion.MainCategory);
            Debug.WriteLine("Main Cat :" + FeedbackCart._mainCatId);
            //

            if (_nextQuestion.QType == "")
            {
                if (_nextQuestion.UIControl == "sli")
                {
                    if (_nextQuestion.RatingScale != null)
                    {
                        var ratingScale = _nextQuestion.RatingScale.Count;
                        _navigation.PushAsync(new HeatBarView(_currQuesNo, _nextQuestion.QNo, ratingScale));
                    }
                }
                else
                {
                    _navigation.PushAsync(new EmojiRatingView(_currQuesNo, _nextQuestion.QNo));
                }
            }
            else if (_nextQuestion.QType == "Y")
            {
                _navigation.PushAsync(new DualOptionView(_currQuesNo, _nextQuestion.QNo));
            }
            else if (_nextQuestion.QType == "O")
            {
                if (_nextQuestion.UIControl == "cbl")
                {
                    _navigation.PushAsync(new MultiSelectionView(_currQuesNo, _nextQuestion.QNo));
                }
                else
                {
                    _navigation.PushAsync(new MultiOptionView(_currQuesNo, _nextQuestion.QNo));
                }
            }
            else if (_nextQuestion.QType == "C")
            {
                _navigation.PushAsync(new TextCommentView(_currQuesNo, _nextQuestion.QNo));
            }

            _taplocked = false; // unlock name label tap lock
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the next page.
        /// </summary>
        /// <param name="_navigation">Navigation stack reference</param>
        /// <param name="_currQuestionindex">Current questionindex.</param>
        /// <param name="_selectedValue">Selected value.</param>
        public static void LoadNextPage(INavigation _navigation, string _currQuestionindex, string _selectedValue)
        {
            GlobalModel.CleanGlobalModel();

            try
            {
                //QuestionsModel currQuestion = QuestionJsonDeserializer.GetQuestion(_currQuestionindex);

                /////<summary>
                ///// If curent question object dependantQNo is empty loads the next page sequently
                ///// else if (If there is dependant Quesion) curent question object DependantQValue contains current dependant value, loads the dependant question
                ///// else skip dependant quesion
                ///// </summary>
                //if (currQuestion.DependantQNo == null)
                //{
                //    _nextQuestion = QuestionJsonDeserializer.GetNextQuestion(_currQuestionindex);
                //}
                //else if (currQuestion.DependantQValue.Contains(_selectedValue))
                //{
                //    _nextQuestion = QuestionJsonDeserializer.GetQuestion(currQuestion.DependantQNo);
                //}
                //else
                //{
                //    _nextQuestion = QuestionJsonDeserializer.SkipDependantQuestion(_currQuestionindex);
                //}

                //=====
                _nextQuestion = HandleDependancyQuestions(_currQuestionindex);

                //=======


                LoadPage(_navigation, _currQuestionindex);
            }
            catch (Exception)
            {
                _navigation.PushAsync(new NewsLetterView());
            }
        }