@(i + 1). @question.Text
@switch (question.Type)
{
case QuestionType.Text:
@foreach (var answer in question.Answers)
{
}
break;
case QuestionType.CheckBox:
case QuestionType.Multiple_choice:
case QuestionType.Demographic:
break;
case QuestionType.TrueFalse:
break;
case QuestionType.Open_ended:
@foreach (var answer in question.Answers)
{
}
break;
case QuestionType.Slider:
@foreach(var answer in question.Answers)
{
}
break;
case QuestionType.Rating:
@foreach (var answer in question.Answers)
{
}
break;
case QuestionType.Ranking:
@foreach (var answer in question.Answers)
{
-
@answer.Text
}
break;
case QuestionType.Likert:
@if (Model.Questions.Any(q => q.Type == QuestionType.Likert))
{
@foreach (var questions in Model.Questions.Where(q => q.Type == QuestionType.Likert))
{
}
}
break;
case QuestionType.Matrix:
@if (Model.Questions.Any(q => q.Type == QuestionType.Matrix)) // Check for Matrix type questions
{
@foreach (var matrixQuestion in Model.Questions.Where(q => q.Type == QuestionType.Matrix)) // Iterate through Matrix questions
{
}
}
break;
case QuestionType.Image:
@if (Model.Questions.Any(q => q.Type == QuestionType.Image))
{
@foreach (var imageQuestion in Model.Questions.Where(q => q.Type == QuestionType.Image))
{
@foreach (var answer in imageQuestion.Answers)
{
}
}
}
break;
default:
Unsupported question type.
break;
}
@if (i > 0)
{
}
@if (i < Model.Questions.Count - 1)
{
}