Hovedgaden 3
diff --git a/Web/Controllers/QuestionnaireResponseController.cs b/Web/Controllers/QuestionnaireResponseController.cs
index e269b6f..3aac4d5 100644
--- a/Web/Controllers/QuestionnaireResponseController.cs
+++ b/Web/Controllers/QuestionnaireResponseController.cs
@@ -71,48 +71,6 @@ namespace Web.Controllers
}
- //public IActionResult DisplayQuestionnaire(int id, string token)
- //{
- // // Check if the token is null or empty
- // if (string.IsNullOrEmpty(token))
- // {
- // ViewBag.ErrorMessage = "The URL is invalid. Please provide a valid token.";
- // return View("Error");
- // }
-
- // // Split the token to extract the expiration date and time
- // string[] tokenParts = token.Split('|');
- // if (tokenParts.Length != 2)
- // {
- // ViewBag.ErrorMessage = "The URL is invalid. Please provide a valid token.";
- // return View("Error");
- // }
-
- // string expiryDateTimeString = tokenParts[1];
-
- // // Parse the expiration datetime in UTC format
- // if (!DateTime.TryParseExact(expiryDateTimeString, "yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out DateTime expiryDateTimeUtc))
- // {
- // ViewBag.ErrorMessage = "The URL is invalid. Please provide a valid token.";
- // return View("Error");
- // }
-
- // // Convert the expiration datetime to local time
- // DateTime expiryDateTimeLocal = expiryDateTimeUtc.ToLocalTime();
-
- // // Check if the token is expired (accounting for time zone offset)
- // if (expiryDateTimeLocal >= DateTime.Now.AddHours(1))
- // {
-
- // return RedirectToAction(nameof(Error));
- // }
-
- // // Retrieve the questionnaire using the numeric ID
- // var questionnaire = _questionnaireRepository.GetQuestionnaireWithQuestionAndAnswer(id);
-
- // return View(questionnaire);
- //}
-
-
+
}
}
diff --git a/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml b/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml
index 1c04715..6ca85a0 100644
--- a/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml
+++ b/Web/Views/QuestionnaireResponse/DisplayQuestionnaire.cshtml
@@ -4,16 +4,43 @@
Layout = "~/Views/Shared/_QuestionnaireResponse.cshtml";
}
-
-
+
-
@ViewBag.ErrorMessage
-
@Model.Title
@Html.Raw(Model.Description)
-
-
+
+
@@ -110,7 +155,75 @@
var question = Model.Questions[i];
@(i + 1). @question.Text
+
@switch (question.Type)
+ {
+ case QuestionType.Text:
+
+
+
+ break;
+ case QuestionType.CheckBox:
+ case QuestionType.Multiple_choice:
+ case QuestionType.Likert:
+ case QuestionType.Matrix:
+ case QuestionType.Demographic:
+ case QuestionType.Ranking:
+
+ @foreach (var answer in question.Answers)
+ {
+
+
+
+
+ }
+
+ break;
+ case QuestionType.TrueFalse:
+
+
+
+
+
+
+
+
+ break;
+ case QuestionType.Open_ended:
+
+ break;
+ case QuestionType.Image:
+
+ break;
+ case QuestionType.Slider:
+
+
+
+ break;
+ case QuestionType.Rating:
+