You supply a list of associations instead of a single association as the first argument. However, it requires a bit of a hack to get different titles on each page. Here's a function to make it easier:
pagesToFormspec[
pages_List] := <|
"Title" -> <|"Label" -> #[["Title"]], "Required" -> False,
"Hidden" -> True|>,
"Description" -> <|"Label" -> #[["Description"]],
"Required" -> False, "Hidden" -> True|>,
"Choice" -> #[["Choice"]]|> & /@ pages
questions = {<|"Title" -> "Question 1.1",
"Description" ->
"If the supply curve for orange juice is estimated to be Q = 40 + \
2p, then, at a price of p = 2, the price elasticity of supply is",
"Choice" -> <|
"Interpreter" -> {"A" -> 1, "B" -> 2, "C" -> 3, "D" -> 4},
"Control" -> RadioButtonBar|>|>, <|"Title" -> "Question 1.2",
"Description" -> "2+2 is",
"Choice" -> <|
"Interpreter" -> {"A" -> 2, "B" -> 4, "C" -> 6, "D" -> 8},
"Control" -> RadioButtonBar|>|>}
CloudDeploy[
FormFunction[pagesToFormspec[questions], func,
FormLayoutFunction ->
Function[
Grid[{{Annotation[
Style[#["Title", "Label"],
"Section"], {"class" -> "form-title"},
"HTMLAttrs"]}, {Annotation[Style[#["Description", "Label"],
"Text"], {"class" -> "form-description"},
"HTMLAttrs"]}, {#["Choice"]}},
Alignment -> Left]]], "formtest"]
Modify the questions
variable to suit your needs. The association func
is called with will contain "Title" and "Description" keys as well as the "Choice" key, but you can just ignore them.
Enjoy!