internal static ClientModels.QuestionAnswer ToQuestionAnswer(this Models.QuestionAnswer questionAnswer) { if (questionAnswer == null) { throw new ArgumentNullException(nameof(questionAnswer)); } return(new ClientModels.QuestionAnswer() { Answer = questionAnswer.Answer, PossibleAnswers = questionAnswer.PossibleAnswers, QuestionText = questionAnswer.QuestionText, QuestionType = questionAnswer.QuestionType.ToQuestionType() }); }
internal void RevealAnswer() { SuspendLayout(); string answervalue = ""; int index = 0; for (int i = 0; i < question.Choices.Count; i++) { if (question.Choices[i].Answer) { answervalue = question.Choices[i].Value; index = i; break; } } if (question.Choices.Count == 4) { if (index == 0) { answervalue = "A. " + answervalue; } else if (index == 1) { answervalue = "B. " + answervalue; } else if (index == 2) { answervalue = "C. " + answervalue; } else if (index == 3) { answervalue = "D. " + answervalue; } } answer = new Models.QuestionAnswer(answervalue, question.BibleReference); tlpQuestion.Controls.Remove(choices); tlpQuestion.Controls.Add(answer, 0, 2); tlpQuestion.SetColumnSpan(answer, 3); ResumeLayout(false); PerformLayout(); }
public static SurveyAnalysisService.Client.Models.QuestionAnswer ToAnalysisServiceQuestionAnswer(this Models.QuestionAnswer questionAnswer) { if (questionAnswer == null) { throw new ArgumentNullException(nameof(questionAnswer)); } return(new SurveyAnalysisService.Client.Models.QuestionAnswer() { Answer = questionAnswer.Answer, PossibleAnswers = questionAnswer.PossibleAnswers, QuestionText = questionAnswer.QuestionText, QuestionType = (SurveyAnalysisService.Client.Models.QuestionType)Enum.Parse(typeof(SurveyAnalysisService.Client.Models.QuestionType), questionAnswer.QuestionType) }); }