Actions

URL fields/ja: Difference between revisions

From LimeSurvey Manual

(Created page with "例:")
No edit summary
 
(60 intermediate revisions by 3 users not shown)
Line 4: Line 4:




<span id="Introduction"></span>
=はじめに=
=はじめに=


URLフィールドパラメーターは、以下のケースで使用できます。
URLフィールドパラメーターは、以下のケースで使用できます。
Line 11: Line 13:
* アンケートの開始URLフィールド
* アンケートの開始URLフィールド


<span id="End_URL_field"></span>
=終了URL=
=終了URL=


At the end of a survey or when a quota causes a survey to terminate, there is the option to set an ending URL. This URL is presented to the participant who has finished the survey on the end page or you can optionally set the participant to be automatically redirected to the respective URL. This can be done by filling in the End URL option from the [[Text elements|Survey text elements]] panel and by enabling the automatic load of the end URL from the [[Presentation]] panel once a survey is completed .


However, there are a number of fields available to be used to enhance the functionality of this URL.
アンケートの終わり、またはクオータによってアンケートが切断されるときに、終了URLを設定するオプションがあります。このURLは、最終ページでアンケートを終了した参加者に提示されるか、または設定により該当のURLに自動的にリダイレクトされるようにすることができます。利用するには、[[Text elements/ja|アンケートテキスト要素]]パネルで終了URLを入力し、[[Presentation/ja|表示]]パネルでアンケート完了時自動読込URLを有効にします。


しかし、LimeSurveyは数多くのURLフィールドを使用できるようになっており、それによりアンケートの機能を強化することができます。


==Basic fields==
アンケートのサイドメニューで「アンケート参加者」に移動し、アンケートを「クローズ型」に変更し、トークンを持つ参加者を事前に追加すると、終了URLにトークンパラメーターが追加されます。


You can use '''{SAVEDID}''', '''{TOKEN}''', '''{SID}''' and '''{LANG}''' in this URL:
<span id="Basic_fields"></span>
*'''SAVEDID''' is the id assigned to this particular submission;
==基本的なフィールド==
*'''TOKEN''' is the token used to participate in the survey;
 
*'''SID''' is the survey ID;
 
*'''LANG''' is the language code.
URLに'''{SAVEDID}''''''{TOKEN}''''''{SID}''''''{LANG}'''を使用できます。
*'''SAVEDID'''は、アンケートの投稿ごとに割り当てられるIDです。
*'''TOKEN'''は、アンケートで使用されたトークンです。
*'''SID'''は、アンケートIDです。
*'''LANG'''は、言語コードです。


例:
例:
Line 32: Line 40:
</code>
</code>


==Answer fields==


You can also use '''{INSERTANS:SGQA}'''. This URL field allows you to add the response to a specific question in the survey into the end URL. This can be useful for sending a response to an external script (ie an email address collected during the survey).
<span id="Answer_fields"></span>
==回答フィールド==


For example:
 
