<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.limesurvey.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yohann</id>
	<title>LimeSurvey Manual - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.limesurvey.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yohann"/>
	<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/Special:Contributions/Yohann"/>
	<updated>2026-08-13T09:42:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=RemoteControl&amp;diff=2930</id>
		<title>RemoteControl</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=RemoteControl&amp;diff=2930"/>
		<updated>2009-11-27T10:27:26Z</updated>

		<summary type="html">&lt;p&gt;Yohann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey RemoteControl is a PHP:SOAP based Web service application.&lt;br /&gt;
&lt;br /&gt;
The LSRC makes it possible for developers to control specific functionality of Limesurvey from any other Application, without beeing restricted to PHP as a Programming language.&lt;br /&gt;
&lt;br /&gt;
You can start a predefined survey (change titles and things), add predefined groups or questions to this coresurvey. Activate the survey, restrict it to start and endtime, make it closed, add Participant data or just tokens when you need them (your customer just bought a book and now you want to invite him to a closed survey automatically), return the unused tokens to the main application, delete a survey, get a fieldmap for a survey, invite or remind the participants of your survey, etc...&lt;br /&gt;
&lt;br /&gt;
Be aware that this piece of code was originally written to bind LimeSurvey to a University management software in order to evaluate lectures. So there could be comments in the code or documentation, which have to do with my Company&#039;s Software or which are just a little bit confusing when you have nothing to do with University&#039;s or the German language.&lt;br /&gt;
&lt;br /&gt;
Post any comments, wishes or bugs to the [http://bugs.limesurvey.org bugtracker].&lt;br /&gt;
&lt;br /&gt;
==Files included in LSRC==&lt;br /&gt;
* lsrc.config.php (configuration variables)&lt;br /&gt;
* lsrc.server.php (the logical SOAP:Server brain. Programm logic is mainly in here )&lt;br /&gt;
* lsrc.helper.php (class LsrcHelper, this Class does the work. Mainly copied and customized from Limesurvey files. Especially for import tasks)&lt;br /&gt;
* lsrc_orig.wsdl (wsdl definition for SOAP messages. From this file the lsrc.wsdl is generated with correct paths)&lt;br /&gt;
* lsrc.testclient.php (to test the environment and functionality of the webservice on the fly)&lt;br /&gt;
&lt;br /&gt;
== Directory included==&lt;br /&gt;
* \surveys (for the core survey .csv&#039;s.) Used by sCreateSurvey.&lt;br /&gt;
* \groups (for exported group .csv&#039;s . Used by sImportGroup. There should be always an empty group for importing, so you can add questions to a new group)&lt;br /&gt;
* \questions (for exported questions .csv&#039;s. sImportFreetext and sImportMatrix depend on &amp;quot;Freitext.csv&amp;quot; and &amp;quot;Matrix5.csv&amp;quot; which should be exported questions(Freetext and Array 5 point Matrix).&lt;br /&gt;
&lt;br /&gt;
== Requirements==&lt;br /&gt;
* PHP &amp;gt;= 5.2.1 with PHP:SOAP Extension enabled&lt;br /&gt;
* libXML installed&lt;br /&gt;
* MySQL, PostgreSQL or (not recommended) MSSQL&lt;br /&gt;
* (optional) OpenSSL&lt;br /&gt;
* (optional) a Certificate for better Security&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
== How to install LSRC==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; It is included in Limesurvey since 1.80RC2, before 1.80RC4 it was called &amp;quot;japh&amp;quot; or &amp;quot;japhService&amp;quot;&lt;br /&gt;
* create a Dir &amp;quot;remotecontrol&amp;quot; in your LimeSurvey admin dir.&lt;br /&gt;
* copy the included files to the new directory.&lt;br /&gt;
&lt;br /&gt;
== How to configure LSRC==&lt;br /&gt;
* first of all you have to &#039;&#039;&#039;enable the LSRC in LimeSurveys config.php&#039;&#039;&#039; or in lsrc.config.php&lt;br /&gt;
** set the variable &#039;&#039;&#039;$enableLsrc = true&#039;&#039;&#039;;&lt;br /&gt;
* In the &#039;&#039;&#039;lsrc.config.php&#039;&#039;&#039; file, you can &#039;&#039;&#039;set all needed Variables&#039;&#039;&#039; for the LSRC in Section Variables.&lt;br /&gt;
** set the Error Handling. While configuring and testing it is very good to get all errors. If you are using lsrc in Production, you should comment error_reporting, so that it sticks to the servers defaults.&lt;br /&gt;
** $lsrcDebug, if set to true, the lsrc writes an own log. This log is helpful when implementing new features, if some function does not work, look where it hangs in this log. Should be set to false if in productive Use.&lt;br /&gt;
** $lsrcDebugLog, File where the log should be written to.&lt;br /&gt;
** ini_set(&amp;quot;log_errors&amp;quot;, &amp;quot;1&amp;quot;), Apaches log file (error.log) will get filed with php-errors. Very useful for debugging. Comment if in productive Mode.&lt;br /&gt;
** ini_set(&amp;quot;soap.wsdl_cache_enabled&amp;quot;, &amp;quot;0&amp;quot;), while testing, caching is not useful. If in productive Mode, turn this on or just comment the line to stick to server defaults.&lt;br /&gt;
** (optional) set $lsrcOverSSL to true, if you want SOAP to exchange the messages over SSL resp. https. It does not more or less than generating the target address in the wsdl with http: or https:.&lt;br /&gt;
** set the dirs, where the .csv files to import can be found. You will have to export some survey, you want to import and activate with LSRC, first.&lt;br /&gt;
** (optional) change $sLsrcSeparator = &amp;quot;your separator&amp;quot;; in lsrc.config.php if you wish to separate tokens for the sInsertToken function with any other separator than default, which is a comma.&lt;br /&gt;
** (optional) change $sDatasetSeperator= &amp;quot;your separator&amp;quot;; in lsrc.config.php if you wish to separate Datasets for the sInsertParticipants function with any other separator than default, which are two colons.&lt;br /&gt;
** (optional) change $sDatafieldSeperator= &amp;quot;your separator&amp;quot;; in lsrc.config.php if you wish to separate Datafields for the sInsertParticipants function with any other separator than default, which is a semicolon.&lt;br /&gt;
* the script needs rights to write files to the folder &amp;quot;admin/remotecontrol/&amp;quot;  (lsrc.log, if logging is used and lsrc.wsdl). if(you cannot or don&#039;t want to set the directory rights to 777){create those two files(lsrc.log and lsrc.wsdl)in the lsrc dir with the permission to write them(777))&lt;br /&gt;
* If you want to save Survey, group or question csv&#039;s directly from Limesurvey into the lsrc Folders, you need to set them to 777, too. (Option can be enabled by adding $export4lsrc = true; to Limesurveys config.php)&lt;br /&gt;
* You may have to generate a wsdl file if you need a static one. Run lsrc.server.php?wsdl and the script will make a lsrc.wsdl with the correct server url included in the lsrc directory.&lt;br /&gt;
* If auto wsdl generation do not work properly (maybe virtual hosts make Problems, please report back, if so or not so, can&#039;t test at the moment) You have to set the url of the lsrc.server.php script in the last block of the wsdl&lt;br /&gt;
&lt;br /&gt;
==How to enable OpenSSL / https Support==&lt;br /&gt;
* LSRC supports SSL over http resp. https.&lt;br /&gt;
* Your Webserver needs to support and enable OpenSSL (See your Webserver Manual)&lt;br /&gt;
* &#039;&#039;&#039;ATTENTION:&#039;&#039;&#039; Just set the Variable $lsrcOverSSL = true; in lsrc.config.php. After that, initialize your client like shown below, a wsdl file with correct URL will be generated automaticly for you:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
new SoapClient(&#039;https://localhost/limesurvey/admin/lsrc.server.php?wsdl&#039;,&lt;br /&gt;
&lt;br /&gt;
                 array(&#039;soap_version&#039; =&amp;gt; SOAP_1_1,&lt;br /&gt;
&lt;br /&gt;
                 &#039;trace&#039; =&amp;gt; 1));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &#039;ONLY FOLLOW THIS STEPS IF WSDL GENERATION DOES NOT WORK FOR YOU&#039; &amp;lt;br&amp;gt;There are two locations in the code, where you force the webservice to use https&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; 1. On the client side, when you call the SOAP-Server over wsdl. For &#039;https&#039; do it like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
new SoapClient(&#039;https://localhost/limesurvey/admin/remotecontrol/lsrc.wsdl&#039;, array(&#039;soap_version&#039; =&amp;gt; SOAP_1_1,&lt;br /&gt;
&lt;br /&gt;
                 &#039;trace&#039; =&amp;gt; 1));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; for &#039;http&#039; like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
new SoapClient(&#039;http://localhost/limesurvey/admin/remotecontrol/lsrc.wsdl&#039;, array(&#039;soap_version&#039; =&amp;gt; SOAP_1_1,&lt;br /&gt;
&lt;br /&gt;
                 &#039;trace&#039; =&amp;gt; 1));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; Note that the client will only get the wsdl-definition over https, to get the SOAP Messages over https, set the uri in the wsdl file, like below...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; 2. Here is the most important Step to SSL. At the End of the lsrc.wsdl file, last block, same procedure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;port name=&#039;LsrcPort&#039; binding=&#039;tns:LsrcBinding&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;soap:address location=&#039;https://localhost/limesurvey/admin/remotecontrol/lsrc.server.php&#039; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/port&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; or for normal http mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;port name=&#039;LsrcPort&#039; binding=&#039;tns:LsrcBinding&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;soap:address location=&#039;http://localhost/limesurvey/admin/remotecontrol/lsrc.server.php&#039; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/port&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! all request, response and fault messages will be transported over https...&lt;br /&gt;
&lt;br /&gt;
=How to use LSRC=&lt;br /&gt;
&lt;br /&gt;
==use the client==&lt;br /&gt;
&lt;br /&gt;
There is a PHPclient (from version 1.86) in the remotecontrol folder. You can use this ClientClass to control Limesurvey from within your PHP Applications with ease.&lt;br /&gt;
&lt;br /&gt;
Take a look at lsrc.testclient-new.php to get an impression of how it can be implemented.&lt;br /&gt;
&lt;br /&gt;
Basically you just have to include the class, prepare the Client and start the function calls.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* include the client class&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
include_once(&amp;quot;lsrc.client.php&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* initiate the testclient object&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
$testclient = new lsrcClient();&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* prepare the lsrcClient class (initiate the soapClient, set sid if needed)&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
$testclient-&amp;gt;prepare(333);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* set user and password (only needed, when not set in the client class directly)&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
$testclient-&amp;gt;user = &#039;admin&#039;;&lt;br /&gt;
&lt;br /&gt;
$testclient-&amp;gt;pass = &#039;password&#039;;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* set the path2wsdl (only needed, when not set in the client class directly)&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
$testclient-&amp;gt;path2wsdl = &#039;http://localhost/limesurvey/admin/remotecontrol/lsrc.server.php?wsdl&#039;;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* call the function to create a survey&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
$sReturn = $testclient-&amp;gt;createSurvey(&amp;quot;surveyName&amp;quot; , &amp;quot;surveyDescription&amp;quot;, &amp;quot;welcomeText&amp;quot;, &amp;quot;endText&amp;quot;, &amp;quot;surveyAdmins@email.adress&amp;quot;, &amp;quot;Survey Adminsname&amp;quot;, &amp;quot;http://end.url&amp;quot;, &amp;quot;Description of End Url&amp;quot;, &amp;quot;template138&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
echo $sReturn;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This Skript initiates the client. The parameter at prepare, sets the surveyId. In this case it means we are going to create the survey with the Id 333. If you do not give an id, the survey will get a random id.&lt;br /&gt;
&lt;br /&gt;
Next we set the user and password to use. You do not have to do this, as long as the inital values of the client are correct. But you may have to, if you build your app in a way, that different users use the client to create Surveys or edit them.&lt;br /&gt;
&lt;br /&gt;
In the end, the survey is created with the createSurvey Method and the return is echoed.&lt;br /&gt;
&lt;br /&gt;
==using the functions==&lt;br /&gt;
&lt;br /&gt;
You will need a SOAP- or at least RPC-Client to communicate with the LSRC Webservice. How to create such a Client depends on the programming language you use.&lt;br /&gt;
&lt;br /&gt;
The LSRC itself is written in PHP5 using the PHP:SOAP extension with SOAP 1.1.&lt;br /&gt;
&lt;br /&gt;
In PHP you would initiate the Client-object and call a function from the Webservice with code like e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$wsdl=&amp;quot;http://localhost/limesurvey/admin/remotecontrol/lsrc.server.php?wsdl&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$client = new SoapClient($wsdl, array(&#039;soap_version&#039; =&amp;gt; SOAP_1_1,&lt;br /&gt;
&lt;br /&gt;
                 &#039;trace&#039; =&amp;gt; 1));&lt;br /&gt;
&lt;br /&gt;
try&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
    $sReturn = $client-&amp;gt;sInsertToken($user, $pass, $iVid, $sToken);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
catch (SoapFault $fault)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
    $sOutput .= &amp;quot; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SOAP Error: &amp;quot;.$fault-&amp;gt;faultcode.&amp;quot; : &amp;quot;.$fault-&amp;gt;faultstring;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LSRC offers some functions:&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) means: Mandatory Parameter&lt;br /&gt;
&lt;br /&gt;
==sCreateSurvey==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;Parameters changed after 1.81+! (sVend added)&amp;lt;/span&amp;gt;&lt;br /&gt;
* String sCreateSurvey($sUser, $sPass, $iVid, $sVtit , $sVbes, $sVwel, $sVend, $sMail, $sName, $sUrl, $sUbes, $sVtyp )&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Creates a new survey. It imports an exported survey from any LS v1.xx. and changes some fields (in the current Version it changes SurveyTitle,  SurveyDescription and SurveyWelcomeText, adminemail, adminname, url and url_description to the string which was given by the client.)&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int $iVid, SurveyID desired ID for the Survey, make sure it doesn&#039;t already exist in LimeSurvey&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string $sVtit, SurveyTitle, should be the (Nr +)Name of the Event to be evaluated&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string $sVbes, Survey Description, This should be String put together with veransttyp + doztitle + dozname&lt;br /&gt;
*** string $sVwel, Survey Welcometext, A text shown before the survey starts. If not given it says: &amp;quot;Herzlich Willkommen zur Evaluation von &amp;quot;$sVtit&amp;quot;&lt;br /&gt;
*** string $sVend, Survey Endtext, Text shown at the endpage.&lt;br /&gt;
*** string $sMail, Admin Email, Email Adress of the responsible person for this survey&lt;br /&gt;
*** string $sName, Name of the responsible person for this survey&lt;br /&gt;
*** string $sUrl, Url of the Link, shown on the last page of survey.&lt;br /&gt;
*** string $sUbes, Description String of the URL above. ( &amp;lt;a href=&#039;$sUrl&#039;&amp;gt;$sUbes&amp;lt;/a&amp;gt; )&lt;br /&gt;
*** string $sVtyp, The type of Event that should be evaluated. Use in combination with sAvailableModules with $mode=&#039;core&#039; to get all available &amp;quot;types&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns the SurveyID from the created survey&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;SurveyID already exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Mandatory Parameters missing&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Import went wrong somehow&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** Goto line 714 in lsrc.helper.php to see what can be done and customized while importing.&lt;br /&gt;
*** If you want Limesurvey to give your Survey a random Number if the given ID exist (because you do not need a specific identification for your surveys), just go into the function sCreateSurvey in lsrc.server.php and delete or comment out the if($lsrcHelper-&amp;gt;surveyExists($iVid)) clause. In Result, Limesurvey will give your survey a random ID when the given ID exists.&lt;br /&gt;
&lt;br /&gt;
==sActivateSurvey==&lt;br /&gt;
* String &#039;&#039;&#039;sActivateSurvey&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, date start, date end)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Activates an existing survey and set start and enddate optional&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the SurveyID for the Survey to activate.&lt;br /&gt;
*** date start, date for the Survey to start. 2008-10-22 means it starts exactly at 2008-10-22 00:00:00 Servertime&lt;br /&gt;
*** date end, date for the Survey to end. 2008-10-22 means it ends exactly at 2008-10-22 23:59:59 Servertime. Nobody can access nor complete the Survey only a second later.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns the SurveyID from the activated survey&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Survey you want to activate does not exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Mandatory Parameters missing&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Activation went wrong somehow&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** You can set startDate and/or endDate after activation if needed. Just run the function again with desired parameters.&lt;br /&gt;
&lt;br /&gt;
==sImportGroup==&lt;br /&gt;
* String &#039;&#039;&#039;sImportGroup&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, String Module, String groupName, String groupDescription)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Imports an exported group file (.csv) to the Survey given by SurveyID&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the SurveyID&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string Module, the filename of the Group you want to add to the Survey. Use sAvailableModules to get the available groups.&lt;br /&gt;
*** string groupName, the Title the Group gets. If not set, it will use the title given in the .csv.&lt;br /&gt;
*** string groupDescription, Description of the group. If not set, it will use the description given in the .csv.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns the String &amp;quot;Import OK&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;You have no right to change Surveys from other people&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Survey Module $sMod does not exist&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Group does not support Surveys Baselanguage ($langcode)&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** It imports only exported groups as .csv which lay under \groups or any other dir given in lsrc.config.php&lt;br /&gt;
*** &amp;lt;strike&amp;gt;It imports only the files beginning with &amp;quot;mod_&amp;quot; ending with &amp;quot;.csv&amp;quot;&amp;lt;/strike&amp;gt;&lt;br /&gt;
*** The Param Module must only contain the &amp;quot;name of the Module&amp;quot;: Only the String before &amp;quot;.csv&amp;quot;&lt;br /&gt;
*** The baselanguage of the group to import, have to match the baselanguage of the coresurvey.&lt;br /&gt;
&lt;br /&gt;
==sImportQuestion==&lt;br /&gt;
* String &#039;&#039;&#039;sImportQuestion&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, String Module, String mandatory)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Imports an exported question file (.csv) to the last group of the Survey given by SurveyID. This is meant for predefined questions stored in the /question directory&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the SurveyID&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) String Module, the name of the csv file you want to add to the Survey, without extension(.csv).&lt;br /&gt;
*** String mandatory, default=&#039;N&#039; set to &#039;Y&#039; if you want that question mandatory&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns the String &amp;quot;OK&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;You have no right to change Surveys from other people&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Group does not support Surveys Baselanguage ($langcode)&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** It imports only exported questions as .csv which lay under \questions or any dir given in lsrc.config.php&lt;br /&gt;
*** The baselanguage of the question to import, have to match the baselanguage of the core survey.&lt;br /&gt;
&lt;br /&gt;
==sImportFreetext==&lt;br /&gt;
* String &#039;&#039;&#039;sImportFreetext&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, String questionTitle, String questionText, String questionhelp, String module=&#039;freitext&#039;, string mandatory)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Imports an exported question file (.csv) to the last Group of the survey given by SurveyID and changes the Title, question and helptext. This is meant for importing empty question.csv&#039;s (Text Questions)&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the SurveyID&lt;br /&gt;
*** String questionTitle, Name or Categorie of the Question&lt;br /&gt;
*** String questionText, The Question itself&lt;br /&gt;
*** String questionhelp, A little Help text for better understanding of the Question&lt;br /&gt;
*** String module, the name of the Module you want to add to the Survey. It should be &amp;quot;Freitext&amp;quot; by default.&lt;br /&gt;
*** String mandatory, make the question mandatory by giving &#039;Y&#039; as this param.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns the String &amp;quot;OK&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;You have no right to change Surveys from other people&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Group does not support Surveys Baselanguage ($langcode)&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** It imports only exported questions as .csv which lay under \questions or any dir given in lsrc.config.php&lt;br /&gt;
*** It is meant for importing one shortext, Longtext or Hugetext Question and changing the Question and Helptext.&lt;br /&gt;
*** The baselanguage of the question to import, have to match the baselanguage of the core survey.&lt;br /&gt;
*** Be sure to have at least one proper .csv (Freitext.csv) in the proper directory (questions), to use this function.&lt;br /&gt;
*** Use sAvailableModules with mode=&#039;que&#039; to get all question .csv&#039;s available.&lt;br /&gt;
&lt;br /&gt;
==sImportMatrix==&lt;br /&gt;
* String &#039;&#039;&#039;sImportMatrix&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, String Module, String questionText, String questionhelp, String questionItems)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Imports an exported question file (Matrix5.csv) to the Survey given by SurveyID and changes the question, helptext and gives Items to the 5 Scale Matrix. This is meant for importing one 5 Scale Matrix Question.&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the SurveyID&lt;br /&gt;
*** string Module, the name of the Module you want to add to the Survey. It should be &amp;quot;Matrix&amp;quot; by default.&lt;br /&gt;
*** String questionText, the question or text to the Matrix&lt;br /&gt;
*** String questionhelp, the help text&lt;br /&gt;
*** String questionItems, the Items that should be rated, separated by commas&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns the String &amp;quot;OK&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Group does not support Surveys Baselanguage ($langcode)&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** It imports only exported groups as .csv which lay under docs\demosurveys\studiply_mod&lt;br /&gt;
*** It is meant for importing a group with only one 5 Scale Matrix Question and changing the Question and Helptext and add Items.&lt;br /&gt;
*** Be sure to use an user with the surveys baselanguage as default, because this language is used to fill the language fields for answers and questions while importing.&lt;br /&gt;
&lt;br /&gt;
==sAvailableModules==&lt;br /&gt;
* String &#039;&#039;&#039;sAvailableModules&#039;&#039;&#039;(string USER, string PASSWORD, string mode)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Returning all the csv Names of the csv&#039;s in the Directorys configured in lsrc.config.php&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** String mode, (optional) &amp;quot;mod&amp;quot; for the available groups, &amp;quot;core&amp;quot; for the coreSurveys, &amp;quot;que&amp;quot; for addable questions. Default, when not given is &amp;quot;mod&amp;quot;.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went fine, it returns a String with all surveys, groups or questions (depends on mode) in the Dir given in lsrc.config.php, separated by comma.&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==sSendEmail==&lt;br /&gt;
* String sSendEmail($sUser, $sPass, $surveyID, $type, $maxLsrcEmails=&#039;&#039;, $subject=&#039;&#039;, $emailText=&#039;&#039;)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: sends Emails to Participants of a particular survey&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Useraccount with appropriate rights&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int surveyID, Id of the survey from which participants will be mailed&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string type, the kind of email you like to send (invite, remind or custom)&lt;br /&gt;
*** int $maxLsrcEmails, if you want to override $maxemails setting in config.php for sending mails with lsrc: here you go.&lt;br /&gt;
*** string subject, only needed if type==custom, the subject for the mail to be send.&lt;br /&gt;
*** string emailText, only needed if type==custom, the text for the mail to be send.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** &amp;quot;X Mails send&amp;quot; or &amp;quot;No Mails to send&amp;quot; in custom mode.&lt;br /&gt;
*** &amp;quot;X Mails send. X Mails left to send&amp;quot; or &amp;quot;No Mails to send&amp;quot; in invite mode.&lt;br /&gt;
*** &amp;quot;X Reminders send. X Reminders left to send&amp;quot; or &amp;quot;No Reminders to send&amp;quot; in remind mode.&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Mandatory Parameters missing&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Type: &amp;quot;, &amp;quot;Wrong send Type given. Possible types are: custom, invite or remind&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** invite: When $maxemails is set the function sends only $maxemails in one go. If you call it again, it will go on to send the invitations, until everyone is invited.&lt;br /&gt;
*** remind: When $maxemails is set, it will only send $maxemails in one go. It checks if reminders have been send to other participants and if there are participants who received less reminders than others, the script will first send reminders to those who have not been reminded so often, until the remindercount is equal.&lt;br /&gt;
*** custom: $maxemails have no effect in custom mode. I have no solution for counting those who have been mailed before.&lt;br /&gt;
&lt;br /&gt;
==sInsertToken==&lt;br /&gt;
* String &#039;&#039;&#039;sInsertToken&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, string Token)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Creates and populates a table {dbprefix}token_{SurveyID} and thus &amp;quot;closes&amp;quot; the survey. It is possible to add tokens to the existing table.&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, ID of the survey to close with a token table&lt;br /&gt;
*** string Token, a string with comma separated tokens. There is a possibility to set any other separator in config.php. Max. tested length of a string was 500,000 tokens, that makes a String of 5,500,000 Chars,  this is just the limit of the apache webserver on my notebook (CoreDuo 1,6MHz, 1GB Ram) with default Resource Limits (60,60,16). I recommend to send max. 100,000 tokens over the webservice. Repeat for more tokens.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Admin-, Superadmin- or Useraccount with the rights to create and activate Surveys&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went ok, it returns the String: &amp;quot;[X] Token given, [X] Token inserted&amp;quot;&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Survey does not exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Token could not be inserted&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** Make sure on the client side that no token appears twice in the table. There is no check on this and won&#039;t be in the future. What happens if there are two same tokens? 2 participants will get the same token, one will fill out the form for both, and the other will get a message: &amp;quot;your token have already participated&amp;quot;&lt;br /&gt;
*** If there is no token table, it will create one and add the tokens.&lt;br /&gt;
*** If the Tokentable already exists, it just adds the given tokens to the existing table.&lt;br /&gt;
&lt;br /&gt;
==sInsertParticipants==&lt;br /&gt;
* String &#039;&#039;&#039;sInsertParticipants&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, string ParticipantData)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Creates and populates a table {dbprefix}token_{SurveyID} and thus &amp;quot;closes&amp;quot; the survey. You can deliver some data to the token table. If you do not support a token, or an empty String as token, a unique token will be generated for the participant.&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, ID of the survey to close with a token table&lt;br /&gt;
*** string ParticipantData, The Data have to be in the right Syntax, it&#039;s like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FIRSTNAME;LASTNAME;EMAIL;ATTRIB1;ATTRIB2;TOKEN::FIRSTNAME;LASTNAME;EMAIL;ATTRIB1;ATTRIB2;TOKEN&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: The Data Syntax change with 1.86&#039;&#039;&#039;. in order to take language, validfrom, validuntil and a variable count of attributes.&lt;br /&gt;
&lt;br /&gt;
With 1.86 and later versions, it will have to be like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FIRSTNAME;LASTNAME;EMAIL;LANGUAGE;TOKEN;VALIDFROM;VALIDUNTIL;attribute1,attribute2,attribute3::FIRSTNAME ... etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
note that the 8th field is the attributes field. There is no 9th field. You can seperate many attributes with a colon (,). The lsrc will create the needed fields in the db if they are not present. All Fields after LANGUAGE are optional and do not have to be send.&lt;br /&gt;
&lt;br /&gt;
seperate the Datasets with double colons (::) and the fields with semicolon (;). The &#039;&#039;&#039;attrib1, attrib2 and token fields are optional&#039;&#039;&#039;, you can just leave them out if not used. Note that the attrib field will get empty and not NULL, by now there where no complications, inform us, if you see some difficulties in not setting them NULL. Max. successfully tested length of a string was 3,000,000 Chars, this is just the limit of the apache webserver on my notebook (CoreDuo 1,6MHz, 1GB Ram) with default Resource Limits (60,60,16). I recommend to send max. 10,000 Datasets over the webservice at once(~1,000,000 chars). Repeat for more Datasets.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Admin-, Superadmin- or Useraccount with the rights to create and activate Surveys&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** if everything went ok, it returns the String: &amp;quot;[X] Datasets given, [X] rows inserted. &amp;quot;;&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;No SurveyId given&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Survey does not exists&amp;quot;);&lt;br /&gt;
** &#039;&#039;&#039;Note&#039;&#039;&#039;:&lt;br /&gt;
*** default tokenlength is 5 chars, if you want to change the length, goto lsrc.server.php, line 441&lt;br /&gt;
*** If the token table does not exists, it will be created, and if it does, the data will be added.&lt;br /&gt;
&lt;br /&gt;
==sTokenReturn==&lt;br /&gt;
* string return &#039;&#039;&#039;sTokenReturn&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Gives back all Tokens, which did not complete the Survey, in a String seperated by commas.&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the ID for the Survey from which you want get the unused tokens&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Admin-, Superadmin- or Useraccount with the rights to create and activate Surveys&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** Returns a String, a string of all unused tokens seperated by comma.&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Survey does not exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;No SurveyId given&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Token table for this Survey does not exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;No unused Tokens found&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
==sGetFieldmap==&lt;br /&gt;
* string return &#039;&#039;&#039;sGetFieldmap&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: Gives back the fieldmap for the survey&lt;br /&gt;
&lt;br /&gt;
for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;fieldname&amp;quot;,&amp;quot;type&amp;quot;,&amp;quot;sid&amp;quot;,&amp;quot;gid&amp;quot;,&amp;quot;qid&amp;quot;,&amp;quot;aid&amp;quot;,&amp;quot;title&amp;quot;,&amp;quot;question&amp;quot;,&amp;quot;group_name&amp;quot;,&amp;quot;lid&amp;quot;,&amp;quot;lid1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;111X779X39801&amp;quot;,&amp;quot;F&amp;quot;,&amp;quot;111&amp;quot;,&amp;quot;779&amp;quot;,&amp;quot;3980&amp;quot;,&amp;quot;1&amp;quot;,&amp;quot;1&amp;quot;,&amp;quot;How do you feel?&amp;quot;,&amp;quot;Paticipant feelings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;111X779X39802&amp;quot;,&amp;quot;M&amp;quot;,&amp;quot;111&amp;quot;,&amp;quot;779&amp;quot;,&amp;quot;3980&amp;quot;,&amp;quot;2&amp;quot;,&amp;quot;1a&amp;quot;,&amp;quot;Why do you feel like this?&amp;quot;,&amp;quot;Paticipant feelings&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;:&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) int SurveyID, the ID for the Survey from which you want to get the Fieldmap.&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string USER, this have to be an existing Admin-, Superadmin- or Useraccount with the rights to create and activate Surveys&lt;br /&gt;
*** (&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;m&amp;lt;/span&amp;gt;) string PASSWORD, this has to match the password for the account.&lt;br /&gt;
** &#039;&#039;&#039;Returns&#039;&#039;&#039;:&lt;br /&gt;
*** Returns a String, a string of the fieldmap, seperated by comma and blanks&lt;br /&gt;
** &#039;&#039;&#039;Possible Faults&#039;&#039;&#039;:&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;You have no right to get fieldmaps from other peoples Surveys&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Survey does not exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;No SurveyId given&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
==fSendStatistic==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;&#039;&#039;(since 1.86)&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;fSendStatistic&#039;&#039;&#039;(string USER, string PASSWORD, int SurveyID, string Email, string doctype, string graph)&lt;br /&gt;
** &#039;&#039;&#039;Purpose&#039;&#039;&#039;: sends an Statistic File as Attachment&lt;br /&gt;
** &#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
*** user: Limesurvey user&lt;br /&gt;
*** password: Limesurvey Password&lt;br /&gt;
*** surveyId: ID of the survey from which statistics should be generated&lt;br /&gt;
*** email: the adress to which the statistic file is send&lt;br /&gt;
*** doctype: pdf, xls or html. With pdf or xls, the recipient gets an attached file with a short notice. With html, he gets an html e-mail without attachments&lt;br /&gt;
*** graph: turn graph generation on or off. Works only with pdf generation. Use &#039;1&#039; as a string if you want to enable it&lt;br /&gt;
** &#039;&#039;&#039;returns&#039;&#039;&#039;&lt;br /&gt;
*** string: &#039;XLS send&#039;&lt;br /&gt;
*** string: &#039;PDF send&#039;&lt;br /&gt;
*** string: &#039;HTML send&#039;&lt;br /&gt;
** &#039;&#039;&#039;possible Faults&#039;&#039;&#039;&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Server: &amp;quot;, &amp;quot;Mandatory Parameters missing&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;User or password wrong&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Authentication: &amp;quot;, &amp;quot;You have no right to send statistics from other peoples Surveys&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Database: &amp;quot;, &amp;quot;Survey does not exists&amp;quot;);&lt;br /&gt;
***  throw new SoapFault(&amp;quot;Mail System&amp;quot;, &amp;quot;Mail could not be send! Check your E-Mail Settings.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
For testing purposes, we made a testclient in php. Therefore you need a webserver to run it. If you test on one machine you need nothing to do, you can go to http://localhost/limesurvey/admin/lsrc/lsrc.testclient.php in your browser to test the webservices functionality.&lt;br /&gt;
&lt;br /&gt;
Of Course this is very boring, because the apache talks with himself (and thats not the matter of a webservice).&lt;br /&gt;
&lt;br /&gt;
The Testclient have two purposes:&lt;br /&gt;
&lt;br /&gt;
1. It checks the Server(the one the testclient is running on!) for the PHP:SOAP Extension and installed libXML version and gives feedback if the enviroment does support SOAP via PHP:SOAP. This is very useful to check your Server and your Client towards PHP:SOAP compatibility. In addition to this, it will check if the wsdl file you want to connect to exists, it does not validate the wsdl file.&lt;br /&gt;
&lt;br /&gt;
2. You can test the functions of the webservice.&lt;br /&gt;
&lt;br /&gt;
If you test the webservice in realistic enviroment (two machines) you have to customize three things&lt;br /&gt;
* the lsrc.testclient.php needs to be on the machine where the webservice is NOT running, but it needs a webserver... download xampp from apachefriends if you dont have one &amp;lt;strike&amp;gt;(caution for Linux Users: you have to compile PHP5 with SOAP and enable the extension, futhermore you have to install libXML2. Last thing can by done very easy via Synaptics or apt-get)&amp;lt;/strike&amp;gt; xampp for Linux works well with SOAP and libXML from version 1.7.&lt;br /&gt;
* this Line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$limeUrl=&#039;https://localhost/limesource/limesurvey&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the beginning of lsrc.testclient.php needs to fit the target Limesurvey Installation Dir. localhost for servername is always wrong in this testcase, 127.0.0.1, too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTES&#039;&#039;&#039;:&lt;br /&gt;
* The Testclient is configured to use &amp;quot;admin&amp;quot; &amp;quot;password&amp;quot; as authentication. If you want to test with another user or password you have to change this vars in lsrc.client.php (between lines 20 and 30)&lt;br /&gt;
* If you just get a blank page on the testclient, make sure the path to the wsdl in the lsrc.client.php class is correct, and the var $enableLsrc is set to true in config.php or lsrc.config.php&lt;br /&gt;
&lt;br /&gt;
=Notes=&lt;br /&gt;
* Security is enhanced: no action without permission (as good as Limesurveys Security itself --&amp;gt; very good)&lt;br /&gt;
* No headers or &amp;quot;Quick and Dirtys&amp;quot; anymore, no Scripts, just functions and a class.&lt;br /&gt;
* All configuration Variables are stored in lsrc.config.php by now&lt;br /&gt;
* There is a debug functionality, showing where the script runs through the code in an own log file. Use Apaches error.log in addition to find errors if you got any.&lt;br /&gt;
* LSRC is part of LimeSurvey, therefore it stands under GNU/GPL License v2 or later.&lt;br /&gt;
* SOAP Services and therefore LSRC only support UTF-8 charsets.&lt;br /&gt;
* LSRC works with AdoDB (MySql,Postgresql, MSSQL) .&lt;br /&gt;
* LSRC is tested, but under steady development, use on your own risk, test the functions before using them productively!&lt;br /&gt;
&lt;br /&gt;
=Changes=&lt;br /&gt;
&lt;br /&gt;
1.86&lt;br /&gt;
* new function fSendStatistics: to send statistics as attachment to an e-mail-address&lt;br /&gt;
* Datasyntax for sInsertParticipants changed in order to take validfrom, validuntil, language and a variable Set of attributes.&lt;br /&gt;
&lt;br /&gt;
1.85&lt;br /&gt;
* Several improvements to stability.&lt;br /&gt;
&lt;br /&gt;
1.82&lt;br /&gt;
* Added sVend Parameter to sCreateSurvey, to set the endtext&lt;br /&gt;
* sInsertParticipants takes a token in the dataset, however, if non is supported, it will be generated.&lt;br /&gt;
* a new variable $enableLsrc is introduced to enable the Lsrc only when it is used.&lt;br /&gt;
* a serious exploit has been fixed.&lt;br /&gt;
&lt;br /&gt;
1.81&lt;br /&gt;
* Added sGetFieldmap function.&lt;br /&gt;
* The template.csv&#039;s changed.&lt;br /&gt;
* exported csv&#039;s prior 1.81 will not import over lsrc anymore. Import them via Browser and export them back to lsrc.&lt;br /&gt;
&lt;br /&gt;
1.80 =&amp;gt; 1.81&lt;br /&gt;
* Changed sImportGroup: imports &#039;&#039;&#039;all&#039;&#039;&#039; groups under $modDir, adds them to the survey. Not only the ones with mod_ as prefix. In addition, you can give Name and Description of the Group.&lt;br /&gt;
* New sImportQuestion: imports questions in $queDir and adds them to the last group&lt;br /&gt;
* New sImportFreetext: imports a Freetext question and changes the title and question to the Strings given. Previously, this function was called sImportQuestion.&lt;br /&gt;
* Changed sAvailableModules: type can be core, mod or que. &amp;quot;que&amp;quot; is new and gives back the names of all the questions available.&lt;br /&gt;
* New sSendEmail: send invitations, reminders and custom mails to participants of a survey over Limesurvey.&lt;br /&gt;
&lt;br /&gt;
=ToDo / ToCome=&lt;br /&gt;
* &amp;lt;strike&amp;gt;sInsertParticipants should take a lang attribute for each participant&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
please add your feature requests to the [http://bugs.limesurvey.org bugtracker] if it is not listed here...&lt;br /&gt;
&lt;br /&gt;
=Known Bugs (and workarounds)=&lt;br /&gt;
* With PHP 5.3.0, the testclient have problems to read the generated wsdl from lsrc.server.php?wsdl. You have to generate it an use the static file to test it.&lt;br /&gt;
* Surveys get not imported in 1.85, due to a bug. The bug is fixed and will be released with the next release. Talk to rakete if you need it earlier...&lt;br /&gt;
* exported csv&#039;s prior 1.81 will not import over lsrc anymore. Import them via Browser and export them back to lsrc to get them work again. (attributes moved from survey to survey_languagesettings)&lt;br /&gt;
* sInsertPaticipants and sInsertToken function: You should note, that in case of an Seperator at the beginning or the end of the Datastring, the return Message will recognize one more given Dataset or Token as inserted into the db...&lt;br /&gt;
* There is a bug with Webservices in general: Sometimes (~ 1 of 10.000 Cases) you will get an error message like &amp;quot;function &#039;anyFunction&#039; does not exist on the server&amp;quot; or similar, altough everything is fine. Just wait a few Moments, clear you cache, phone your mom (she will be happy to hear from you ;)) and try again.&lt;br /&gt;
* Webservice will not work if the &amp;quot;install&amp;quot; dir is not renamed or deleted in limesurvey and $debug is not set to 2 -&amp;gt; &amp;quot;looks like we got no xml document&amp;quot; without errorlogs&lt;br /&gt;
&lt;br /&gt;
please add your bug report to the [http://bugs.limesurvey.org bugtracker] if you found an Issue that is not listed here.&lt;br /&gt;
&lt;br /&gt;
=Security=&lt;br /&gt;
&lt;br /&gt;
There have been a security hole in the versions prior 1.82 (1.80RC2 to 1.81+). This leak could be used to compromise your webspace if it is weakly configured.&lt;br /&gt;
&lt;br /&gt;
To minimise the risk of a security leak endanger your system, we disabled the lsrc by default with version 1.82 and you have to enable it explicity in your config.php.&lt;br /&gt;
&lt;br /&gt;
Some things you can do to improve your security when using the lsrc:&lt;br /&gt;
* instead of setting the remotecontrol folder to 777, just create an empty file lsrc.wsdl with the rights 777&lt;br /&gt;
* disable the lsrc.log in lsrc.config.php&lt;br /&gt;
* Do not set the survey, groups, questions folders to 777 for saving lsrc templates directly within Limesurvey, instead, save the .csv on your local PC and upload them via ftp to the folders.&lt;br /&gt;
* delete lsrc.testclient.php, when in productive use. Lsrc.testclient.php could be used from unauthorized people to perform portscanning on other machines. The attacked webserver would be seeing your webserver as attacker, altough you did not perform any attack by yourself. This is not so serious, as this bahaviour of the testclient is not much valuable for any serious hacker.&lt;/div&gt;</summary>
		<author><name>Yohann</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Questions_-_introduction&amp;diff=900</id>
		<title>Questions - introduction</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Questions_-_introduction&amp;diff=900"/>
		<updated>2009-11-17T11:27:25Z</updated>

		<summary type="html">&lt;p&gt;Yohann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
Once you have [[Creating a new group|created your groups]], you can start adding questions within each group. Create a new question by clicking on the add icon [[File:add.png]] on the right hand side of the &amp;quot;Group&amp;quot; menu bar.&lt;br /&gt;
&lt;br /&gt;
When adding a question, you will be asked for a &amp;quot;Question Code&amp;quot;, the &amp;quot;Question&amp;quot;, &amp;quot;Help&amp;quot; and a &amp;quot;(Question Types|question type)&amp;quot;. All new questions are assigned to the Group you were viewing when you clicked &amp;quot;Add Question&amp;quot;, however you can change the group the question belongs too at a later point.&lt;br /&gt;
&lt;br /&gt;
=Field descriptions=&lt;br /&gt;
*&#039;&#039;&#039;Question code:&#039;&#039;&#039; Your ID, or number or code for the question. This field is only for quick identification for a question in export or for evaluation. Try to be consistent with your coding in this field. Planning makes your evaluation a lot easier at a later time. This field is normally not displayed to people taking the survey.&lt;br /&gt;
*&#039;&#039;&#039;Question:&#039;&#039;&#039; This is the actual question being asked. There is no real limit to the length of the question here, however if you want to explain the question, leave that for the &amp;quot;Help&amp;quot; field. HTML-code can be used, e.g., for including images:&amp;lt;br/&amp;gt;&amp;lt;img src=&amp;quot;http://www.yourdomain.com/yourpics/pic.jpg&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Help:&#039;&#039;&#039; This is an optional field. It is useful if a question needs some explanation, or you want to explain how it should be answered. When you put text in this field, a &amp;quot;Question Mark&amp;quot; icon appears on the survey entry screens with the help text right beside.&lt;br /&gt;
*&#039;&#039;&#039;Question type:&#039;&#039;&#039; This determines the type of response the survey allows. View the [[Question types]] section for a description of the various options available.&lt;br /&gt;
*&#039;&#039;&#039;Label set:&#039;&#039;&#039; For some question types you can choose a set of labels. Only label sets are shown that at least contain labels in the base language of the survey.&lt;br /&gt;
*&#039;&#039;&#039;Validation:&#039;&#039;&#039; This feature is available on all free text type questions (&amp;quot;Short Free Text&amp;quot;, &amp;quot;Long Free Text&amp;quot;, &amp;quot;Date&amp;quot; or &amp;quot;Numerical&amp;quot;). You can use standard [[Using regular expressions|Regular Expressions]] in this field to validate the responses to the question, and if the responses don&#039;t validate against this expression, the user will be prompted to try again before they can progress.&lt;br /&gt;
*&#039;&#039;&#039;Other?:&#039;&#039;&#039; Depending upon your chosen &#039;question type&#039; this option may appear. It allows you to specify that an &amp;quot;other&amp;quot; option be presented in some of the list question types.&lt;br /&gt;
*&#039;&#039;&#039;Mandatory?:&#039;&#039;&#039; For all question types, except the text ones, this setting allows you to require users to answer the question, before they can move on to the next question. For ranking question this means all items have to be ranked.&lt;br /&gt;
*&#039;&#039;&#039;Question attributes:&#039;&#039;&#039; Find out more under [[Question attributes]]&amp;lt;br/&amp;gt;Note: Adding a question attribute will loose any modifications to the questions if they have not been recorded yet by pressing the &amp;quot;Update Question&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=Importing a question=&lt;br /&gt;
&lt;br /&gt;
At the bottom of the New Question Form you will find a file selection box to import a question file. Here you can import any question file (*.csv) you previously exported - for example this is useful if you want to reuse a question from another survey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Important: If you import a question there will always be a new question created. The original question will not be overwritten. If you want to copy a question inside the same survey it is easier to use the [[Copy Question]] function.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Information from tokens table=&lt;br /&gt;
&lt;br /&gt;
You can insert information/text from the tokens table into your question so that it can show context related information. For LimeSurvey to do this, the survey needs to be set as NOT Anonymous (ie: tracked), and it needs to have a tokens table.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;The fields available for this are:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|{TOKEN:FIRSTNAME}||inserts the value from the &amp;quot;firstname&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||inserts the value from the &amp;quot;lastname&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||inserts the value from the &amp;quot;email&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||inserts the value from the &amp;quot;attribute_1&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||inserts the value from the &amp;quot;attribute_2&amp;quot; field in the tokens table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To use this functionality you must type the field text into your question exactly as listed above. For example, if Attribute 1 contains either &#039;worker&#039; or &#039;boss&#039;, one could personalise a question:&lt;br /&gt;
&lt;br /&gt;
Hello {TOKEN:FIRSTNAME}. We sent an email to you using this address {TOKEN:EMAIL}. Is this correct?&lt;br /&gt;
&lt;br /&gt;
another example with more customisation, but using javascript:&lt;br /&gt;
&lt;br /&gt;
see [[Optional settings |Optional settings]] on how to allow javascript for building the questions and why it&#039;s not always a good idea.&lt;br /&gt;
&lt;br /&gt;
then turn off $filterxsshtml in your config file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;Hello {TOKEN:FIRSTNAME}. We sent an email to you using this address {TOKEN:EMAIL}. Is this correct?&lt;br /&gt;
&lt;br /&gt;
What do you as a {TOKEN:ATTRIBUTE_1} think about your&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;Javascript&amp;quot;&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var job=&#039;{TOKEN:ATTRIBUTE_1}&#039;;&lt;br /&gt;
&lt;br /&gt;
   if (job==&#039;worker&#039;) {&lt;br /&gt;
&lt;br /&gt;
      document.write (&#039;bosses&#039;)&lt;br /&gt;
&lt;br /&gt;
   } else {&lt;br /&gt;
&lt;br /&gt;
      document.write(&#039;workers&#039;)&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
?&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Information from previous answers=&lt;br /&gt;
&lt;br /&gt;
There is currently also the capacity to insert the answer of previous questions into the text of an answer with the following provisos:&lt;br /&gt;
**The question must have been answered in a previously displayed &#039;&#039;&#039;page&#039;&#039;&#039; in the survey - answers to questions on the current page are not available&lt;br /&gt;
**You refer to the exact Survey ID, Group ID and Question ID for the question to which the answer was made - in the form: {INSERTANS:SIDXGIDXQID} - ie {INSERTANS:1X2X3}. Read more under [[SGQA identifier]] to find out how to create this code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Important: The capacity to use perviously provided answers in questions is currently only considered &amp;quot;proof of concept&amp;quot; and so should be used with caution as future releases of LimeSurvey may involve significant changes in the way that it is used and/or works.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A wizard has been integrated in the Wysiwyg HTML editor (FCKeditor), so that you can easilly insert previous answers SQGA codes: this plugin is called the LimeReplacementFields. In order to use this feature, in the FCKeditor, click on the &amp;quot;lime between brackets&amp;quot; icon, and select a question from the select box. Only answers from previous pages are displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;LimeReplacementFields notice: when you want to delete a reference to a {SQGA} tag, please select all chars from the openning bracket to the closing bracket and press delete: DO NOT erase it char by char with the Delete or Backspace key otherwise the field will appear again.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling Questions=&lt;br /&gt;
&lt;br /&gt;
Since version 1.80 it is possible to generally edit the question layout/design by using CSS. You can find more information at [http://docs.limesurvey.org/tiki-index.php?page=Templates+%2F+The+Template+Editor#Styling_questions_in_LimeSurvey_1_8 Templates/The Template Editor -&amp;gt; Styling questions in Limesurvey 1.8]&lt;/div&gt;</summary>
		<author><name>Yohann</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Questions_-_introduction&amp;diff=901</id>
		<title>Questions - introduction</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Questions_-_introduction&amp;diff=901"/>
		<updated>2009-11-17T11:17:22Z</updated>

		<summary type="html">&lt;p&gt;Yohann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
Once you have [[Creating a new group|created your groups]], you can start adding questions within each group. Create a new question by clicking on the add icon [[File:add.png]] on the right hand side of the &amp;quot;Group&amp;quot; menu bar.&lt;br /&gt;
&lt;br /&gt;
When adding a question, you will be asked for a &amp;quot;Question Code&amp;quot;, the &amp;quot;Question&amp;quot;, &amp;quot;Help&amp;quot; and a &amp;quot;(Question Types|question type)&amp;quot;. All new questions are assigned to the Group you were viewing when you clicked &amp;quot;Add Question&amp;quot;, however you can change the group the question belongs too at a later point.&lt;br /&gt;
&lt;br /&gt;
=Field descriptions=&lt;br /&gt;
*&#039;&#039;&#039;Question code:&#039;&#039;&#039; Your ID, or number or code for the question. This field is only for quick identification for a question in export or for evaluation. Try to be consistent with your coding in this field. Planning makes your evaluation a lot easier at a later time. This field is normally not displayed to people taking the survey.&lt;br /&gt;
*&#039;&#039;&#039;Question:&#039;&#039;&#039; This is the actual question being asked. There is no real limit to the length of the question here, however if you want to explain the question, leave that for the &amp;quot;Help&amp;quot; field. HTML-code can be used, e.g., for including images:&amp;lt;br/&amp;gt;&amp;lt;img src=&amp;quot;http://www.yourdomain.com/yourpics/pic.jpg&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Help:&#039;&#039;&#039; This is an optional field. It is useful if a question needs some explanation, or you want to explain how it should be answered. When you put text in this field, a &amp;quot;Question Mark&amp;quot; icon appears on the survey entry screens with the help text right beside.&lt;br /&gt;
*&#039;&#039;&#039;Question type:&#039;&#039;&#039; This determines the type of response the survey allows. View the [[Question types]] section for a description of the various options available.&lt;br /&gt;
*&#039;&#039;&#039;Label set:&#039;&#039;&#039; For some question types you can choose a set of labels. Only label sets are shown that at least contain labels in the base language of the survey.&lt;br /&gt;
*&#039;&#039;&#039;Validation:&#039;&#039;&#039; This feature is available on all free text type questions (&amp;quot;Short Free Text&amp;quot;, &amp;quot;Long Free Text&amp;quot;, &amp;quot;Date&amp;quot; or &amp;quot;Numerical&amp;quot;). You can use standard [[Using regular expressions|Regular Expressions]] in this field to validate the responses to the question, and if the responses don&#039;t validate against this expression, the user will be prompted to try again before they can progress.&lt;br /&gt;
*&#039;&#039;&#039;Other?:&#039;&#039;&#039; Depending upon your chosen &#039;question type&#039; this option may appear. It allows you to specify that an &amp;quot;other&amp;quot; option be presented in some of the list question types.&lt;br /&gt;
*&#039;&#039;&#039;Mandatory?:&#039;&#039;&#039; For all question types, except the text ones, this setting allows you to require users to answer the question, before they can move on to the next question. For ranking question this means all items have to be ranked.&lt;br /&gt;
*&#039;&#039;&#039;Question attributes:&#039;&#039;&#039; Find out more under [[Question attributes]]&amp;lt;br/&amp;gt;Note: Adding a question attribute will loose any modifications to the questions if they have not been recorded yet by pressing the &amp;quot;Update Question&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
=Importing a question=&lt;br /&gt;
&lt;br /&gt;
At the bottom of the New Question Form you will find a file selection box to import a question file. Here you can import any question file (*.csv) you previously exported - for example this is useful if you want to reuse a question from another survey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Important: If you import a question there will always be a new question created. The original question will not be overwritten. If you want to copy a question inside the same survey it is easier to use the [[Copy Question]] function.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Information from tokens table=&lt;br /&gt;
&lt;br /&gt;
You can insert information/text from the tokens table into your question so that it can show context related information. For LimeSurvey to do this, the survey needs to be set as NOT Anonymous (ie: tracked), and it needs to have a tokens table.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;The fields available for this are:&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|{TOKEN:FIRSTNAME}||inserts the value from the &amp;quot;firstname&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||inserts the value from the &amp;quot;lastname&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||inserts the value from the &amp;quot;email&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||inserts the value from the &amp;quot;attribute_1&amp;quot; field in the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||inserts the value from the &amp;quot;attribute_2&amp;quot; field in the tokens table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To use this functionality you must type the field text into your question exactly as listed above. For example, if Attribute 1 contains either &#039;worker&#039; or &#039;boss&#039;, one could personalise a question:&lt;br /&gt;
&lt;br /&gt;
Hello {TOKEN:FIRSTNAME}. We sent an email to you using this address {TOKEN:EMAIL}. Is this correct?&lt;br /&gt;
&lt;br /&gt;
another example with more customisation, but using javascript:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;Hello {TOKEN:FIRSTNAME}. We sent an email to you using this address {TOKEN:EMAIL}. Is this correct?&lt;br /&gt;
&lt;br /&gt;
What do you as a {TOKEN:ATTRIBUTE_1} think about your&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;Javascript&amp;quot;&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var job=&#039;{TOKEN:ATTRIBUTE_1}&#039;;&lt;br /&gt;
&lt;br /&gt;
   if (job==&#039;worker&#039;) {&lt;br /&gt;
&lt;br /&gt;
      document.write (&#039;bosses&#039;)&lt;br /&gt;
&lt;br /&gt;
   } else {&lt;br /&gt;
&lt;br /&gt;
      document.write(&#039;workers&#039;)&lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
?&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Information from previous answers=&lt;br /&gt;
&lt;br /&gt;
There is currently also the capacity to insert the answer of previous questions into the text of an answer with the following provisos:&lt;br /&gt;
**The question must have been answered in a previously displayed &#039;&#039;&#039;page&#039;&#039;&#039; in the survey - answers to questions on the current page are not available&lt;br /&gt;
**You refer to the exact Survey ID, Group ID and Question ID for the question to which the answer was made - in the form: {INSERTANS:SIDXGIDXQID} - ie {INSERTANS:1X2X3}. Read more under [[SGQA identifier]] to find out how to create this code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Important: The capacity to use perviously provided answers in questions is currently only considered &amp;quot;proof of concept&amp;quot; and so should be used with caution as future releases of LimeSurvey may involve significant changes in the way that it is used and/or works.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A wizard has been integrated in the Wysiwyg HTML editor (FCKeditor), so that you can easilly insert previous answers SQGA codes: this plugin is called the LimeReplacementFields. In order to use this feature, in the FCKeditor, click on the &amp;quot;lime between brackets&amp;quot; icon, and select a question from the select box. Only answers from previous pages are displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;LimeReplacementFields notice: when you want to delete a reference to a {SQGA} tag, please select all chars from the openning bracket to the closing bracket and press delete: DO NOT erase it char by char with the Delete or Backspace key otherwise the field will appear again.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling Questions=&lt;br /&gt;
&lt;br /&gt;
Since version 1.80 it is possible to generally edit the question layout/design by using CSS. You can find more information at [http://docs.limesurvey.org/tiki-index.php?page=Templates+%2F+The+Template+Editor#Styling_questions_in_LimeSurvey_1_8 Templates/The Template Editor -&amp;gt; Styling questions in Limesurvey 1.8]&lt;/div&gt;</summary>
		<author><name>Yohann</name></author>
	</entry>
</feed>