@model ResponseQuestionnaireViewModel @{ ViewData["Title"] = "DisplayQuestionnaire"; Layout = "~/Views/Shared/_QuestionnaireResponse.cshtml"; }

@Model.Title

@Html.Raw(Model.Description)

@for (int i = 0; i < Model.Questions.Count; i++) { var question = Model.Questions[i]; string stepClass = i == 0 ? "active" : ""; // Adjusted the index to start from the first question
@((i + 1)). @question.Type
}
@for (int i = 0; i < Model.Questions.Count; i++) { var question = Model.Questions[i]; @for (int j = 0; j < question.Answers.Count; j++) { var answer = question.Answers[j]; }

@(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:
@foreach (var answer in question.Answers) {
}
break; case QuestionType.TrueFalse:
@foreach (var answer in question.Answers) {
}
break; case QuestionType.Open_ended: @foreach (var answer in question.Answers) { } break; case QuestionType.Slider: @foreach (var answer in question.Answers) { 50 } break; case QuestionType.Rating:
@foreach (var answer in question.Answers) {
@answer.Text
}
break; case QuestionType.Ranking:

drag and drop to move the answers

    @{ int index = 1; // Initialize the index to start numbering from 1 } @foreach (var answer in question.Answers) {
  • @index. @answer.Text
  • index++; // Increment the index for the next item }
break; case QuestionType.Likert:
@foreach (var answer in question.Answers) { }
break; case QuestionType.Matrix:
@foreach (var option in question.Answers) // Assuming these are the consistent answer options across all sub-questions { } @foreach (var option in question.Answers) // Use consistent options for each sub-question { }
Question@option.Text
@question.Text
break; case QuestionType.Image:
@foreach (var answer in question.Answers) {
Image option
}
break; default: break; }
@if (i > 0) { } @if (i < Model.Questions.Count - 1) { }
}
@section Scripts { @{ } }