Actions

QS

Em validation sq/ja: Difference between revisions

From LimeSurvey Manual

(Created page with "QS:Em validation sq")
 
No edit summary
(14 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<onlyinclude>
<onlyinclude>


===Sub-question validation equation (em_validation_sq)===
===サブ質問の検証式 (em_validation_sq)===


'''Description'''
'''説明'''


This is an equation that is used to validate each subquestion (text field) individually.  Any text field that does not pass these validation conditions will have its background color turned pink (using the .em_sq_fn_validation CSS style) to highlight the error.  Note that this is available in addition to the regular expression-based validation option.
各々のサブ質問(テキスト)を検証するための式です。検証条件に適合しないテキスト欄はエラーであることを示すため、背景色がピンク色になります(.em_sq_fn_validation CSSスタイルを使用)。正規表現ベースの検証も可能です。


'''Valid values'''
'''有効な値'''


Any equation that makes use of the [[Expression Manager]] syntax, without surrounding curly braces.
*[[ExpressionScript - Presentation/ja|ExpressionScript]]の構文に従うすべての式(中括弧は外す)。


'''Examples'''
''''''


For example, if you want to allow only numbers that are a multiple of 3 as answers, the equation would be:
例えば、回答を3の倍数に限定する場合、式は次のようになります。


<syntaxhighlight lang="php" enclose="div">(this / 3) == floor(this/3)</syntaxhighlight>
<syntaxhighlight lang="php" enclose="div">(this / 3) == floor(this/3)</syntaxhighlight>


The reserved variable ''this'' is automatically replaced by a reference to the active text entry cell.
予約値[[ExpressionScript - Presentation/ja#.E4.BA.88.E7.B4.84.E5.A4.89.E6.95.B0_.22this.22.E3.80.81.22self.22.E3.80.81.22that.22|''this'']]は、テキスト入力欄の入力値に自動的に置き換えられます。


</onlyinclude>
</onlyinclude>


[[Category:Question Settings]][[Category:Question Logic Options]]
[[Category:Question Settings/ja]][[Category:Question Logic Options]]

Revision as of 01:08, 22 May 2020


サブ質問の検証式 (em_validation_sq)

説明

各々のサブ質問(テキスト)を検証するための式です。検証条件に適合しないテキスト欄はエラーであることを示すため、背景色がピンク色になります(.em_sq_fn_validation CSSスタイルを使用)。正規表現ベースの検証も可能です。

有効な値

例えば、回答を3の倍数に限定する場合、式は次のようになります。

(this / 3) == floor(this/3)

予約値thisは、テキスト入力欄の入力値に自動的に置き換えられます。