Actions

问题类型 - 方程式

From LimeSurvey Manual

Revision as of 06:02, 11 September 2020 by Lacity (talk | contribs)

简述

 Hint: 和其他类型的问题不一样,即使方程式是隐藏的,他的值已经保存在数据库中了。


 Hint: 方程式问题类型允许向其他问题赋值。详情查看如何使用赋值运算符.


  出于安全考虑,任何 HTML 标签不能存入数据库。


本问题类型用来创建一个可以保存在数据库变量中的方程式 (例如计算器或是定制报告) 。方程式问题使用可以 表达式脚本里支持的任何语法。请确保你使用了下面提到的高级问题设置仅数字在你处理数值的时候。

你可以通过下面的示例了解如何使用这个问题类型:




示例: Limesurvey_survey_BMIsample.lss.zip.

编辑方程式问题

使用专用设置

编辑方程式的最佳方法是使用专用设置:可以为不同的语言使用相同的方程式,还有确保方程式里没有整合HTML语句。可以保证完整显示说明语句的同时,只在数据库中保存必要的数值:比如把 {weightkg/tall} 放进公式然后显示 “Your BMI is {self.NAOK}”.

如果你要内置表达式:你就必须要使用花括号。

使用问题文本

你可以通过 HTML/WYSIWYG 编辑器或是 HTML source源码来编辑:

  • 使用所见即所得编辑器:



  • 从HTML 源代码:



当你需要一份纯文字或纯数字的反馈记录的时候,建议在源码中编辑。修改源码的时候,你可以删除任何可能影响存储过程的 HTML 代码。



提示: 要了解其他 HTML 编辑器,请查看 百科中的 HTML 编辑器模式部分.

常规选项

必答题

说明

此选项可以使管理员要求受访者回答某些问题。如果必答题没有回答,那么受访者不能继续答题。如果你有一个包含多个子问题的问题,并且只有几个子问题必选回答,那可以使用 逻辑 标签下的最少需要回答的答案属性。

如果你使用任何一个内置主题,并开启了 必答题 属性,问题的后面就会有一个红色的星号。如果你想隐藏这个星星,请查看说明.


可用选项

  • 关 (默认)


相关性方程

说明

如果相关性方程的值是 "1" 或 "true", 那问题就是在调查中就是"相关的" ,比如 是就会在调查中显示,如果不是,问题就会隐藏起来。任何调查的问题都允许你指定一个指定一个相关方程式。这个函数是条件 的继任者,并支持更多更复杂的条件逻辑。

语法高亮

每次你在保存相关方程式的时候,系统都会评估并突出显示语法。因此任何错误都会使用颜色标记出来,以便你能快速的发现并修复。

 Hint: 要想检查所有的相对方程式是否在调查中被正确使用,请查看显示逻辑文件 功能。

有效值

示例

这里有个 语法突出显示的好例子。


显示

总是隐藏这个问题 (hidden)

说明

如果启用,这个问题就会被隐藏起来 - 不会被调查的参与者看到。这个函数可用在以下场景使用:

  • 如果你不想在屏幕上显示一个你预填了一条链接的问题。这样会覆盖在调查中的使用的任何条件,因为每个问题都不是内嵌在网页中的。
  • 如果你想在运行中通过演示存储或是计算一个数值。
注意: 经常使用这一函数的问题类型是 方程式

可用选项

  • 关 (默认)


CSS class (css_class)

说明

如果你要在某些问题里添加特殊的 CSS 类,你可以在这个框里输入 CSS 类的名字。确保在每个不同的类名之间保留一个空格。

有效值

  • 在 CSS 类名之间都有一个空格的任意字符串。
 Hint: 你也可以在这个框中插入表达式 (New in 3.0.0 )。请记住表达式的输出不是动态更新的。


  依照 W3C 的规则, CSS 类名只能包含 [a-zA-Z, and 0-9] 和 ISO 10646 characters U+00A1 以及之后版本的字符,还有连字符 (-) and 和下划线 (_)。 命名不能以数字,或者在连字符后面紧跟数字开头。LimeSurvey 编码了encodes CSS 类,但并没有完全解决。



可打印调查的相关性帮助 (printable_survey_relevance_help)

说明

如果要打印调查,也可以打印每个问题的相关性方程式。 但是,如果您想提供的是解释而不是印刷表格上的表达式,请在此框中填写相关性方程式的文字说明。

有效值

  • 任何你想在可打印表单上显示的文本或数字。


逻辑

Equation (equation)

Description

The result of the expression you type here will be stored in the response table and NOT the result(s) of the expressions typed in the question textbox. For example, you may want to display several expressions in the question textbox to display the respondents some statistics about herself. However, if you wish to store something different at the same time, then type the desired expression in this field.

This equation is used for all language.

Valid values


其他

Insert page break in printable view (page_break)

Description

This attribute is only active when you actually print a survey from the Printable View. It forces a page break before the question.

Available options

  • On
  • Off (default)



SPSS export scale type (scale_export)

Description

This is used for SPSS export only. This attribute overrides the default scale guessed by SPSS. To learn what the different measurement scales do, please read the related SPSS documentation.

Available options

  • Default (default)
  • Nominal
  • Ordinal
  • Scale


Numbers only (numbers_only)

Description

If you enable this option, the participant can only enter numbers in the text box(es).

For the equation question types, this setting indicates that the result could only be a number, not a string. This will guarantee proper calculations/conversions in follow-up equations regarding the decimal mark.

Behavior by question type

  1. Default: If the subject enters a value that is not a number, that value is immediately cleared from the text box so that the subject can enter an appropriate value.
  2. Array (Texts): If the numbers only option is disabled, the "Show totals for" and "Show grand total" options will be overruled, while the total text boxes will not be displayed.
  3. Equation: Enabling this option will force the equation results to be converted to a numeric value. If the equation result is not a number (and not blank), the equation will return NaN, being saved as an empty string in the response table.

Available options

  • On
  • Off (default)


统计

Show in public statistics (public_statistics)

Description

This attribute allows the survey administrator to chose if a particular question results should be displayed to the survey participants after they submitted the survey.

Note: To have the statistics displayed on the last page, do not forget to enable this functionality from the presentation & navigation settings. Otherwise, no statistics link will be displayed at the end of your survey.

The default setting for each question is 'Off' (=Do not show the question statistics to the respondents). You have to enable this for every single question if you want to show the survey statistics of that (those) particular question(s) to the survey participants after the survey submission.

Available options

  • On
  • Off (default)



Display chart (display_chart)

Description

This attribute allows the survey administrator to choose if a chart that contains the question results should be displayed to the survey participants after they filled out the survey.

Note: To have the chart displayed on the last page, you have to enable the following options:


Available options

  • On
  • Off (default)



Chart type (chart_type)

Description

This attribute allows the survey administrator to choose which type of chart will be displayed to the respondent once he/she finished filling out the survey.

Note: Do not forget to change the question and survey settings in order to have the charts displayed at the end on the survey. For more details, check the wiki section on the display chart question attribute.

Available options

  • Bar chart
  • Pie chart
  • Radar
  • Line
  • PolarArea
  • Doughnut