Em validation q/ja: Difference between revisions
From LimeSurvey Manual
Bravehorse (talk | contribs) No edit summary |
(Updating to match new version of source page) |
||
Line 3: | Line 3: | ||
===質問の検証式 (em_validation_q) === | ===質問の検証式 (em_validation_q) === | ||
'''説明''' | '''説明''' | ||
Line 47: | Line 48: | ||
[[Category:Question Settings/ja]][[Category:Question Logic Options]] | [[Category:Question Settings/ja]][[Category:Question Logic Options]] | ||
Another slightly different example can be downloaded below. It states that none of the three subquestion fields can be empty at the same time and that at least one of them has to be filled in (according to its corresponding regular expression). Download the question from [[Media:Limesurvey_question_id_question_validation.zip|here]]. |
Revision as of 13:55, 23 January 2019
質問の検証式 (em_validation_q)
説明
質問全体(複数選択質問をまとめて)を検証する式です。検証条件に合致しない場合、em_validation_q_tip で設定したメッセージが表示されます(CSSスタイルは.errorとなります)。このTIPは.em_q_fn_validationというCSSスタイルが使われ、template.cssの既定では非表示となります。
本機能とサブ質問の検証式(em_validation_sq オプション)との大きな違いは、質問または質問の一部が検証エラーとなると、エラーメッセージが表示される点です。サブ質問の検証式では、それぞれのテキスト入力欄(例えば配列質問タイプにおいてですが、単一入力する質問タイプでも機能します)の背景が(薄い)赤色になります。
有効な値
- 式マネージャーの構文に従うすべての式(中括弧は外す)。
例
- 自由回答(短い・複数)で利用者の情報を集め、有効なメールアドレスと電話番号が入力されたか検証したいとき
この例は無効な回答がいくつかある場合にどのように見えるかを示します。
これはひとつだけ、無効な回答がある場合の見え方です。
これは、情報を入力するためにどのように質問を編集するかを示します。
これは、ロジックファイルの出力の一部で、式が正しいか、構文エラーがないかをチェックできます。
お分かりのように、検証式はメールアドレスと電話番号が空白か正規表現フィルターにマッチするかテストしています。
電話番号やメールアドレスが無効な場合、検証TIPはワーニングメッセージだけ表示します。
LimeSurveyに上記の例をインポートする場合は、この.lsqファイルをダウンロードしてください。Em_validation_q_example.zip
Another slightly different example can be downloaded below. It states that none of the three subquestion fields can be empty at the same time and that at least one of them has to be filled in (according to its corresponding regular expression). Download the question from here.