From 5f4539857577d9ea393ee0b016036caab7285988 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Mon, 20 May 2024 21:52:48 +0200 Subject: [PATCH] Simplify sus survey and remove ids --- .../pattern/survey-examples/user-research.org | 94 +++++++++++++------ 1 file changed, 67 insertions(+), 27 deletions(-) diff --git a/docs/pattern/survey-examples/user-research.org b/docs/pattern/survey-examples/user-research.org index da4aa66..e4c0990 100644 --- a/docs/pattern/survey-examples/user-research.org +++ b/docs/pattern/survey-examples/user-research.org @@ -168,7 +168,7 @@ #+begin_src lisp :package :sus :tangle sus-survey.cl (ql:quickload :dev.metalisp.sbt) (defpackage sus - (:use #:cl) + (:use #:common-lisp) (:import-from hunchentoot #:define-easy-handler) (:import-from hunchentoot #:easy-acceptor) (:import-from hunchentoot #:post-parameters*) @@ -194,53 +194,93 @@ (multi-form (:ask "I’d like to use this system frequently." :group "sus-1" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :choices (:single "1 Strongly Disagree" + "2 Disagree" + "3 Neither Agree nor Disagree" + "4 Agree" + "5 Strongly Agree")) (:ask "The system is unnecessarily complex." :group "sus-2" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :choices (:single "1 Strongly Disagree" + "2 Disagree" + "3 Neither Agree nor Disagree" + "4 Agree" + "5 Strongly Agree")) (:ask "The system is easy to use." :group "sus-3" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-4" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-5" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-6" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-7" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-8" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-9" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree")) + :style "list-style:none;" + :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." :group "sus-10" - :style nil - :choices (:single "Strongly Disagree" "Disagree" "Neither Agree nor Disagree" "Agree" "Strongly Agree"))) + :style "list-style:none;" + :choices (:single "1 Strongly Disagree" + "2 Disagree" + "3 Neither Agree nor Disagree" + "4 Agree" + "5 Strongly Agree"))) (btn-primary (:type "submit") (find-l10n "submit" spinneret:*html-lang* *l10n*))))) @@ -267,9 +307,6 @@ :acceptor (handle-acceptor (make-instance 'easy-acceptor :port 8080)))) - (defun generate-response-id () - (format nil "~D" (random most-positive-fixnum))) - (defun load-response (app) (with-open-file (stream (survey-app-response app) :direction :input @@ -284,19 +321,22 @@ :if-exists :supersede) (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 (setf (content-type*) "text/plain") + (let ((post-params (post-parameters* *request*)) - (response-id (generate-response-id)) (stored-response (load-response *app1*))) + (if (= (length post-params) 10) (let ((response stored-response)) - (push (list response-id post-params) response) + (push post-params response) (store-response *app1* (reverse response)) (format nil "~A" response)) (format nil "Please fill out all forms")))) + #+end_src #+RESULTS: