From 5025d948ab8025f42c0af9585cde2cdd01f0e6c2 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Sat, 15 Jun 2024 19:22:21 +0200 Subject: [PATCH] Load sus multi-form from disk --- src/views/forms/en/demo.lisp | 9 +++ src/views/forms/en/sus.lisp | 92 ++++++++++++++++++++++++++++++ src/views/sus.lisp | 107 ++++------------------------------- 3 files changed, 111 insertions(+), 97 deletions(-) create mode 100644 src/views/forms/en/demo.lisp create mode 100644 src/views/forms/en/sus.lisp diff --git a/src/views/forms/en/demo.lisp b/src/views/forms/en/demo.lisp new file mode 100644 index 0000000..c902b37 --- /dev/null +++ b/src/views/forms/en/demo.lisp @@ -0,0 +1,9 @@ +(multi-form + (:ask "How old are you?" + :group "demo-1" + :style "list-style:none;" + :choices (:single "under 18" + "18 to 25" + "26 to 35" + "36 to 45" + "over 45"))) diff --git a/src/views/forms/en/sus.lisp b/src/views/forms/en/sus.lisp new file mode 100644 index 0000000..cec2b7a --- /dev/null +++ b/src/views/forms/en/sus.lisp @@ -0,0 +1,92 @@ +(in-package :ml-survey/views) + +(multi-form + (:ask "I would like to use this system frequently." + :group "sus-1" + :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 "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 "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 "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 "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 "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 "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 "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 "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 "list-style:none;" + :choices (:single "1 Strongly Disagree" + "2 Disagree" + "3 Neither Agree nor Disagree" + "4 Agree" + "5 Strongly Agree"))) diff --git a/src/views/sus.lisp b/src/views/sus.lisp index ed573c2..b1db53a 100644 --- a/src/views/sus.lisp +++ b/src/views/sus.lisp @@ -3,116 +3,29 @@ (defun load-form (lang form-file-name) "Load a Lisp file containing form definitions." (let* ((relative-path (concatenate 'string "src/views/forms/" lang "/")) - (full-path (merge-pathnames relative-path *default-pathname-defaults*)) - (form-path (merge-pathnames form-file-name full-path))) + (full-path (uiop:merge-pathnames* relative-path (uiop:getcwd))) + (form-path (uiop:merge-pathnames* form-file-name full-path))) (unless (probe-file form-path) (error "Form file ~A does not exist." form-path)) - (load form-path))) + (load form-path)) + nil) (defun sus-form-en (survey-id) (with-page (:title "SUS Form") - (navbar-en) - (:section :class "container" + (:section :class "container my-5" (:h2 "Usability Feedback Form") (:p "Please fill out the following forms and press the submit button.") (:form :action (format nil "/survey/~a/questionnaire/sus" survey-id) :method "post" - :class (dev.metalisp.sbt/utility:spacing :property "m" :side "y" :size 5) - (multi-form - (:ask "I’d like to use this system frequently." - :group "sus-1" - :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 "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 "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 "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 "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 "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 "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 "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 "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 "list-style:none;" - :choices (:single "1 Strongly Disagree" - "2 Disagree" - "3 Neither Agree nor Disagree" - "4 Agree" - "5 Strongly Agree"))) + :class (dev.metalisp.sbt/utility:spacing :property "m" + :side "y" + :size 5) + ;; load the multi-form from disk + (load-form "en" "sus.lisp") (btn-primary (:type "submit") (find-l10n "submit" *html-lang* *l10n*)))))) - (defun sus-form-de (survey-id) (with-page (:title "SUS Formular") (navbar-de)