SurveyEngine是一个可自定义的Survey Web用户界面。

surveyengine的Python项目详细描述


可自定义的调查Web用户界面。

您可以通过

pip install --user surveyengine

并通过以下方式运行:

python -m surveyengine spec.json output/

其中,output是结果的输出文件夹,spec.json是 测量规范:

{"title":"Survey Title Here",// the survey title
"pages":[// a sequence of pages
{"lines":["first line",// plain text that will be displayed
"second line {foo}"// displays: second line bar
],"vars":{// defines local variables
"foo":"bar"},"pid":"start"// the id for the page (used as prefix in the result file)
"continue":"next",// creates a single button at the bottom -- default ("next") can be omitted
"type":"plain"// the type of page -- default ("plain") can be omitted
},{"type":"each",// repeats a sequence of pages
"name":"ix",// the iteration variable name -- it can be used via {ix} in fields
"name_next":"ix_next",// "name_next" and "name_prev" are optional variables containing the next / previous iteration
"vars":{// defines local variables
"img_len":25// we define the range as variable so we can use it in the text
},"to":"{img_len}",// iterate until this number
"pages":[// ... pages to repeat ...
{"lines":["image {ix_next} / {img_len}",// displays: image 1 / 25
["img","path/to/image{ix}.png",""]// the image to display
],"pid":"question:{ix}"// the id for the page
"continue":"choice",// creates a collection of buttons at the bottom
"values":[// the values to choose from
"yes","no"]}]// this page type does not have a "continue" field
},{"lines":[// other special lines
// [ question_type, display_text, question_id ]
["text","just text",""],// simple text -- equivalent to "just text"
["likert","fun","fun"],// likert scale
["likert","confidence","conf"]],"pid":"specials"},{"lines":["Thanks! {_token}"// _token is a special variable containing the user id
],"continue":"end",// indicates the end of the survey -- this page must exist
"pid":"end"}]}

每个用户在输出文件夹中创建一个带有其唯一标记的结果文件。 结果文件是一个包含所有答案的JSON文件

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javascript问题:通过URL用网站数据填充Textview   java TabLayout Android,如何用几个标签填充整个屏幕宽度,并用大量标签滚动?   Eclipse Java运行的文件不再存在于我的工作区中   安装两个Java版本时,使用Java的windows链接不起作用   java将多个图形添加到单个JPanel   java Kafka ConsumerFactory,带有两个Desiarizer   使用反射更改java类超类   当一致性测试失败时,java有没有办法让堆栈跟踪显示在控制台中   java映射到基元类型的HashMap的快速替代方案是什么?   java关闭一个jframe所有剩余的打开jframe都将关闭。   java为什么不推荐“使用getString()获取设备标识符”?   java值比较和值赋值之间有什么性能差异吗?   Java实体数组到JavaScript数组   java使用流将一个列表转换为另一个列表   在JTree中保存对象,但更改显示的名称(java swing)?   java“Hello world”Android应用程序,文件尽可能少,没有IDE,只有文本编辑器   java在方法之间传递值   java如何为项目数组创建ParseQuery?