Beispiel #1
0
 void Load()
 {
     SurveyName  = SurveyResponse.SurveyDefinition.Name;
     SurveyIntro = SurveyResponse.SurveyDefinition.Intro;
     Response    = SurveyResponse.NextUnansweredQuestion();
     DoBindings();
 }
Beispiel #2
0
        public async Task OnSaveClick()
        {
            ValidationMessage = "";
            (bool, SurveyResponseDTO)attempt = (false, null);
            switch (Response.Question.QuestionType)
            {
            case QuestionTypeEnum.Text:
                attempt = await SaveTextResponse();

                break;

            case QuestionTypeEnum.Rating:
                attempt = await SaveRatingResponse();

                break;

            case QuestionTypeEnum.SingleChoice:
                attempt = await SaveSingleChoiceResponse();

                break;

            case QuestionTypeEnum.MultiChoice:
                attempt = await SaveMultiChoiceResponse();

                break;
            }
            if (attempt.Item1)
            {
                SurveyResponse = attempt.Item2;
                if (SurveyResponse.Status == SurveyResponseStatusEnum.Completed)
                {
                    UriHelper.NavigateTo($"/surveyresponseoverview/{SurveyResponse.SurveyResponseId}");
                }
                else
                {
                    Response = SurveyResponse.NextUnansweredQuestion();
                    DoBindings();
                }
            }
        }