Actions

Tab Separated Value survey structure/ja: Difference between revisions

From LimeSurvey Manual

No edit summary
No edit summary
Line 96: Line 96:
==質問==
==質問==


One question row per survey language (e.g. there would be 3 question rows if survey has 3 languages).  Questions are assumed to belong to the group that precedes them.
アンケートの言語ごとに1行あります(例えば、アンケートに3つの言語がある場合は質問の行が3つになります)。質問は先行する行のグループに属しているとみなされます。
#id => unique numeric identifier for the question, starting with number 1, use the same ID for additional languages belonging to current question
#id => 質問に対して一意の数値の識別子。数字1から、現在の質問に対応する他の言語の質問に同じIDを使用します。
#class => 'Q'
#class => 'Q'
#type/scale => type -- the (usually one letter) [[Question types|question type]] (e.g. 'M' is Multiple Choice)
#type/scale => タイプ(通常1文字であらわされる[[Question types/ja|質問タイプ]])(例: 複数選択は'M'
#name => title -- the unique question name (the root of the qcode naming system)
#name => タイトル(固有の質問名でqcode命名システムで利用)
#relevance => relevance -- the [[Expression Manager#Access_to_Variables|relevance equation]]  for the question
#relevance => 出現条件(質問に対する[[Expression Manager/ja#Access_to_Variables|出現条件の式]]
#text => question -- the language-specific text of the question
#text => 質問(言語ごとの質問テキスト)
#help => help -- the language-specific help text
#help => ヘルプ(言語ごとのヘルプテキスト)
#language => language -- the language for the group (e.g. 'en')
#language => 言語(グループの言語。例: 'en'
#validation => preg -- the optional regular expression validation criteria for the question
#validation => preg(質問の検証条件として使用する正規表現)
#mandatory => mandatory -- 'Y' if mandatory
#mandatory => 回答必須フラグ(必須の時は'Y'
#other => other -- 'Y' if the "Other" option should be available (only for some question types)
#other => その他(一部の質問タイプで"その他"を使用する場合'Y'
#default => default -- if set, this value is inserted into the defaultvalues table for this question
#default => 既定値(設定した場合は、defaultvaluesテーブルにこの値がセットされます)
#same_default => same_default -- 'Y' for true, in which case any defaultvalue set for primary language applies to other languages
#same_default => 同一の既定値(基本言語に設定した既定値を他の言語にも当てはめる場合は'Y'


==サブ質問==
==サブ質問==

Revision as of 01:27, 4 August 2018

この機能はバージョン2.0から利用可能です。

タブ区切り形式によるアンケート構成のインポート・エクスポート

この機能は、Excel、LibreOffice、Google Docsなどのスプレッドシートソフトウェアを使用してアンケートを作成および編集することを容易にするように設計されています。SGQAコードへの依存を完全に排除します。

この機能は、拡張子が.txtのASCIIまたはUTF-8でエンコードされたタブ区切り(TSV)ファイルからのインポートをサポートします。


Check the following example to get a better understanding of this functionality.


はじめに

The easiest way is to take an existing survey and export it in Tab Separated Value format.  Use the normal export survey button, and instead of selecting .lss format, select "Tab Separated Values format (*.txt)".  It will save as an Tab Separated Value file in the proper format (tab delimited unicode file), with all the correct column headings.

タブ区切り形式をられた値をサポートするスプレッドシートソフトウェアなら何でも構いません(OpenOfficeやLibreOfficeなど)。LimeSurveyはスプレッドシート内の書式設定を無視しますが、役立つ場合は自由に追加してください。

エクスポートされたファイルは、最初の3つの隠し文字としてバイトオーダーマーク(BOM)が使われているUTF-8形式であることに注意してください。ExcelがUTF-8形式であることを認識しないため、Excelで.txtをダブルクリックしても直接開くことはできません。このファイルをExcelで開くには、まずExcelを開き、ファイル::開くを選択して.txtファイルを選択し、ExcelにUTF-8エンコーディングを使用していることを伝えます。

