Part 1: Simple survey¶
(一个视频教程在这里 YouTube )
我们来创建一个简单的问卷调查——在第一个页面上,将询问参与人的姓名与年龄,之后在第二个页面上,将此信息展示给参与人。
页面¶
此调查问卷包含2个页面:
- 页面1:玩家输入姓名与年龄
- 页面2:玩家看到他们在之前的页面输入的数据
所以,在你的 page_sequence
中创建2个页面:Survey
与 Results
。
页面1¶
首先我们定义 Survey
页面。这个页面包含一个表单,将 form_model
设为 player
并在 form_fields
中选中 name
与 age
。
然后,将模板的标题设为 Enter your information
,并将内容设置如下:
Please enter the following information.
{{ formfields }}
{{ next_button }}
页面2¶
现在我们来定义 Results
页面。
将模板的标题设为 Results
并将内容设定如下:
<p>Your name is {{ player.name }} and your age is {{ player.age }}.</p>
{{ next_button }}
定义session config¶
在侧边栏中,点击 “Session Configs”,创建一个 session config,并将你的问卷调查应用添加进 app_sequence
。