Actions

タブ区切り形式のアンケート構成

From LimeSurvey Manual

Revision as of 23:45, 30 July 2018 by Bravehorse (talk | contribs) (Created page with "surveys_languagesettingsテーブルには、言語ごと・フィールドごとに1つの行があります。言語のすべての項目は、このテーブルに挿入す...")
この機能はバージョン2.0から利用可能です。

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

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

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

はじめに

最も簡単な方法は、ツールからタブ区切り値形式でエクスポートすることです。通常のアンケート出力ボタンを使用し、.lss形式を選択するのではなく、"LimeSurveyタブ区切り形式(* .txt)"を選択します。適切な書式(タブで区切られたユニコードファイル)でタブ区切り形式ファイルとして保存され、すべての正しい列見出しが付けられます。

タブ区切り形式をられた値をサポートするスプレッドシートソフトウェアなら何でも構いません(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がアンケート、グループ、質問、回答のキーに割り当てるコードについて心配する必要はありません。ですから、自由にインポート/エクスポートしてください。

Here are some convenient things you can do with this approach to authoring instruments:

  1. Use same Answers for many questions.  Just copy the 'A' rows and paste after each question that should have the same set.
  2. Use same sub-questions for many questions.  Just copy the 'SQ' rows and paste them after each question that needs it.
  3. "Looping" - use same group many times.  After the group is the way you want it, copy it as many times as needed.  Use Excel filtering to view just the 'G' rows (for groups), and use the Excel column drag feature to update the relevance equations for each group (e.g. for a census, the first relevance might be "numPeople > 1", the next should be "numPeople > 2".  The drag feature will auto-update the number).  Filter by 'Q' rows and ensure that each question has a unique value (e.g. say you name your variables g1_q1, g1_q2, g1_qN, use find/replace to convert g1 to g2 the second group; g3 for the third, etc.).
  4. Re-ordering questions/groups.  Simply re-order the rows of the spreadsheet file.
  5. Testing survey modules.  For long surveys, you may want to break up the testing into modules.  Simply create new spreadsheet files for each module, deleting any rows that you don't need. This avoids the need to enter lots of data to test later sections of the survey.
  6. Testing mandatory questions.  A common complaint is the need to make many questions mandatory, but the need to turn off the mandatory feature for testing.  Simply create the master spreadsheet with mandatory set the the final desired values.  Then, to test it, just delete the "mandatory" column and save the test version of the spreadsheet.  When you import that version, none of the questions will be mandatory.  After you have finished your testing, import the master copy.
  7. Setting defaults.  Rather than using the GUI, you can enter any desired defaults in the default column.  This is especially helpful for cases where the GUI does not let you enter the desired value, like Expressions to set the default for list items (like populating a list from a token attribute).
  8. Translation.  You can create copies of your spreadsheet - one per language.  Include all the rows for the primary language, then copy and paste them below, and use drag to change the language field to the target language.  These can be distributed to your translators, and re-integrated into a single spreadsheet file when they are done.
  9. Bulk setting of advanced question attributes.  You may want all of your equations to start visible (so you can see their values as you collect data), but then hide them all before going to production.  Simply filter the spreadsheet on class = 'Q' and question type = '*' (equation), and set always_hide to 1 for each of those questions.  Similarly, say after you create the survey, you decide which questions should appear in public statistics.  Rather than edit each question through the GUI, filter on class = 'Q', and set public_statistics = 1 for all of the questions that should be visible in statistics.
  10. Find and replace.  Say you decide you need to change some phrasing across all of your questions, you can use Excel find and replace to make those changes.  Similarly, say you decide to do a bulk-renaming of your variables, find and replace can come to the rescue.  If you need regular-expression based find and replace, you can select the desired column, copy to a text editor, do your find and replace, and paste the column back into the spreadsheet.
  11. Gaining approvals.  If you are doing research, you may have an Institutional Review board who insists upon seeing the text of the questions.  This may be a convenient way to share it.  Similarly for discussions with a client.
  12. Team consensus.  If you are trying to get a group to agree upon the wording or appearance of a question or group, you can rapidly prototype / edit the spreadsheet, import it, and show the team (via question or group preview) exactly what the users will see.  That way you can get approval from the team before they leave the room rather than having to document requirements, build them, and get approval at future meetings.
  13. Upgrading from other  survey formats.  If you have existing survey in XML, Word, or other format, you can create a translation process to map them to this format.  Although you could also try mapping to the .lss format, the advantage of this format is that it doesn't require you to keep track of foreign key relationships between groups, questions, sub-questions, answers, and defaults.

制限事項

  1. 設計上、SGQAではなくqcode名を使用するアンケートでのみ機能します。この機能では、変数名(質問の識別子)がアンケート内で一意であることを前提としています。 サブ質問名は、特定の質問の範囲内で一意である限り、同じものを使うことができます。
  2. 現状、条件(代わりに出現条件の式を使用することを前提としているため)・評価(カスタマイズを使用することを前提としているため)・クォータをインポートまたはエクスポートすることはできません。しかし、強いニーズがあれば、追加することがあるかもしれません。
  3. 現状、タブ区切り形式のエクスポート機能は、リスト型の質問の既定値をエクスポートすることはできません。

ファイル形式

概要

複数の目的のため、同じ見出しセットを使用しています。最初の14列は、エンティティの種類(グループ、質問、回答など)によって異なる目的で使用されます。残りの列は、高度な質問コードに関するデータベースフィールド名のアルファベット順のリストです。以下は、各エンティティタイプの構文です。

最初の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 => 言語

Groups

There is one row per group.

  1. class = 'G'
  2. name => group_name -- the unique identifier for the group
  3. relevance => grelevance -- the group-level relevance equation, without curly braces
  4. text => description -- the language-specific description of the group
  5. language => language -- the language for the group (e.g. 'en')

Questions

One row per question.  Questions are assumed to belong to the group that precedes them.

  1. class = 'Q'
  2. type/scale => type -- the (usually one letter) question type (e.g. 'M' is Multiple Choice)
  3. name => title -- the unique question name (the root of the qcode naming system)
  4. relevance => relevance -- the relevance equation  for the question
  5. text => question -- the language-specific text of the question
  6. help => help -- the language-specific help text
  7. language => language -- the language for the group (e.g. 'en')
  8. validation => preg -- the optional regular expression validation criteria for the question
  9. mandatory => mandatory -- 'Y' if mandatory
  10. other => other -- 'Y' if the "Other" option should be available (only for some question types)
  11. default => default -- if set, this value is inserted into the defaultvalues table for this question
  12. same_default => same_default -- 'Y' for true, in which case any defaultvalue set for primary language applies to other languages

Sub-Questions

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

  1. class = 'SQ'
  2. type/scale => scale_id -- 0 or 1, depending upon question type (e.g. array text will have two scales)
  3. name => title -- the "name" of the sub-question, e.g. the one used for exclude_all_others
  4. relevance => relevance -- (Future) to support sub-question-level relevance
  5. text => question -- the language-specific text of the sub-question
  6. help => help -- (Future) to support sub-question-level help
  7. language => language -- the language for the sub-question
  8. validation => preg -- (Future) to support sub-question-level regular expression validation (e.g. for address parts)
  9. mandatory => mandatory -- (Future) to support sub-question-level mandatory (e.g. make only a few sub-questions mandatory)
  10. default => default -- if set, then this is the default value for the sub-question (inserted into defaultvalues table)
  11. same_default => same_default -- if set, then the default for the primary language is  used for all other languages

Answers

One row per answer.  Answers are assumed to belong to the question that precedes them, and be in the desired sort order.

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