Fix variable namings

This commit is contained in:
Marcus Kammer 2024-07-05 16:34:40 +02:00
parent a56948b36c
commit 081086495c
Signed by: marcuskammer
GPG key ID: C374817BE285268F
2 changed files with 7 additions and 8 deletions

View file

@ -1,6 +1,6 @@
(defsystem "dev.metalisp.survey" (defsystem "dev.metalisp.survey"
:description "A simple survey" :description "A simple survey"
:version "0.1.4" :version "0.1.5"
:author "Marcus Kammer <marcus.kammer@metalisp.dev" :author "Marcus Kammer <marcus.kammer@metalisp.dev"
:source-control "git@git.sr.ht:~marcuskammer/dev.metalisp.survey" :source-control "git@git.sr.ht:~marcuskammer/dev.metalisp.survey"
:licence "MIT" :licence "MIT"

View file

@ -6,7 +6,6 @@
(defun survey (survey &optional results) (defun survey (survey &optional results)
"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)
(print results)
(let ((results-not-null (results-not-null results)) (let ((results-not-null (results-not-null results))
(sus-results (getf results :sus))) (sus-results (getf results :sus)))
(with-page (:title "Survey Details") (with-page (:title "Survey Details")
@ -28,17 +27,17 @@
(:thead (:thead
(:tr (:tr
(:th :scope "col" "Time") (:th :scope "col" "Time")
(loop for i from 1 below count-answers (loop for header from 1 below count-answers
do (:th :scope "col" (format nil "Q ~a" i))) do (:th :scope "col" (format nil "Q ~a" header)))
(:th :scope "col" "SUS Score"))) (:th :scope "col" "SUS Score")))
(:tbody (:tbody
(loop for result in sus-results (loop for row in sus-results
do (:tr (mapcar (lambda (x) (:td x)) result))))))) do (:tr (mapcar (lambda (data) (:td data)) row)))))))
(loop for (type data) on results by #'cddr unless (eq type :sus) (loop for (type data) on results by #'cddr unless (eq type :sus)
do (progn (:h3 (format nil "~a" type)) do (progn (:h3 (format nil "~a" type))
(loop for row in data (loop for row in data
do (:ul :class "list-group py-3" do (:ul :class "list-group py-3"
(loop for item in row (loop for data in row
do (:li :class "list-group-item" do (:li :class "list-group-item"
item))))))))))) data)))))))))))