'''{INSERTANS:SGQA}'''、または[[ExpressionScript - Presentation/ja#Qcode.E5.A4.89.E6.95.B0.E3.81.AE.E5.91.BD.E5.90.8D|ExpressionScript変数]]を使用することもできます。このURLフィールドでは、アンケートの特定の質問に対する回答を終了URLに追加することができます。これは、外部スクリプトに回答(アンケートで収集したメールアドレスなど)を送信する場合に便利です。
 
:


<code><nowiki>
<code><nowiki>
http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}
https://www.limesurvey.org/test.php?email={EMAILADDRESS}
</nowiki></code>
</nowiki></code>


 
アンケート参加者が回答を行う際、常に新しいセッションにするには、URLに"newtest/y"を追加します。
However its important to add "newtest/y" to the URL. See this
 


<code><nowiki>
<code><nowiki>
Line 50: Line 59:
</nowiki></code>
</nowiki></code>


このURLは、 pertains to a survey with ID = 48315、group =2、question=22、answercodes = 2007 および 2008という回答と関連しています。


That URL pertains to a survey with ID = 48315, group =2, question=22 and answercodes = 2007 and 2008.
{{Note|"newtest/y"の必要性に関する詳細については、こちらの[https://www.limesurvey.org/forum/installation-a-update-issues/108334-use-case-for-not-using-newtest-y フォーラムスレッド]を参照してください。}}


(see: https://www.limesurvey.org/forum/can-i-do-this-with-limesurvey/115371-prefilling-survey-answers-using-the-survey-url-version-3)
<span id="Expressions"></span>
==式==


==Expressions==


You can also use any [[Expression Manager|Expression Manager]] expression here.
[[ExpressionScript - Presentation/ja|]]を使うこともできます。


For example:
:


<code><nowiki>
<code><nowiki>
Line 65: Line 75:
</nowiki></code>
</nowiki></code>


==Passthrough fields==


To use passhtrough fields, you have to define any additional parameters that should be passed into the end URL in the survey settings (read more about the LimeSurvey [[Panel integration|panel integration]] feature). To use such a parameter in the end URL, just insert the tag '''{PASSTHRU:<paramname>}''' where ''<paramname>'' is the name of your input parameter.
<span id="Passthrough_fields"></span>
==パススルーフィールド==
 
 
パススルーフィールドを使用するには、パネル統合で変数名を定義しなければなりません。対象となる質問を割り当てない場合、変数は回答に保存されません(詳細は、LimeSurveyの[[Panel integration/ja|パネル統合]]機能を参照)。このパラメータを終了URLで使用するには、'''{PASSTHRU:<paramname>}'''タグを挿入します。ここで、''<paramname>''は入力パラメータの名前です。


Let's suppose that you defined [[Panel integration|a parameter]] named "foobar". The survey is started with a link like
"foobar"という名前の[[Panel integration/ja|パラメーター]]を定義したとしましょう。アンケートのリンクは、次のようになります。


<code>
<code>
Line 75: Line 88:
</code>
</code>


The XYZ123 is the value you want "to pass".
XYZ123はパスされる値です。
 
<code><nowiki>http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}</nowiki></code>という終了URLが<code><nowiki>http://www.limesurvey.org/test.php?foobarout=XYZ123</nowiki></code>に変換されます。
 
<span id="Start_URL"></span>
=開始URL=
 


The end URL of a survey with the following URL <code><nowiki>http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}</nowiki></code> would then be converted to <code><nowiki>http://www.limesurvey.org/test.php?foobarout=XYZ123</nowiki></code>
<span id="Prefilling_a_survey_using_GET_parameters"></span>
==GETパラメーターを使ってアンケート回答をプリセットする==




{{Alert|title=Attention|text=Please note that the passthrough fields can be used only with LimeSurvey 2.x or later!}}
[[Question_type_-_File_upload/ja|ファイルアップロード]]や[[Question type - Equation/ja|式の質問タイプ]]以外のすべての回答を事前にセットすることができます。パラメーターに[[ExpressionScript - Presentation/ja#.E9.96.A2.E6.95.B0.E3.81.B8.E3.81.AE.E3.82.A2.E3.82.AF.E3.82.BB.E3.82.B9|qcode名]]を使用し、択一の質問タイプに値をセットするか、[[SGQA identifier/ja|SGQA識別子]]を使用することができます。


=Start URL=
回答をプリセットするには、単一選択の場合は、回答コードを使用する必要があります。複数選択の場合、回答を"チェック"するにはYを使用する必要があります。


開始URLの'''例''':


==Prefilling a survey using GET parameters==
* <code><nowiki>http://ls.example.org/1234?QTEXT=prefilled</nowiki></code> : コードがQTEXTの質問の回答として<nowiki>'prefilled'</nowiki>がセットされます。
* <code><nowiki>http://ls.example.org/1234?MULTI_SQ001=prefilled</nowiki></code> {{NewIn/ja|v=3.14.1}} : タイトルがMULTIとなっている質問のサブ質問SQ001の回答を<nowiki>'prefilled'</nowiki>とする。 (例えば複数のテキスト質問向け)
* <code><nowiki>http://ls.example.org/1234?single=-oth-&single_other=Other%20text</nowiki></code> {{NewIn/ja|v=3.14.1}} : 択一質問で「その他」をチェックし、その他に"Other text"と記入する。
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=prefilled</nowiki></code> : Fill the sub question SQ001 of question number 1 in group 1 with <nowiki>'prefilled'</nowiki>
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=prefilled</nowiki></code> : グループ1、質問番号1のサブ質問SQ001の回答として<nowiki>'prefilled'</nowiki>がセットされます。
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=A1</nowiki></code> : グループ1、質問番号1のサブ質問SQ001で回答<nowiki>'A1'</nowiki>がチェックされます。
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=Y</nowiki></code> : グループ1、質問番号1でサブ質問SQ001がチェックされます。


You can prefill all answer except upload and equation question type. You can use [[Expression Manager#Access to Variables|qcode naming]] for the parameters and set the value for single question types. For multiple question type, you must use a [[SGQA identifier]].


Then answer are set to the pre-filled value, for single choice option, you must use the code of the answer, for multi choice question, you must use Y if you want to check the answer.
{{Hint|Text=最初のGETパラメーターは"?"を使用します、それ以降のパラメータは "&"です。すでに"?"を含むURLにGETパラメータを追加するには"&"を使用する必要があります。}}
{{Hint|Text=追加のGETパラメータは、アンケートが新たに始まるときにのみ入力されます。したがって、テスト段階では、newtest=Yを追加して新たなアンケートを開始させます。例: <code><nowiki>http://ls.example.org/1234?QTEXT=prefilled&newtest=Y</nowiki></code>}}


Here are some start URL '''examples''':


* <code><nowiki>http://ls.example.org/1234?QTEXT=prefilled</nowiki></code> : Fill the question with code Q1 with <nowiki>'prefilled'</nowiki>
{{Hint|Text=追加のGETパラメーターはアンケートを新たに開始するときのみ有効です。したがって、テストの際は、常にnewtest=Yを追加して新しいアンケートを開始します。例: <code><nowiki>http://ls.example.org/1234?QTEXT=prefilled&newtest=Y</nowiki></code>}}
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=prefilled</nowiki></code> : Fill the sub question SQ001 of question number 1 in group 1 with <nowiki>'prefilled'</nowiki>
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=A1</nowiki></code> : Check the answer <nowiki>'A1'</nowiki> at the sub question SQ001 of question  number 1 in group 1 .
* <code><nowiki>http://ls.example.org/1234?1234X1X1SQ001=Y</nowiki></code> : Check the  sub question SQ001 at question  number 1 in group 1.


{{Hint|Text=GET parameters use "?" for the first parameter and "&" for the subsequent ones. If you already have "?" in your URL, you must use "&" to add more GET parameters.}}
<span id="Prefilling_a_survey_using_GET_parameters_using_URL_parameters_tab"></span>
{{Hint|Text=The extra GET parameters are only filled when the survey starts anew. Therefore, for testing, always add newtest=Y to start a fresh survey. For example: <code><nowiki>http://ls.example.org/1234?QTEXT=prefilled&newtest=Y</nowiki></code>}}
==URLパラメータータブのGETパラメーターを使用したアンケートのプリセット==




==Prefilling a survey using GET parameters using URL parameters tab==
[[Panel integration/ja|パネル統合]]で設定できるURLパラメーターを使用して、あらかじめ回答をセットすることができます。


You can prefill (sometimes easier) answers using URL parameters which can be configured in the [[Panel integration|panel integration]].


<span id="Prefilling_and_hiding_the_answer"></span>
==回答のプリセットと非表示==


==Prefilling and hiding the answer==


You can use hidden advanced settings to hide the question from your respondents. If so, the question still remains prefilled.
非表示の詳細設定を使用して、質問を回答者から見えないようにすることができます。この場合でも、質問の回答はプリセットされています。

Latest revision as of 01:23, 13 April 2024


はじめに

URLフィールドパラメーターは、以下のケースで使用できます。


終了URL

アンケートの終わり、またはクオータによってアンケートが切断されるときに、終了URLを設定するオプションがあります。このURLは、最終ページでアンケートを終了した参加者に提示されるか、または設定により該当のURLに自動的にリダイレクトされるようにすることができます。利用するには、アンケートテキスト要素パネルで終了URLを入力し、表示パネルでアンケート完了時自動読込URLを有効にします。

しかし、LimeSurveyは数多くのURLフィールドを使用できるようになっており、それによりアンケートの機能を強化することができます。

アンケートのサイドメニューで「アンケート参加者」に移動し、アンケートを「クローズ型」に変更し、トークンを持つ参加者を事前に追加すると、終了URLにトークンパラメーターが追加されます。

基本的なフィールド

URLに{SAVEDID}{TOKEN}{SID}{LANG}を使用できます。

  • SAVEDIDは、アンケートの投稿ごとに割り当てられるIDです。
  • TOKENは、アンケートで使用されたトークンです。
  • SIDは、アンケートIDです。
  • LANGは、言語コードです。

例:

http://www.limesurvey.org/test.php?var1={SAVEDID}&var2={TOKEN}&var3={SID}&lang={LANG}


回答フィールド

{INSERTANS:SGQA}、またはExpressionScript変数を使用することもできます。このURLフィールドでは、アンケートの特定の質問に対する回答を終了URLに追加することができます。これは、外部スクリプトに回答(アンケートで収集したメールアドレスなど)を送信する場合に便利です。

例:

https://www.limesurvey.org/test.php?email={EMAILADDRESS}

アンケート参加者が回答を行う際、常に新しいセッションにするには、URLに"newtest/y"を追加します。

https://exampletest.limequery.com/index.php/survey/index/sid/48315/newtest/Y?48315X2X222007=Y&48315X2X222008=Y

このURLは、 pertains to a survey with ID = 48315、group =2、question=22、answercodes = 2007 および 2008という回答と関連しています。

"newtest/y"の必要性に関する詳細については、こちらのフォーラムスレッドを参照してください。

を使うこともできます。

例:

http://www.limesurvey.org/test.php?gender={if(sex=='Male','M','F')}&name;={name}


パススルーフィールド

パススルーフィールドを使用するには、パネル統合で変数名を定義しなければなりません。対象となる質問を割り当てない場合、変数は回答に保存されません(詳細は、LimeSurveyのパネル統合機能を参照)。このパラメータを終了URLで使用するには、{PASSTHRU:<paramname>}タグを挿入します。ここで、<paramname>は入力パラメータの名前です。

"foobar"という名前のパラメーターを定義したとしましょう。アンケートのリンクは、次のようになります。

http://example.org/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123

XYZ123はパスされる値です。

http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}という終了URLがhttp://www.limesurvey.org/test.php?foobarout=XYZ123に変換されます。

開始URL

GETパラメーターを使ってアンケート回答をプリセットする

ファイルアップロード式の質問タイプ以外のすべての回答を事前にセットすることができます。パラメーターにqcode名を使用し、択一の質問タイプに値をセットするか、SGQA識別子を使用することができます。

回答をプリセットするには、単一選択の場合は、回答コードを使用する必要があります。複数選択の場合、回答を"チェック"するにはYを使用する必要があります。

開始URLの:

  • http://ls.example.org/1234?QTEXT=prefilled : コードがQTEXTの質問の回答として'prefilled'がセットされます。
  • http://ls.example.org/1234?MULTI_SQ001=prefilled (3.14.1 から追加) : タイトルがMULTIとなっている質問のサブ質問SQ001の回答を'prefilled'とする。 (例えば複数のテキスト質問向け)
  • http://ls.example.org/1234?single=-oth-&single_other=Other%20text (3.14.1 から追加) : 択一質問で「その他」をチェックし、その他に"Other text"と記入する。
  • http://ls.example.org/1234?1234X1X1SQ001=prefilled : Fill the sub question SQ001 of question number 1 in group 1 with 'prefilled'
  • http://ls.example.org/1234?1234X1X1SQ001=prefilled : グループ1、質問番号1のサブ質問SQ001の回答として'prefilled'がセットされます。
  • http://ls.example.org/1234?1234X1X1SQ001=A1 : グループ1、質問番号1のサブ質問SQ001で回答'A1'がチェックされます。
  • http://ls.example.org/1234?1234X1X1SQ001=Y : グループ1、質問番号1でサブ質問SQ001がチェックされます。


 Hint: 最初のGETパラメーターは"?"を使用します、それ以降のパラメータは "&"です。すでに"?"を含むURLにGETパラメータを追加するには"&"を使用する必要があります。
 Hint: 追加のGETパラメータは、アンケートが新たに始まるときにのみ入力されます。したがって、テスト段階では、newtest=Yを追加して新たなアンケートを開始させます。例: http://ls.example.org/1234?QTEXT=prefilled&newtest=Y


 Hint: 追加のGETパラメーターはアンケートを新たに開始するときのみ有効です。したがって、テストの際は、常にnewtest=Yを追加して新しいアンケートを開始します。例: http://ls.example.org/1234?QTEXT=prefilled&newtest=Y


URLパラメータータブのGETパラメーターを使用したアンケートのプリセット

パネル統合で設定できるURLパラメーターを使用して、あらかじめ回答をセットすることができます。


回答のプリセットと非表示

非表示の詳細設定を使用して、質問を回答者から見えないようにすることができます。この場合でも、質問の回答はプリセットされています。