グループ、質問、サブ質問、および回答ごとに1つの行で表示されます。グローバルアンケート変数と言語固有のアンケート変数の行もあります。基本言語が最初にリストされ、続いて追加言語がリストされます。したがって、複数の言語がある場合は、最初に基本言語のすべての内容が表示されます(たとえば、グループ、質問、サブ質問、および回答)。追加言語の翻訳がこれに続きます(翻訳されたセットの番号と順序または行は同じです)。

行の間の関係は行の近さによって推定されます。したがって、グループに続く質問はそのグループの一部と認識されます。質問に続くサブ質問はその質問の一部であり、質問に続く回答はその質問の一部です。したがって、質問にはID(gid、qid、sqid)は必要なく、インポート時に自動的に計算されます。実際、このフォーマットでは、gid、qid、sqid(またはSGQAコード)をまったく使用しません。

ヒント

タブ区切り形式のインポート/エクスポートの目的は、スプレッドシートを使用してアンケートをすばやく設計できるようにすることです。シートをインポートし、"アンケートロジックの表示"機能を使用してシートの有効性を確認し、テストしてください。インポートするたびに、新しいアンケートが作られます。部分的に完成した多くのアンケートができるかもしれませんが、問題ありません。一番新しいものを対象にするか、新しいものをインポートした後に古いものを削除すればよいのです。タブ区切り形式でSGQAコードを使用することは決してないので、LimeSurveyがアンケート、グループ、質問、回答のキーに割り当てるコードについて心配する必要はありません。ですから、自由にインポート/エクスポートしてください。

アンケートを作成するうえで便利な方法がいくつかあります。

  1. 多くの質問に対して同じ回答を使用する。'A'の行をコピーし、同じ回答を使用する質問の後に貼り付けます。
  2. 多くの質問に対して同じサブ質問を使用する。'SQ'行をコピーして、それを必要とする質問の後に貼り付けます。
  3. "繰り返し" - 同じグループを複数回使用する。必要な回数だけグループをコピーしてください。Excelのフィルタリングを使用して(グループの)'G'行だけを表示し、Excel列のドラッグ機能を使用して各グループの出現条件の式を更新します(例:国勢調査では、最初の出現条件は"numPeople>1"、次は"numPeople>2"とします。ドラッグ機能により数字を1つずつ増やしていきます)。'Q'行でフィルタリングし、各質問に固有の値があることを確認します(例:変数g1_q1、g1_q2、g1_qNの名前をつけ、g1をg2に、2番目のグループをg3に、g3を3番目にg3に変換します)。
  4. 質問/グループの並べ替え。スプレッドシートファイルの行を並べ替えるだけです。
  5. アンケートモジュールのテスト.  長いアンケートでは、モジュールに分割してテストすることができます。モジュールごとに新しいスプレッドシートファイルを作成し、必要のない行を削除するだけです。これにより、アンケートの後の方のセクションをテストする、多くのデータを入力する必要がなくなります。
  6. 必須の質問のテスト。多くの質問を必須にする必要があるものの、テストのために必須機能をオフにしたい場合があります。必要なものを必須の設定にしてマスタースプレッドシートを作成するだけです。次に、テストするため、"必須"列を削除し、スプレッドシートのテスト版を保存します。そのバージョンをインポートすれば、質問は必須ではなくなります。テストが終了したら、マスターの方をインポートします。
  7. 既定値設定。GUIを使用するのではなく、既定値の列に任意の既定値を入力します。これは、リスト項目の既定値を設定する式(トークン属性からリストを設定するなど)のように、GUIで目的の値を入力できない場合に特に役立ちます。
  8. 翻訳。スプレッドシートのコピーを言語ごとに1つ作成します。基本言語のすべての行を含め、その下にコピー&ペーストし、ドラッグを使用して言語フィールドを目的の言語に変更します。これらを翻訳者に配布し、完了したら1つのスプレッドシートファイルに再統合します。
  9. 高度な質問属性の一括設定。すべての式が表示されるようにし(つまり、データを収集するときにその値を見ることができる)、公開時にこれらをすべて非表示にしたい場合があります。これは、スプレッドシート上でクラス='Q'と質問タイプ='*'(式)でフィルタリングし、質問ごとにalways_hideを1に設定します。同様に、アンケートを作成した後、公開統計にどの質問を表示するかを決定します。GUIで各質問を編集するのではなく、class='Q'でフィルターをかけ、統計に表示する必要のあるすべての質問に対してpublic_statistics=1を設定します。
  10. 検索して置換する。すべての質問の中でいくつかのフレーズを変更する必要がある場合、Excelの検索・置換を使用して変更することができます。同様に、変数の一括リネームを行う場合も、検索して置き換えれば可能です。正規表現ベースの検索・置換が必要な場合は、目的の列を選択してテキストエディタにコピーし、検索・置換し、スプレッドシートに列を戻します。
  11. 承認を得る。あなたが研究をしている場合、質問のテキストをレビューする委員会があるかもしれません。この目的で簡便に共有することができます。クライアントとの議論の場合も同様に使用できます。
  12. チームの同意。チーム内で質問やグループの表現や外見に同意を得る場合は、スプレッドシートをプロトタイプ化/編集し、インポートし、質問やグループのプレビューを行い、これを介してユーザーに提示される内容をチームメンバーに正確に見せることができます。そうすれば、要件を文書化して構築し、会議で承認するようなことは必要がなく、チームメンバーが会議室を後にする前にその場で承認を得ることができます。
  13. 他のアンケートフォーマットからのアップグレード。既存のアンケートがXML、Word、または他の形式である場合は、この形式にマップするための変換プロセスを作成することができます。.lss形式にマッピングすることもできますが、この形式の利点は、グループ、質問、サブ質問、回答、および既定値の間の外部キーの関係を追いかける必要がないことです。

Limitations

  1. By design, this feature only works properly for surveys that use qcode (rather than SGQA) naming.  This feature assumes that variable names (question identifiers) are unique throughout the survey. Sub-question names can be repeated, as long as they are unique within the scope of a particular question.

ファイル形式

概要

We use the same set of column headings for multiple purposes.  The first 14 columns serve different purposes depending upon the type of entity (e.g. group, question, answer).  The remaining columns are an alphabetical list of the database field names for the advanced question codes.  Below is the syntax for each entity type

最初の14列は次のとおりです。

  1. id
  2. related_id
  3. class
  4. type/scale
  5. name
  6. relevance
  7. text
  8. help
  9. language
  10. validation
  11. mandatory
  12. other
  13. default
  14. same_default

アンケートのグローバルパラメーター

アンケートテーブルには、パラメータごとに1つの行があります。

  1. class => 'S'
  2. name => データベースフィールド名
  3. text => 値

アンケートの言語固有のパラメーター

surveys_languagesettingsテーブルには、言語ごと・フィールドごとに1つの行があります。言語のすべての項目は、このテーブルに挿入する前に収集されます。

  1. class => 'SL'
  2. name => データベースフィールド名
  3. text => 値
  4. language => 言語

グループ

アンケートの言語ごと・グループごとに1行あります(例えば、アンケートに3つの言語がある場合はグループの行が3つになります)。

  1. class => 'G'
  2. name => グループ名(グループの一意の識別子)
  3. relevance => grelevance(中括弧なしのグループレベルの出現条件の式)
  4. text => 説明(言語ごとのグループの説明)
  5. language => グループの言語(例: 'en')

質問

アンケートの言語ごとに1行あります(例えば、アンケートに3つの言語がある場合は質問の行が3つになります)。質問は先行する行のグループに属しているとみなされます。

  1. id => 質問に対して一意の数値の識別子。数字1から、現在の質問に対応する他の言語の質問に同じIDを使用します。
  2. class => 'Q'
  3. type/scale => タイプ(通常1文字であらわされる質問タイプ)(例: 複数選択は'M')
  4. name => タイトル(固有の質問名でqcode命名システムで利用)
  5. relevance => 出現条件(質問に対する出現条件の式
  6. text => 質問(言語ごとの質問テキスト)
  7. help => ヘルプ(言語ごとのヘルプテキスト)
  8. language => 言語(グループの言語。例: 'en')
  9. validation => preg(質問の検証条件として使用する正規表現)
  10. mandatory => 回答必須フラグ(必須の時は'Y')
  11. other => その他(一部の質問タイプで"その他"を使用する場合'Y')
  12. default => 既定値(設定した場合は、defaultvaluesテーブルにこの値がセットされます)
  13. same_default => 同一の既定値(基本言語に設定した既定値を他の言語にも当てはめる場合は'Y')

サブ質問

One sub-question row per survey language.  Sub-questions are assumed to belong to the question that precedes them.

  1. id => same unique numeric identifier which is used for the questions. Sub-questions should use next available value, question and sub-question IDs should be different (e.g. use ID 1 for question and IDs 2, 3 and 4 for sub-questions belonging to question 1, next question ID should be 5 and so on). Use the same sub-question ID for additional languages belonging to current sub-questions.
  2. class => 'SQ'
  3. type/scale => scale_id -- 0 or 1, depending upon question type (e.g. array text will have two scales)
  4. name => title -- the "name" of the sub-question, e.g. the one used for exclude_all_others
  5. relevance => relevance -- (Future) to support sub-question-level relevance
  6. text => question -- the language-specific text of the sub-question
  7. help => help -- (Future) to support sub-question-level help
  8. language => language -- the language for the sub-question
  9. validation => preg -- (Future) to support sub-question-level regular expression validation (e.g. for address parts)
  10. mandatory => mandatory -- (Future) to support sub-question-level mandatory (e.g. make only a few sub-questions mandatory)
  11. default => default -- if set, then this is the default value for the sub-question (inserted into defaultvalues table)
  12. same_default => same_default -- if set, then the default for the primary language is  used for all other languages

回答

One answer row per survey language (e.g. there would be 3 answer rows if survey has 3 languages). Answers are assumed to belong to the question that precedes them, and be in the desired sort order.

  1. id => use the same ID as the ID of the question it belongs to
  2. class => 'A'
  3. type/scale => scale_id -- 0 or 1 (e.g. for dual-scale)
  4. name => code -- the unique answer identifier
  5. relevance => assessment_value -- if using assessment option, this is the assessment value for the answer
  6. text => answer -- the language-specific text of the answer
  7. language => language -- the language for this answer (e.g. 'en')

Assessments

One assessment row per survey language (e.g. there would be 3 assessment rows if survey has 3 languages). Assessments are written at the end of file.

  1. id => unique numeric identifier for the assessment, starting with number 1, use the same ID for additional languages belonging to current assessment
  2. related_id => id of group to which current assessment belongs to
  3. class => 'AS'
  4. type/scale => assessment scope: T-Total, G-group
  5. name => name
  6. text => message
  7. min_num_value => Minimum
  8. max_num_value => Maximum
  9. language => language -- the language for this answer (e.g. 'en')

Quotas

One row per quota. Quotas are written at the end of file.

  1. id => unique numeric identifier for the quota, starting with number 1
  2. class => 'QTA'
  3. name => quota name
  4. mandatory => limit
  5. other => quota action
  6. default => active
  7. same_default => autoload URL

Quota language settings

One quota row per survey language. Quota language settings are assumed to belong to the quota that precedes them.

  1. id => unique numeric identifier for the quota language settings, starting with number 1. Each row for different survey languages should have different IDs
  2. related_id => quota id of quota to which this setting belongs to
  3. class => 'QTALS'
  4. relevance => message
  5. text => URL
  6. help => URL description
  7. language => language -- the language for this quota (e.g. 'en')

Quota members

One row per quota member, no language dependent. Quota member row should be placed immediately after question it relates to. Quota members are assumed to belong to the question that precedes them.

  1. id => unique numeric identifier for the quota members, starting with number 1
  2. related_id => quota id of quota to which this member belongs to
  3. class => 'QTAM'
  4. name => answer code

Conditions

One row per condition, no language dependent. Condition row should be placed immediately after question it relates to. Conditions are assumed to belong to the question that precedes them.

  1. id => unique numeric identifier for the condition, starting with number 1.
  2. related_id => question id of related question, if applicable
  3. class => 'C'
  4. type/scale => scenario
  5. name => answer field name
  6. relevance => comparison operator
  7. text => expected answer