diff --git a/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml b/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml index e6ae465..008ec72 100644 --- a/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml +++ b/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml @@ -151,6 +151,86 @@ } + .likert { + box-shadow: 0px 0px 7px 0px rgba(20,101,230,1); + -moz-box-shadow: 0px 0px 36px -12px rgba(20, 101, 230, 1); + -webkit-box-shadow:0px 0px 7px 0px rgba(20,101,230,1); + border-radius: 5px; + background-color: transparent; + padding: 20px; + + } + + .likert .statement { + margin-bottom: 10px; + } + + .likert .responses { + display: flex; + justify-content: space-between; + } + + .likert .likert-option { + flex: 1; + text-align: center; + } + + .likert label { + display: block; + cursor: pointer; + padding: 20px; + background-color: #182c4b; + border-radius: 2px; + margin: 3px; + transition: background-color 0.3s; + font-size: 0.8rem; + } + + .likert input[type="radio"]:checked + label { + background-color: transparent; + color: white; + font-size:1rem; + + } + + .card-deck .card { + cursor: pointer; + padding:0px; + border: 2px solid transparent; + box-shadow: 0px 0px 36px -12px rgba(20,101,230,1); + -webkit-box-shadow: 0px 0px 5px 0px rgba(20,101,230,1); + -moz-box-shadow: 0px 0px 36px -12px rgba(20, 101, 230, 1); + + background-color:transparent; + transition: border 0.3s ease; /* Add transition for a smooth effect */ + } + img{ + border-radius:3px; + box-shadow: 0px 0px 36px -12px rgba(20,101,230,1); + -webkit-box-shadow: 0px 0px 5px 0px rgba(20,101,230,1); + -moz-box-shadow: 0px 0px 36px -12px rgba(20, 101, 230, 1); + } + + .card-deck .card:hover { + border: 2px solid #007bff; + transition: border 0.3s ease; /* Ensure the transition applies to the hover state as well */ + } + + .card-deck .image-card.selected { + border: 4px solid #28a745; /* Green border for selected cards */ + } + + .card-deck .image-option { + display: block; + } + + + + .card-deck .image-option input[type="radio"] { + display: none; /* Hide radio button */ + } + + @@ -199,7 +279,9 @@ }
-

@(i + 1). @question.Text

+ +

@(i + 1). @question.Text

+
@switch (question.Type) @@ -214,8 +296,6 @@ break; case QuestionType.CheckBox: case QuestionType.Multiple_choice: - case QuestionType.Likert: - case QuestionType.Matrix: case QuestionType.Demographic:
@@ -263,9 +343,7 @@ } break; - case QuestionType.Image: - - break; + case QuestionType.Slider: @foreach(var answer in question.Answers) @@ -313,19 +391,116 @@ }
- + @if (Model.Questions.Any(q => q.Type == QuestionType.Likert)) + { + +
+ + @foreach (var questions in Model.Questions.Where(q => q.Type == QuestionType.Likert)) + { +
+ +
+ @foreach (var answer in questions.Answers) + { + + } +
+
+ + } +
+ } + 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 + { +
+ + + + + + @foreach (var option in matrixQuestion.Answers) // Assuming these are the consistent answer options across all sub-questions + { + + } + + + + + + @foreach (var option in matrixQuestion.Answers) // Use consistent options for each sub-question + { + + } + + +
Question@option.Text
@matrixQuestion.Text + +
+ +
+ } + } + + 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) + { +
+ Image option + +
+ } +
+
+ } + } break; default: - break; + break; }
@@ -382,9 +557,8 @@ }); }); + - - // Ensure we only add listeners once by checking if they've been added already if (!window.hasEventListenersAdded) { const upButtons = document.querySelectorAll('.up-button'); @@ -500,6 +674,28 @@ // Initialize the form at the first step showStep(currentStep); }); + + document.addEventListener("DOMContentLoaded", function () { + const stepper = document.querySelector('.stepper'); + if (!stepper) { + console.error('Stepper not found!'); + return; + } + + let shownTypes = new Set(); // Set to track shown question types + const stepIndicators = stepper.querySelectorAll('.step-indicator'); + + stepIndicators.forEach(indicator => { + const type = indicator.querySelector('.step-label').textContent.trim(); // Get the text content of the step-label + if (shownTypes.has(type)) { + // If this type has already been shown, hide this indicator + indicator.style.display = 'none'; + } else { + // Otherwise, mark this type as shown + shownTypes.add(type); + } + }); + }); @*