Simplify sus survey and remove ids

This commit is contained in:
Marcus Kammer 2024-05-20 21:52:48 +02:00
parent fa084090d0
commit 5f45398575
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -168,7 +168,7 @@
#+begin_src lisp :package :sus :tangle sus-survey.cl #+begin_src lisp :package :sus :tangle sus-survey.cl
(ql:quickload :dev.metalisp.sbt) (ql:quickload :dev.metalisp.sbt)
(defpackage sus (defpackage sus
(:use #:cl) (:use #:common-lisp)
(:import-from hunchentoot #:define-easy-handler) (:import-from hunchentoot #:define-easy-handler)
(:import-from hunchentoot #:easy-acceptor) (:import-from hunchentoot #:easy-acceptor)
(:import-from hunchentoot #:post-parameters*) (:import-from hunchentoot #:post-parameters*)
@ -194,53 +194,93 @@
(multi-form (multi-form
(:ask "Id like to use this system frequently." (:ask "Id like to use this system frequently."
:group "sus-1" :group "sus-1"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "The system is unnecessarily complex." (:ask "The system is unnecessarily complex."
:group "sus-2" :group "sus-2"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "The system is easy to use." (:ask "The system is easy to use."
:group "sus-3" :group "sus-3"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "I need the support of a technical person to use this system." (:ask "I need the support of a technical person to use this system."
:group "sus-4" :group "sus-4"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "The functions in this system are well integrated." (:ask "The functions in this system are well integrated."
:group "sus-5" :group "sus-5"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "There is too much inconsistency in this system." (:ask "There is too much inconsistency in this system."
:group "sus-6" :group "sus-6"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "Most people would learn to use this system very quickly." (:ask "Most people would learn to use this system very quickly."
:group "sus-7" :group "sus-7"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "The system is very awkward to use." (:ask "The system is very awkward to use."
:group "sus-8" :group "sus-8"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "I feel very confident using this system." (:ask "I feel very confident using this system."
:group "sus-9" :group "sus-9"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree"))
(:ask "I needed to learn a lot of things to get started with this system." (:ask "I needed to learn a lot of things to get started with this system."
:group "sus-10" :group "sus-10"
:style nil :style "list-style:none;"
:choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree"))) :choices (:single "1 Strongly Disagree"
"2 Disagree"
"3 Neither Agree nor Disagree"
"4 Agree"
"5 Strongly Agree")))
(btn-primary (:type "submit") (btn-primary (:type "submit")
(find-l10n "submit" spinneret:*html-lang* *l10n*))))) (find-l10n "submit" spinneret:*html-lang* *l10n*)))))
@ -267,9 +307,6 @@
:acceptor (handle-acceptor (make-instance 'easy-acceptor :acceptor (handle-acceptor (make-instance 'easy-acceptor
:port 8080)))) :port 8080))))
(defun generate-response-id ()
(format nil "~D" (random most-positive-fixnum)))
(defun load-response (app) (defun load-response (app)
(with-open-file (stream (survey-app-response app) (with-open-file (stream (survey-app-response app)
:direction :input :direction :input
@ -284,19 +321,22 @@
:if-exists :supersede) :if-exists :supersede)
(princ responses stream))) (princ responses stream)))
(define-easy-handler (sus :uri "/") nil (sus-form)) (define-easy-handler (sus :uri "/") nil
(sus-form))
(define-easy-handler (submit :uri "/submit") nil (define-easy-handler (submit :uri "/submit") nil
(setf (content-type*) "text/plain") (setf (content-type*) "text/plain")
(let ((post-params (post-parameters* *request*)) (let ((post-params (post-parameters* *request*))
(response-id (generate-response-id))
(stored-response (load-response *app1*))) (stored-response (load-response *app1*)))
(if (= (length post-params) 10) (if (= (length post-params) 10)
(let ((response stored-response)) (let ((response stored-response))
(push (list response-id post-params) response) (push post-params response)
(store-response *app1* (reverse response)) (store-response *app1* (reverse response))
(format nil "~A" response)) (format nil "~A" response))
(format nil "Please fill out all forms")))) (format nil "Please fill out all forms"))))
#+end_src #+end_src
#+RESULTS: #+RESULTS: