Actions

質問タイプ - 自由回答(短い・複数)

From LimeSurvey Manual

Revision as of 15:04, 14 June 2018 by Bravehorse (talk | contribs) (Created page with "{{QS:array_filter_exclude/ja}}")

概略

This question type is a variation on the "Short Text" question type which allows more than one text entry per question. The user first defines the question and can then add additional text boxes by adding 'Answers'. Each answer becomes the label of the new text box.



: Multiple_short_text_example.zip

全般オプション

回答必須

説明

このオプションにより、アンケートの質問に回答者が必ず答えるようにすることができます。回答必須の質問に回答しない場合、回答者は先に進むことができません。ある質問に複数のサブ質問があり、特定のサブ質問のみを回答必須とする場合は、ロジックタブの下にある最小回答数属性を使用します。

プレインストールされたテーマを使用している場合、必須の質問属性を有効にすると、質問の横に赤いアスタリスクが表示されます。 表示したくない場合は、こちらを参照してください。


設定可能な値

  • オン - 参加者が次のページに進む前に質問に回答する必要があります。回答の選択肢に「回答なし」は表示されません。
  • ソフト - 質問に回答せずに次のページに進もうとすると警告が表示されますが、参加者は警告を無視して先に進むことができます。「回答なし」オプションは表示されます(アンケートの表示設定で有効になっている場合)。
  • オフ(規定値) - 質問に回答しなくてもよくなります


条件(以前の"出現条件")

説明

条件の結果値が「1」または「true」になると、質問がアンケートの中で「関連する」、つまりアンケート参加者に提示されます。その他の場合は質問は表示されません。どのような質問でも関連式を指定することができます。この関数は条件の後継であり、より複雑な条件ロジックをサポートします。

構文ハイライト

条件を保存するたびに、検証され構文がハイライトされます。エラーにも色がつくので、すぐに気づいて直すことができます。

 Hint: アンケートのすべての条件が正しく使用されているか確認するには、ロジックファイルを参照してください。


有効な値

構文ハイライトによい例があります。



(正規表現を使った)検証 (preg_validation)

説明

この設定は、質問内のすべての値の検証に使う正規表現を指定するものです。

質問やサブ質問への回答のどれかがこの検証要件に適合しない場合、テキスト入力欄の背景色が赤くなり、回答者が直すべき場所に気づきやすくなっています。回答者が送信ボタンを押さなくてもそれぞれの質問を検証することができます。

有効な値

  • 有効な任意の正規表現


表示

接頭辞 (prefix)

説明

テキスト入力ボックスの前に接頭辞として表示する文字列です。接頭辞は入力部分の左側に表示されます。

画面が小さいときは、接頭辞は入力部分の上に表示されます。左側にしたい場合 (New in 3.0.0 ) : 質問にsuffix-prefix-force クラスを加えます。

有効な値

  • 入力部分の前に表示したい任意の文字列

この属性に"$"を設定すると、テキスト入力ボックスの直前にドルマークが表示されます。



接尾辞 (suffix)

説明

テキスト入力ボックスの接尾辞となるテキストです。接尾辞は入力部分の右側に表示されます。

画面が小さい場合、接尾辞は入力部分の下に表示されます。右側に表示したい場合 (New in 3.0.0 ) : 質問にsuffix-prefix-force クラスを追加します。

有効な値

  • 入力部分の後ろに表示したい任意の文字列

この属性に"%"を設定すると、テキスト入力ボックスの直後にパーセントマークが表示されます。



入力ボックスの幅 (text_input_width)

説明

この属性では、テキスト入力ボックス(のラッパー)の幅を設定します。入力ボックスは(サブ)質問に対する回答のために使われます。幅の設定値が十分に大きい場合、テキスト入力ボックスは次の行に表示されます。このオプションは、入力部分のサイズや絡む全体の幅を設定するものではないことに注意してください。

設定可能な値

  • 規定値: 選択すると、規定値はラベルと対応するテキスト入力ボックスが同じ行になるよう設定されます。例えば、テキスト入力ボックスの幅が41%の場合、テキスト入力ボックスの幅の値はラベルと入力ボックスが同じ行になる値(この場合58%)になります。テキスト入力ボックスの幅が58%以上の場合、テキスト入力ボックスは次の行に表示されます。
  • 8%; 17%...92%, 100%: 選択値が大きくなるほどテキスト入力ボックスが大きくなります。

  • サブ質問/ラベルの下に入力部分を表示させたい場合は、ドロップダウンリストから100%を選択します。



ラベルカラム幅 (label_column_width)

説明

ラベルカラム幅設定は、ラベルやサブ質問の幅を規定します。この設定はラベルがある列の幅を設定するものではありません。

設定可能な値

  • 既定値: 選択すると、既定値はラベルと対応するテキスト入力ボックスが同じ行になるよう設定されます。例えば、テキスト入力ボックスの幅を92%とし、ラベルカラム幅を既定値にすると、ラベルと対応する回答用テキストボックスが同じ行に表示されます。ラベルラッパーの幅が7%より大きい場合、テキスト入力ボックスは次の行に表示されます。
  • 非表示: 選択すると、サブ質問がある第1カラムは表示されません。
  • 8%; 17% ... 92%; 100%: 選択値が大きくなるほどサブ質問の幅が大きくなります。

: サブ質問を同じ行に表示させるには、幅を100%に設定するとテキスト入力ボックスがサブ質問の下に表示されます。


質問テンプレート (question_theme)

説明

それぞれの質問にカスタマイズされたテンプレートを適用することができます。

利用可能な設定

  • テンプレートパネルの質問テンプレートにある作成済みの質問テンプレート

参照: https://manual.limesurvey.org/Question_themes

注意: この機能は現在開発中です。


TIP非表示 (hide_tip)

説明

多くの質問では、「以下からひとつだけ選択してください」のような注記(tip)や質問への回答方法を示すテキストが表示されます。この属性で、tipやヒントを表示するかしないかを設定できます。

こうしたtipやヒントには、検証基準(最小/最大回答数、最小/最大/合計値)に関するメッセージが含まれます。hide_tipをオンにすると、こうしたメッセージは表示されませんが、無効なデータを入力するとtipが表示されます。赤色で表示されますが、検証基準を満たすと緑色になります。

利用可能な設定値

  • オン - tipやヒント非表示
  • オフ(規定値)



表示行数 (display_rows)

説明

すべてのコメントをチェックするためにスクロールバーを使わずに表示する行数を指定します。設定値より多くの行がある場合、スクロールバーが表示されます。"自由回答(長い)"質問タイプの既定値は5、"自由回答(非常に長い)質問タイプ"は30です。

有効な値

  • 0より大きい整数



回答のランダム表示(random_order)

説明

  非推奨の回答オプション : 5.5.0から、この属性は回答の選択肢の順序付けには使用されなくなりました。QS:Answer_order/jaを参照してください。


この属性により、回答の選択肢/サブ質問の順番は無視され、ランダムに並べ替えられます。このオプションにより、アンケートの偏りをなくすことができます。サブ質問がある場合、サブ質問の順番はランダムになりますが、回答の選択肢の順番はランダムにはなりません。

有効な値

  • はい - 参加者がアンケートを開始するときにランダム化する
  • いいえ(規定値)



テキスト入力ボックスのサイズ (input_box_size)

 Hint: この機能は、バージョン3.0.0以降で使用できます。


説明

この機能は、テキスト領域(テキスト入力ボックス)のサイズを指定するものです。何も設定しなければ、LimeSurveyは入力ボックスを既定のサイズで表示します。この設定で既定の動作を変えることができます。

ボックスを次の行に移動させたい場合、ラッパーのサイズを大きくします。テキスト入力幅属性の値を大きくします。

有効な値

  • 任意の数値


この質問をいつも隠す (hidden)

説明

オンにすると、その質問は常に表示されません。この機能は以下のような場合に使用します。

  • 質問にURLをあらかじめ入力しておき、それを画面に表示させたくない場合。それぞれの質問がページに埋め込まれないため、アンケートで使用される条件が無効になります。
  • ExpressionScriptで値をその場で保存または計算したい場合。
注意: この機能で使用する一般的な質問タイプはです。

利用可能な設定値

  • オン
  • オフ(規定値)


CSS クラス (css_class)

説明

特定の質問に特別な CSS クラスを追加するときは、この欄に CSS クラス名を入力します。クラス名を列挙するときはスペースで区切ります。

有効な値

  • 任意の文字列と CSS クラスを区切るスペース
 Hint: この欄にを入力することもできます (New in 3.0.0 )。式の結果は動的に更新されないので注意してください。


  W3C によると, CSS クラス名は文字 [a-zA-Z, and 0-9] と ISO 10646 の U+00A1 以降の文字、 ハイフン(-)、アンダースコア(_)のみが使えます。数字で始めたり、ハイフンの後に数字を続けることはできません。LimeSurvey は CSS クラスをエンコードしますが、完全ではありません。



入力

最大文字数 (maximum_chars)

説明

この設定はテキストベースの質問で入力できる最大文字数を指定するものです。例えば20と入力すると、アンケート参加者は20文字を超えて入力することができません。

有効な値

  • 0より大きい任意の整数


ロジック

最小回答数 (min_answers)

説明

この機能は、複数選択質問で一定数の回答を選択させる場合に使用します。

有効な値

  • 0より大きい整数
  • 任意の数
  • 任意のSGQAコード
  • 任意の質問コード(変数名)
  • ExpressionScript構文を使用した任意の式(中括弧は除く)

Xと設定すると、利用者は少なくともX個のチェックボックスを選択しないとアンケートを送信できません。このオプションを順位づけに適用する場合は、少なくともX位まで順位づけする必要があります。

この属性を順位づけ質問で使用する場合、その質問は必須ではないと設定する必要があります。必須にすると、min_answers機能を使用する直感と異なり、すべてを順位づけしなければなりません。



最大回答数 (max_answers)

説明

複数選択質問で利用者が選択できる回答の上限数を設定するときに使用します。

有効な値

  • 任意の数値
  • 任意のSGQAコード
  • 任意の質問コード(変数名)
  • ExpressionScript構文を使用した任意の式(中括弧は除く)

2に設定すると、利用者は多くとも2つのチェックボックス、または1つのチェックボックスと「その他」欄(ある場合)に回答できます。順位づけ質問タイプでは、最大2位まで選択できます。


除外フィルター配列 (array_filter_exclude)

説明

除外フィルター配列設定は複数選択質問に使うことができ、回答結果を後続のリスト、配列、複数選択質問に表示させないようにすることができます。

以下の配列質問タイプにより、後続の質問がフィルターされます。
  • 複数選択
  • コメントつき複数選択
  • 自由回答(短い・複数)
  • 数字入力(複数)
  • 配列(5点、10点、はい/いいえ/どちらでもない、増加/同じ/減少、軸反転)
  • 配列(二元スケール、テキスト、数字)
  • 順位付け

さらに、それぞれの質問タイプをフィルタリングすることができます。

唯一の例外は、軸を反転した配列で、他の質問をフィルタリングできますが、それ自身にはできません。

設定方法

編集中の質問の除外フィルター配列 に複数選択質問の質問コードを入力します。それぞれの質問が現在の質問の情報源として使用され、前問で選択されなかった回答が現在の質問の回答の選択肢として引用され使用されます。例えば、ソースとなる複数選択質問のコードが"Q1"の場合、回答のフィルタリングプロセスを起動するため、'除外フィルター配列'ボックスに"Q1"と入力します。質問Q1で選択されなかった回答のみが表示されます。

このオプションを通じて複数の質問をフィルタリングしたい場合は、ボックスに質問コードをセミコロン(;)で区切って入力します。
  最初の質問で使用するサブ質問コードは2つ目のサブ質問コードと一致しなければなりません。一致しないと、除外フィルター配列機能による回答フィルタリングができません。全体としてどのように機能するか、下記の例で確認してください。


カスケーディング

設定するとカスケードして表示されます。つまり、他の質問をフィルターする質問を選択し、フィルターされた質問によってさらに他の質問をフィルターする、といったことが可能です。

以下の例を参照してください。



上のスクリーンショットでは、2つの質問があります。1つ目は複数選択質問タイプで、2つ目はコメントつき複数選択質問タイプです。1つ目の質問で回答した内容が2つ目の質問では除外されます。例えば、ComfortUpdate(サブ質問コードは'SQ1')とPlugin('SQ4') を選択すると、2つ目のサブ質問で対応する'SQ1'と'SQ4'が除外されます。スクリーンショットでは、1つ目の質問で選択されなかったものだけが2つ目の質問で表示されます。

この例は、以下のリンクからダウンロードできます。 Limesurvey_group_array_filter_exclude.zip LimeSurveyにこの質問グループをインポートします。



Array filter style (array_filter_style)

Description

This function allows you to choose how the array filtered subquestions are displayed. They can either be "hidden" or "disabled".

To learn how to filter subquestions, please read the following wiki section.

Available options

  • Hidden (default) - if this option is selected, then the previously selected subquestions will not be displayed in the second question.
  • Disabled - if this option is selected, then the previously selected subquestions will be greyed out and become unselectable.

Example

If you wish to use the "disabled" option, then the previously selected subquestions will be displayed like this:



Array filter (array_filter)

Description

The Array filter setting allows you to use any multiple choice question to select or set which responses are displayed in a subsequent list, array or multiple choice question.

The subsequent questions can be filtered on any array question type, including:
  • Multiple choice
  • Multiple choice with comments
  • Multiple short text
  • Multiple numeric
  • Array (5 point, 10 point, Yes/No/Unknown, Increase/Same/Decrease, Column)
  • Array (Dual Scale, Text, Numbers)
  • Ranking

Furthermore, each of these question types can be filtered.

The only exception is Array (Column), which can filter other questions, but not itself.

How to set a filter

To set a filter, enter the question code of a multiple options question in the array filter box of the question you are currently editing. The respective question will be used as the source of information for the current question, the selected answers from the previous question being retrieved and used as answer options for the current question. For example, if your source multiple option question code is "Q1", enter "Q1" into the 'Array Filter' box to start the filtering process of the answers. Only the answer options that are selected in question Q1 will be visible in the array_filter-ed question.

If you wish more questions to be filtered via this option, type the question codes in the box separated by semicolons (;).
  The subquestion codes used in the first question must coincide with the subquestion codes from the second one. Otherwise, the array filter function will not filter the answers to the first question. Note: When you want to filter the "other" answer option from the first question, you need to provide a subquestion for this answer in the second question and the subquestion code for this answer needs to be "other". Check the below example to better understand how the whole system works.


If multiple choice allow other setting: you can choose other for subquestion code and filter with other checked or not.

Cascading

The selected options can be displayed in cascade. This means that you can select a question which filters another question, which filters another question, and so on.

Array filter example

Let's take a look at the following example to better understand the power of this setting:



In the screenshot from above, we got two questions. The first one is a multiple short text question type, while the second one is an array dual scale question type. The answers you provide in the first question will be listed in the second one. Technically, the answers you provide to the subquestions from the first question are filtered and displayed in the second question.

This example can be downloaded from the following link: limesurvey_group_32.lsg. Import this question group into your LimeSurvey installation.


Exclusive option (exclusive_option)

Description

The exclusive option attribute takes the code of an answer in a multiple option question so that when clicked on its corresponding checkbox, all the other previously checked options will get unchecked and get marked as read-only (=disabled). This function was created to ensure the data integrity when one of the multiple options in a multiple option question implies that no other option can be selected too. Basically, this feature marks the other attributes as being irrelevant.

It is also possible to have multiple exclusive options. These must be separated by semicolons.

Example

For a short explanation on answer codes, check first the following wiki section. Once understood, introduce the "AnswerCode" that will trigger the function once selected.

Below, you may see an example where the exclusive option attribute is used.

You can see in the first screenshot that some non-LimeSurvey options are selected:



If you click on the marked option (which is entered in the exclusive option box), the other options will get unmarked and disabled, being left only with the current option checked:



To take a closer look at our example, import the .lsq file into your LimeSurvey installation:

File:Example exclusive option question.zip.



Randomization group name (random_group)

Description

It places the questions into a specified randomization group, all questions included in the specified group being displayed in a random order to the survey respondents.

You can find a sample survey using randomization group name in ExpressionScript sample survey.

Valid values

Just enter any string you like (for example: 'group1'). All question which have set the same string within the randomization group name box will have their place in the survey randomized (=randomly exchanged among each other).


Preview To preview the questions use the preview survey instead of the preview question group function, as the second has been reported to not show the questions in a randomized order.



Question validation equation (em_validation_q)

Description

This is an equation that is used to validate the entire question (e.g, all of its parts collectively for a multi-answer question). If the question fails the validation criteria, then em_validation_q_tip message will be displayed (it uses the CSS style .error). This tip uses the .em_q_fn_validation CSS style, which is hidden by default within template.css.

The main difference between this feature and the subquestion validation equations (em_validation_sq option) is that for this feature, if the question (or question parts) fail validation, then an error message could be shown. For the subquestion validation, each text entry cell (e.g., in an array question type, but it can also be applied to single entry question types) will be styled so that the background color is (light) red.

Valid values

  • Any equation that makes use of the ExpressionScript syntax, without surrounding curly braces.

Example

  • You want to collect demographic information from users via a multiple short text question, and you want to validate that the user has entered a valid email address and phone number.

This example shows how the question looks with invalid answers:

And here is what it looks like with one invalid answer:

Here is how you edit a question to enter that information:

And here is part of the Show Logic File output that lets you check the accuracy of your expression and ensure that there are no syntax errors:

As you can see, the validation equation tests that both the email and phone number are either empty or match a regular expression filter.

The validation tip only shows the warning message if the phone or email appears invalid.

 Hint: In order to create complex validation messages, read about the usage of the ExpressionScript.


If you wish to import the example from above into your LimeSurvey installation, download the following .lsq file: Em_validation_q_example.zip.

 Hint: Remember, LimeSuvey uses the Perl syntax for regular expressions, so they should start and end with / (slash character)!



Tip for whole question validation equation (em_validation_q_tip)

Description

If you are using the question validation equation, you can use this box in order to display an optional message as question tip on how the question has to be filled out.

Valid values

Example

See the example from the question validation equation wiki section- it shows how the tip can be tailored to show which parts of a multiple short text question fail the validation criteria.



Sub-question validation equation (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.

Valid values

Any equation that makes use of the ExpressionScript syntax, without surrounding curly braces.

Examples

For example, if you want to allow only numbers that are a multiple of 3 as answers, the equation would be:

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

The reserved variable this is automatically replaced by a reference to the active text entry cell.



Tip for sub-question validation equation (em_validation_sq_tip)

Description

If you are using em_validation_sq, this is an optional message/tip that will be displayed if the introduced answer is incorrect.

Valid values

  • Any string

Example

  • Continuing the example of validating emails, the tip might be "Please enter valid email addresses."


その他

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)


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)


統計

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