Refactor questionnaire
This commit is contained in:
parent
2adc20a7ad
commit
c482b17095
1 changed files with 12 additions and 11 deletions
|
@ -207,14 +207,15 @@ Example 4:
|
||||||
(:ask \"Which social media platforms do you use regularly?\"
|
(:ask \"Which social media platforms do you use regularly?\"
|
||||||
:group \"age\"
|
:group \"age\"
|
||||||
:choices (:multiple \"Facebook\" \"Twitter\" \"Instagram\" :text \"Others\")))"
|
:choices (:multiple \"Facebook\" \"Twitter\" \"Instagram\" :text \"Others\")))"
|
||||||
`(spinneret:with-html
|
(let ((class-string (spacing :property "p" :side "y" :size 5)))
|
||||||
(:form :action ,action
|
`(spinneret:with-html
|
||||||
:method "post"
|
(:form :action ,action
|
||||||
:class (spacing :property "p" :side "y" :size 5)
|
:method "post"
|
||||||
,@(loop for q in body
|
:class ,class-string
|
||||||
collect (multiple-value-bind (ask group choices)
|
,@(loop for q in body
|
||||||
(extract-question-components q)
|
for (ask group choices) = (multiple-value-list (extract-question-components q))
|
||||||
(let ((splitted-choices (split-plist-by-keyword choices)))
|
do (unless (questionp q)
|
||||||
`(question ,ask ,group ,@splitted-choices))))
|
(error "Invalid question format: ~a" q))
|
||||||
(btn-primary (:type "submit")
|
collect `(question ,ask ,group ,@(split-plist-by-keyword choices)))
|
||||||
(find-l10n "submit" spinneret:*html-lang* l10n)))))
|
(btn-primary (:type "submit")
|
||||||
|
(find-l10n "submit" spinneret:*html-lang* l10n))))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue