Update survey details view

This commit is contained in:
Marcus Kammer 2024-06-22 15:07:24 +02:00
parent b37dffa8cc
commit 64f901d232

View file

@ -4,23 +4,24 @@
"Generates the view to show the survey created." "Generates the view to show the survey created."
(check-type survey ml-survey:survey) (check-type survey ml-survey:survey)
(with-page (:title "Survey Details") (with-page (:title "Survey Details")
(navbar-en) (body-header "Survey Details" (navbar-en))
(:section :class "container" (:main :id "main-content"
(:p (format nil "Survey ID: ~a" (ml-survey:survey-id survey))) :class "container"
(:h2 "Properties") (:p (format nil "ID: ~a" (ml-survey:survey-id survey)))
(ml-survey:survey-html survey) (:h2 "Properties")
(when results (ml-survey:survey-html survey)
(:h2 "Questionnaire Results") (when results
(let ((count-answers (length (car results)))) (:h2 "Questionnaire Results")
(:table :class "table table-hover" (let ((count-answers (length (car results))))
(:thead (:table :class "table table-hover"
(:thead
(:tr
(loop for i from 1 to count-answers do
(if (= i count-answers)
(:th :scope "col" "SUS Score")
(:th :scope "col" (format nil "Q ~a" i)))))
(:tbody
(loop for result in results do
(:tr (:tr
(loop for i from 1 to count-answers do (loop for answer in result do
(if (= i count-answers) (:td answer))))))))))))
(:th :scope "col" "SUS Score")
(:th :scope "col" (format nil "Q ~a" i)))))
(:tbody
(loop for result in results do
(:tr
(loop for answer in result do
(:td answer))))))))))))