<?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=Jelo</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=Jelo"/>
	<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/Special:Contributions/Jelo"/>
	<updated>2026-08-10T20:56:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=LimeSurvey_roadmap&amp;diff=154515</id>
		<title>LimeSurvey roadmap</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=LimeSurvey_roadmap&amp;diff=154515"/>
		<updated>2020-09-14T19:33:36Z</updated>

		<summary type="html">&lt;p&gt;Jelo: /* LimeSurvey 3 LTS - Status: Release (Sep 2020) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=General= &lt;br /&gt;
&lt;br /&gt;
This page lists current Limesurvey releases, future development, and release goals. We will try to update this regularly with more details as they become available, but please help us (yes, we are talking about &#039;&#039;&#039;you&#039;&#039;&#039;!). &lt;br /&gt;
&lt;br /&gt;
Goals cannot be fulfill by itself so if you want to [https://manual.limesurvey.org/How_to_join_the_LimeSurvey_project_team give a helping hand] or [https://manual.limesurvey.org/How_to_contribute_new_features contribute new features] yourself please get in touch!&lt;br /&gt;
&lt;br /&gt;
Last update: 2016/09/21&lt;br /&gt;
&lt;br /&gt;
=Limesurvey v2.06 - Status: Archived = &lt;br /&gt;
* LimeSurvey v2.06 will not receive new features or updates - instead see 2.06 LTS version&lt;br /&gt;
&lt;br /&gt;
=Limesurvey v2.06 LTS (Feb/March 2016) - Status: Archived  = &lt;br /&gt;
* A LTS (Long term support) version will be made available to users that bought a LimeSurvey Premium Package (= [https://www.limesurvey.org/services Comfort Update]) - this LTS version includes mainly security fixes. &lt;br /&gt;
* This long term support version is scheduled to be maintained until at least 12/2016.&lt;br /&gt;
&lt;br /&gt;
=Limesurvey v2.50 (Feb 2016) - Status: Archived = &lt;br /&gt;
&lt;br /&gt;
*Completely new administration interface&lt;br /&gt;
*Fully responsive survey templates&lt;br /&gt;
&lt;br /&gt;
= Limesurvey 3.0.0 - Status: Released (Feb 2018)=&lt;br /&gt;
&lt;br /&gt;
Biggest changes:&lt;br /&gt;
&lt;br /&gt;
* Using Twig as template engine.&lt;br /&gt;
* Possible for templates (now called themes) to inherit options and files from each other.&lt;br /&gt;
* Question templates (still work-in-progress).&lt;br /&gt;
* New side-menu and enhanced admin interface.&lt;br /&gt;
* LTS Status at least until December 2020&lt;br /&gt;
&lt;br /&gt;
= LimeSurvey 3 LTS - Status: Release (Jan 2020) =&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3.0 - LTS Version - CE support at least until end of 2020; LimeSurvey Professional support at least until end of 2021&lt;br /&gt;
&lt;br /&gt;
= Limesurvey 4.0.0 - Status: Release (Jan 2020)=&lt;br /&gt;
&lt;br /&gt;
* LimeStore beta&lt;br /&gt;
* Possible to install plugins via ZIP-file&lt;br /&gt;
* Update checks for plugins available in LimeStore&lt;br /&gt;
* New question editor using VueJS&lt;br /&gt;
* More...&lt;br /&gt;
&lt;br /&gt;
= Planned features =&lt;br /&gt;
&lt;br /&gt;
* Convert LimeSurvey to Yii 2&lt;br /&gt;
* Refactor answer database to get rid of column limitations&lt;br /&gt;
* Further development of question themes&lt;br /&gt;
&lt;br /&gt;
This list is incomplete. See bugs.limesurvey.org for more details.&lt;br /&gt;
&lt;br /&gt;
= Current release schedule =&lt;br /&gt;
&lt;br /&gt;
This release schedule is written 5. May 2020, for release 4.3.0.&lt;br /&gt;
&lt;br /&gt;
A bug fix release is released every Monday, for both master and develop branch.&lt;br /&gt;
&lt;br /&gt;
Please also see the manual about the [[How_to_contribute_new_features#Release_process|release process]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Action || Branch || Expected || Actual || Description&lt;br /&gt;
|-&lt;br /&gt;
| Announcement of release schedule || - || Tuesday 5. May 2020 || - || This release schedule is written and announced&lt;br /&gt;
|-&lt;br /&gt;
| Merge window begins || develop || Tuesday 5. May 2020 || - || We accept pull requests of new features into the develop branch.&amp;lt;br&amp;gt;All new features must be have a discussing Mantis report and automatic acceptance tests.&lt;br /&gt;
|-&lt;br /&gt;
| Merge window closes || develop || Monday 1. June 2020 || - || Feature freeze, no more features are added to develop branch&lt;br /&gt;
|-&lt;br /&gt;
| Release of 4.3.0 || master || Monday 15. June 2020 || - || develop branch is merged into master and released as 4.3.0&amp;lt;br&amp;gt;If release team deem the develop branch is not stable enough, more weeks will be added to the debug period&lt;br /&gt;
|-&lt;br /&gt;
| New release schedule || - || Monday 15. June 2020 || - || A new release schedule is written&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jelo</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=URL_fields&amp;diff=145275</id>
		<title>URL fields</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=URL_fields&amp;diff=145275"/>
		<updated>2019-11-28T13:16:01Z</updated>

		<summary type="html">&lt;p&gt;Jelo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
URL fields parameters can be used in the:&lt;br /&gt;
* [[URL_fields#End_URL_field|End URL]] field of the survey (see [[Text elements|survey text elements]]) &lt;br /&gt;
* URL field of the quota rule (read more about survey quotas [[Survey quotas|here]])&lt;br /&gt;
* [[URL_fields#Start_URL|Start URL]] field of the survey (see [[Text elements|survey text elements]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=End URL field= &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;At the end of a survey or when a quota causes a survey to terminate&#039;&#039;&#039;, 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 .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
But, LimeSurvey offers the possibility to use URL fields in many other ways which in turn allows you to enhance the functionality of your survey.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic fields== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
You can use &#039;&#039;&#039;{SAVEDID}&#039;&#039;&#039;, &#039;&#039;&#039;{TOKEN}&#039;&#039;&#039;, &#039;&#039;&#039;{SID}&#039;&#039;&#039;, and &#039;&#039;&#039;{LANG}&#039;&#039;&#039; in the end URL:&lt;br /&gt;
*&#039;&#039;&#039;SAVEDID&#039;&#039;&#039; is the id assigned to this particular submission;&lt;br /&gt;
*&#039;&#039;&#039;TOKEN&#039;&#039;&#039; is the token used to participate in the survey;&lt;br /&gt;
*&#039;&#039;&#039;SID&#039;&#039;&#039; is the survey ID;&lt;br /&gt;
*&#039;&#039;&#039;LANG&#039;&#039;&#039; is the language code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://www.limesurvey.org/test.php?var1={SAVEDID}&amp;amp;var2={TOKEN}&amp;amp;var3={SID}&amp;amp;lang={LANG}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Answer fields== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
You can also use &#039;&#039;&#039;{INSERTANS:SGQA}&#039;&#039;&#039; or [[Expression_Manager#Qcode_Variable_Naming|Expression Manager variables]]. 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 (i.e. an email address collected during the survey).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
https://www.limesurvey.org/test.php?email={EMAILADDRESS}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
It is important to add &amp;quot;newtest/y&amp;quot; to the URL to force a new session whenever your survey participants wants to fill in your survey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
https://exampletest.limequery.com/index.php/survey/index/sid/48315/newtest/Y?48315X2X222007=Y&amp;amp;48315X2X222008=Y &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
In the above scenario, the URL pertains to a survey with ID = 48315, group =2, question=22 and answercodes = 2007 and 2008. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
{{Note|For more details on the necessity of &amp;quot;newtest/y&amp;quot;, check the following [https://www.limesurvey.org/forum/installation-a-update-issues/108334-use-case-for-not-using-newtest-y forum thread].}}&lt;br /&gt;
&lt;br /&gt;
==Expressions== &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
You can also use any [[Expression Manager - presentation|expression]] here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
http://www.limesurvey.org/test.php?gender={if(sex==&#039;Male&#039;,&#039;M&#039;,&#039;F&#039;)}&amp;amp;name;={name}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Passthrough fields== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
To use passthrough fields, you have to define the variable names via Panelintegration. If you don&#039;t assign a target question, the variables will not be saved into responses (read more about the LimeSurvey [[Panel integration|panel integration]] feature). To use such a parameter in the end URL, just insert the tag &#039;&#039;&#039;{PASSTHRU:&amp;lt;paramname&amp;gt;}&#039;&#039;&#039; where &#039;&#039;&amp;lt;paramname&amp;gt;&#039;&#039; is the name of your input parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Let&#039;s suppose that you defined [[Panel integration|a parameter]] named &amp;quot;foobar&amp;quot;. The survey is started with a link like this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://example.org/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
The XYZ123 is the value you want &amp;quot;to pass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
The end URL of a survey with the following URL &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; would then be converted to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://www.limesurvey.org/test.php?foobarout=XYZ123&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Start URL= &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prefilling a survey using GET parameters== &amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
You can prefill all answers except the [[Question_type_-_File_upload|upload]] and [[Question type - Equation|equation question type]]. You can use [[Expression Manager - presentation#Access to Variables|qcode naming]] for parameters and set the value for single question types. For the multiple question type, you must use a [[SGQA identifier]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Then, answers are set to the prefilled 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 prefill the answer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Here are some start URL examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://ls.example.org/1234?QTEXT=prefilled&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; : Fill in the question with code QTEXT with &amp;lt;nowiki&amp;gt;&#039;prefilled&#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://ls.example.org/1234?MULTI_SQ001=prefilled&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; {{NewIn|v=3.14.1}} : Fill in the subquestion SQ001 of question with title MULTI with &amp;lt;nowiki&amp;gt;&#039;prefilled&#039;&amp;lt;/nowiki&amp;gt; (for a multiple text question for example).&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://ls.example.org/1234?single=-oth-&amp;amp;single_other=Other%20text&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; {{NewIn|v=3.14.1}} : Select the &amp;quot;other&amp;quot; answer option of a single choice question and fill in the other value with the text &amp;quot;Other text&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://ls.example.org/1234?1234X1X1SQ001=prefilled&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; : Fill in the subquestion SQ001 of question with ID: 1 from group with ID: 1 with &amp;lt;nowiki&amp;gt;&#039;prefilled&#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://ls.example.org/1234?1234X1X1SQ001=A1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; : Preselect the answer option &amp;lt;nowiki&amp;gt;&#039;A1&#039;&amp;lt;/nowiki&amp;gt; of the subquestion SQ001 of question with ID: 1 from group that has ID: 1.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://ls.example.org/1234?1234X1X1SQ001=Y&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; : Preselect the subquestion SQ001 of the question that has the ID 1, from the group that has ID: 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
{{Hint|Text=GET parameters use &amp;quot;?&amp;quot; for the first parameter and &amp;quot;&amp;amp;&amp;quot; for the subsequent ones. If you already have &amp;quot;?&amp;quot; in your URL, you must use &amp;quot;&amp;amp;&amp;quot; to add more GET parameters.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
{{Hint|Text=The extra GET parameters are only filled in when the survey starts anew. Therefore, for testing, always add newtest=Y to start a fresh survey. For example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://ls.example.org/1234?QTEXT=prefilled&amp;amp;newtest=Y&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prefilling a survey using GET parameters using URL parameters tab== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You can prefill (sometimes easier) answers using URL parameters which can be configured in [[Panel integration|panel integration]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prefilling and hiding the answer== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
You can use the [[QS:Hidden|hidden attribute]] of a question to hide it from your respondents. If so, the question still remains prefilled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jelo</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=RemoteControl_2_API&amp;diff=125308</id>
		<title>RemoteControl 2 API</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=RemoteControl_2_API&amp;diff=125308"/>
		<updated>2018-09-14T10:30:24Z</updated>

		<summary type="html">&lt;p&gt;Jelo: &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 2 is a XML-RPC/JSON-RPC based web service available in LimeSurvey 2.0 or more recent which offers &#039;&#039;&#039;various [https://api.limesurvey.org/classes/remotecontrol_handle.html API functions]&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
LSRC2 makes it possible for developers to control specific functionality of LimeSurvey from any other application, without being restricted to PHP as a programming language.&lt;br /&gt;
&lt;br /&gt;
The following features are planned:&lt;br /&gt;
* start a predefined survey (change titles and things)&lt;br /&gt;
* add predefined groups or questions&lt;br /&gt;
* activate the survey, restrict it to start and endtime&lt;br /&gt;
* make it closed,&lt;br /&gt;
* add participant data/tokens when you need them&lt;br /&gt;
* return the unused tokens to the main application&lt;br /&gt;
* get a fieldmap for a survey,&lt;br /&gt;
* invite or remind the participants of your survey&lt;br /&gt;
&lt;br /&gt;
...and much more&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* libXML installed&lt;br /&gt;
&lt;br /&gt;
=Setup=&lt;br /&gt;
&lt;br /&gt;
== How to configure LSRC2==&lt;br /&gt;
&lt;br /&gt;
In a default LimeSurvey installation LSRC2 is disabled. In order to use LSRC2 you must first enable the service, and then adjust the settings to suit your needs. To enable LSRC2 login to the LimeSurvey administration, go to [[Global settings]], choose the tab &#039;Interfaces&#039; and select one of the two RPC services (XML-RPC or JSON-RPC) service.&lt;br /&gt;
&lt;br /&gt;
== Security==&lt;br /&gt;
&lt;br /&gt;
LSRC2 uses the same security measures as the normal administration login. That means that the permission set of the used username and password is the same as if you would login in the administration with that user/password. Also LSRC2 is protected against brute-force password cracking - like the normal administration login.&lt;br /&gt;
&lt;br /&gt;
=How to use LSRC2=&lt;br /&gt;
&lt;br /&gt;
The basic LSRC2 URL is: http://&amp;lt;your_domain&amp;gt;/&amp;lt;your_limesurvey_dir&amp;gt;/index.php/admin/remotecontrol&lt;br /&gt;
&lt;br /&gt;
LSRC2 fully complies to the [http://www.xmlrpc.com/ XML-RPC specification] and JSON-RPC version 1 specifications. We recommend in general to use JSON-RPC because it is well tested and has a much smaller footprint than XML-RPC.&lt;br /&gt;
&lt;br /&gt;
LSRC2 offers a lot of functions. Please check the automatically generated [http://api.limesurvey.org/classes/remotecontrol_handle.html API Documentation].&lt;br /&gt;
LSRC2 offers the following functions:&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
=== get_session_key ===&lt;br /&gt;
&lt;br /&gt;
Using this function you can create a new XML/JSON-RPC session key. This is mandatory for all following LSRC2 function calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
function get_session_key(string $username, string $password)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return on success&#039;&#039;&#039;: (string) session key.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return on error&#039;&#039;&#039;:  for protocol-level errors (invalid format etc), an error message. For invalid username and password, returns a null error and the result body contains a &#039;status&#039; name-value pair with the error message.&lt;br /&gt;
&lt;br /&gt;
=== release_session_key ===&lt;br /&gt;
&lt;br /&gt;
Using this function you can close a previously opened XML-RPC/JSON-RPC session.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
function release_session_key(string $sSessionKey)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Description&lt;br /&gt;
|-&lt;br /&gt;
| sSessionKey || Auth credentials&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Always &#039;OK&#039; (string)&lt;br /&gt;
&lt;br /&gt;
== Other functions ==&lt;br /&gt;
&lt;br /&gt;
{{Alert|For all other function , you have to refer to the [http://api.limesurvey.org/classes/remotecontrol_handle.html online API ] . If your LimeSurvey version is outdated, you can publish your API and look at it directly.}}&lt;br /&gt;
&lt;br /&gt;
= Example and helper =&lt;br /&gt;
&lt;br /&gt;
== PHP Example ==&lt;br /&gt;
&lt;br /&gt;
To include JSON-RPC in your application, you can write an application using the light-weight jsonRPCClient from the [https://github.com/weberhofer/jsonrpcphp jsonrpcphp Github repository]. The library can also get included [https://getcomposer.org/download/ by composer calling]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
composer require weberhofer/jsonrpcphp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or by inclusion of the following lines in your composer.json file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;require&amp;quot;: {&lt;br /&gt;
        &amp;quot;weberhofer/jsonrpcphp&amp;quot;: &amp;quot;~2&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is an example how to connect to limesurvey:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// without composer this line can be used&lt;br /&gt;
// require_once &#039;path/to/your/rpcclient/jsonRPCClient.php&#039;;&lt;br /&gt;
// with composer support just add the autoloader&lt;br /&gt;
include_once &#039;vendor/autoload.php&#039;;&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_BASEURL&#039;, &#039;https://localhost/limesurvey/&#039;);  // adjust this one to your actual LimeSurvey URL&lt;br /&gt;
define( &#039;LS_USER&#039;, &#039;rpcuser&#039; );&lt;br /&gt;
define( &#039;LS_PASSWORD&#039;, &#039;mypassword&#039; );&lt;br /&gt;
&lt;br /&gt;
// the survey to process&lt;br /&gt;
$survey_id=374699;&lt;br /&gt;
&lt;br /&gt;
// instantiate a new client&lt;br /&gt;
$myJSONRPCClient = new \org\jsonrpcphp\JsonRPCClient( LS_BASEURL.&#039;/admin/remotecontrol&#039; );&lt;br /&gt;
&lt;br /&gt;
// receive session key&lt;br /&gt;
$sessionKey= $myJSONRPCClient-&amp;gt;get_session_key( LS_USER, LS_PASSWORD );&lt;br /&gt;
&lt;br /&gt;
// receive surveys list current user can read&lt;br /&gt;
$groups = $myJSONRPCClient-&amp;gt;list_surveys( $sessionKey );&lt;br /&gt;
print_r($groups, null );&lt;br /&gt;
&lt;br /&gt;
// release the session key&lt;br /&gt;
$myJSONRPCClient-&amp;gt;release_session_key( $sessionKey );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See a [https://gitlab.com/SondagesPro/coreAndTools/twigExtendByPlugins/snippets/1729193 snippet example of list_surveys]&lt;br /&gt;
&lt;br /&gt;
== JAVA example ==&lt;br /&gt;
To decode and code your json calls you can use the library gson as you can see in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.UnsupportedEncodingException;&lt;br /&gt;
&lt;br /&gt;
import org.apache.http.HttpEntity;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.StringEntity;&lt;br /&gt;
import org.apache.http.impl.client.DefaultHttpClient;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
import com.google.gson.JsonElement;&lt;br /&gt;
import com.google.gson.JsonObject;&lt;br /&gt;
import com.google.gson.JsonParser;&lt;br /&gt;
&lt;br /&gt;
public class TestHttpClient {&lt;br /&gt;
	&lt;br /&gt;
    public static String parse(String jsonLine) {&lt;br /&gt;
	 JsonElement jelement = new JsonParser().parse(jsonLine);&lt;br /&gt;
	 JsonObject  jobject = jelement.getAsJsonObject();&lt;br /&gt;
	 String result = jobject.get(&amp;quot;result&amp;quot;).getAsString();&lt;br /&gt;
	 return result;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
    public static void main(String[] args) throws UnsupportedEncodingException {&lt;br /&gt;
      DefaultHttpClient client = new DefaultHttpClient();          &lt;br /&gt;
         &lt;br /&gt;
      HttpPost post = new HttpPost(&amp;quot;https://PATH_OF_YOUR_SERVER/index.php/admin/remotecontrol&amp;quot;);&lt;br /&gt;
      post.setHeader(&amp;quot;Content-type&amp;quot;, &amp;quot;application/json&amp;quot;);&lt;br /&gt;
      post.setEntity( new StringEntity(&amp;quot;{\&amp;quot;method\&amp;quot;: \&amp;quot;get_session_key\&amp;quot;, \&amp;quot;params\&amp;quot;: [\&amp;quot;YOUR_USERNAME\&amp;quot;, \&amp;quot;YOUR_PASSWORD\&amp;quot; ], \&amp;quot;id\&amp;quot;: 1}&amp;quot;));&lt;br /&gt;
      try {&lt;br /&gt;
        HttpResponse response = client.execute(post);&lt;br /&gt;
        if(response.getStatusLine().getStatusCode() == 200){&lt;br /&gt;
            HttpEntity entity = response.getEntity();&lt;br /&gt;
            String sessionKey = parse(EntityUtils.toString(entity));&lt;br /&gt;
            post.setEntity( new StringEntity(&amp;quot;{\&amp;quot;method\&amp;quot;: \&amp;quot;list_groups\&amp;quot;, \&amp;quot;params\&amp;quot;: [ \&amp;quot;&amp;quot;+sessionKey+&amp;quot;\&amp;quot;, \&amp;quot;ID_SURVEY\&amp;quot; ], \&amp;quot;id\&amp;quot;: 1}&amp;quot;));&lt;br /&gt;
            response = client.execute(post);&lt;br /&gt;
            if(response.getStatusLine().getStatusCode() == 200){&lt;br /&gt;
                entity = response.getEntity();&lt;br /&gt;
                System.out.println(EntityUtils.toString(entity));&lt;br /&gt;
                }&lt;br /&gt;
           }&lt;br /&gt;
       &lt;br /&gt;
       &lt;br /&gt;
      } catch (IOException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
      }&lt;br /&gt;
    }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Python example and glue ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/TaiSHiNet/lime-py-api LimeSurvey API - Python 2 glue]&lt;br /&gt;
* [https://github.com/lindsay-stevens/limesurveyrc2api LimeSurvey API - Basic client library in Python 3]. Includes tests. Listed on Pypi: pip install limesurveyrc2api&lt;br /&gt;
&lt;br /&gt;
The following code runs with Python 2 and requires some adaptation to work with Python 3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
import urllib&lt;br /&gt;
import urllib2&lt;br /&gt;
import json&lt;br /&gt;
import sys&lt;br /&gt;
# There is an generic json-rpc implemantation in Python but it dose not work for me in this case so I worte Some functions &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
def get_session_key():&lt;br /&gt;
    req = urllib2.Request(url=&#039;https://myurl/index.php/admin/remotecontrol&#039;,\&lt;br /&gt;
                          data=&#039;{\&amp;quot;method\&amp;quot;:\&amp;quot;get_session_key\&amp;quot;,\&amp;quot;params\&amp;quot;:[\&amp;quot;admin\&amp;quot;,\&amp;quot;mypassword\&amp;quot;],\&amp;quot;id\&amp;quot;:1}&#039;)&lt;br /&gt;
    req.add_header(&#039;content-type&#039;, &#039;application/json&#039;)&lt;br /&gt;
    req.add_header(&#039;connection&#039;, &#039;Keep-Alive&#039;)&lt;br /&gt;
    try:&lt;br /&gt;
        f = urllib2.urlopen(req)&lt;br /&gt;
        myretun = f.read()&lt;br /&gt;
        #print myretun&lt;br /&gt;
        j=json.loads(myretun)&lt;br /&gt;
        return j[&#039;result&#039;]&lt;br /&gt;
    except :&lt;br /&gt;
        e = sys.exc_info()[0]&lt;br /&gt;
        print ( &amp;quot;&amp;lt;p&amp;gt;Error: %s&amp;lt;/p&amp;gt;&amp;quot; % e )&lt;br /&gt;
		&lt;br /&gt;
def get_question_properties(skey,QuestionID):&lt;br /&gt;
    req = urllib2.Request(url=&#039;https://myurl/index.php/admin/remotecontrol&#039;,\&lt;br /&gt;
                          data=&#039;{\&amp;quot;method\&amp;quot;:\&amp;quot;get_question_properties\&amp;quot;,\&amp;quot;params\&amp;quot;:[\&amp;quot;&#039;+skey+&#039;\&amp;quot;,&#039;+QuestionID&lt;br /&gt;
                                    +&#039;,[\&amp;quot;gid\&amp;quot;,\&amp;quot;type\&amp;quot;,\&amp;quot;help\&amp;quot;,\&amp;quot;language\&amp;quot;,\&amp;quot;sid\&amp;quot;,\&amp;quot;question_order\&amp;quot;,\&amp;quot;question\&amp;quot;,\&amp;quot;subquestions\&amp;quot;]],\&amp;quot;id\&amp;quot;: 1}&#039;)&lt;br /&gt;
&lt;br /&gt;
    req.add_header(&#039;content-type&#039;, &#039;application/json&#039;)&lt;br /&gt;
    req.add_header(&#039;connection&#039;, &#039;Keep-Alive&#039;)&lt;br /&gt;
    try:&lt;br /&gt;
        f = urllib2.urlopen(req)&lt;br /&gt;
        myretun = f.read()&lt;br /&gt;
        #print myretun&lt;br /&gt;
        j=json.loads(myretun)&lt;br /&gt;
        return j[&#039;result&#039;]&lt;br /&gt;
    except :&lt;br /&gt;
        e = sys.exc_info()[0]&lt;br /&gt;
        print ( &amp;quot;&amp;lt;p&amp;gt;Error: %s&amp;lt;/p&amp;gt;&amp;quot; % e )&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
def release_session_key(relkey):&lt;br /&gt;
    req = urllib2.Request(url=&#039;https://myurl/index.php/admin/remotecontrol&#039;,\&lt;br /&gt;
                          data=&#039;{\&amp;quot;method\&amp;quot;:\&amp;quot;release_session_key\&amp;quot;,\&amp;quot;params\&amp;quot;:[\&amp;quot;&#039;+relkey+&#039;\&amp;quot;],\&amp;quot;id\&amp;quot;:1}&#039;)&lt;br /&gt;
    req.add_header(&#039;content-type&#039;, &#039;application/json&#039;)&lt;br /&gt;
    req.add_header(&#039;connection&#039;, &#039;Keep-Alive&#039;)&lt;br /&gt;
    try:&lt;br /&gt;
        f = urllib2.urlopen(req)&lt;br /&gt;
        myretun = f.read()&lt;br /&gt;
        #print myretun&lt;br /&gt;
        j=json.loads(myretun)&lt;br /&gt;
        return j[&#039;result&#039;]&lt;br /&gt;
    except :&lt;br /&gt;
        e = sys.exc_info()[0]&lt;br /&gt;
        print ( &amp;quot;&amp;lt;p&amp;gt;Error: %s&amp;lt;/p&amp;gt;&amp;quot; % e )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def export_responses2(skey,sid):&lt;br /&gt;
    req = urllib2.Request(url=&#039;https://myurl/index.php/admin/remotecontrol&#039;,\&lt;br /&gt;
                          data=&#039;{\&amp;quot;method\&amp;quot;:\&amp;quot;export_responses\&amp;quot;,\&amp;quot;params\&amp;quot;:[\&amp;quot;&#039;+skey+&#039;\&amp;quot;,\&amp;quot;&#039;+sid+&#039;\&amp;quot;,\&amp;quot;csv\&amp;quot;,\&amp;quot;de\&amp;quot;,\&amp;quot;full\&amp;quot;],\&lt;br /&gt;
&amp;quot;id\&amp;quot;: 1}&#039;)&lt;br /&gt;
    req.add_header(&#039;content-type&#039;, &#039;application/json&#039;)&lt;br /&gt;
    req.add_header(&#039;connection&#039;, &#039;Keep-Alive&#039;)&lt;br /&gt;
    try:&lt;br /&gt;
        f = urllib2.urlopen(req)&lt;br /&gt;
        myretun = f.read()&lt;br /&gt;
        #print myretun&lt;br /&gt;
        j=json.loads(myretun)&lt;br /&gt;
        return j[&#039;result&#039;]&lt;br /&gt;
    except :&lt;br /&gt;
        e = sys.exc_info()[0]&lt;br /&gt;
        print ( &amp;quot;&amp;lt;p&amp;gt;Error: %s&amp;lt;/p&amp;gt;&amp;quot; % e )		&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
mykey=get_session_key()&lt;br /&gt;
print export_responses2(mykey,&#039;566237&#039;).decode(&#039;base64&#039;)&lt;br /&gt;
get_question_properties(mykey,&#039;574&#039;)&lt;br /&gt;
print release_session_key(mykey)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NodeJS example ==&lt;br /&gt;
&lt;br /&gt;
This script require request, you can include easily with the command &lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
npm install request&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a example how to connect to limesurvey:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var request = require(&#039;request&#039;);&lt;br /&gt;
&lt;br /&gt;
//******GLOBAL***************&lt;br /&gt;
var SESSIONKEY=&amp;quot;&amp;quot;;&lt;br /&gt;
var options = {&lt;br /&gt;
  url: &amp;quot;https://xxxxxxxxxxxxxxxx/index.php/admin/remotecontrol&amp;quot;,&lt;br /&gt;
  method: &amp;quot;POST&amp;quot;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;user-agent&#039;: &#039;Apache-HttpClient/4.2.2 (java 1.5)&#039;,&lt;br /&gt;
    &#039;host&#039;: &#039;xxxxxxxxxxxxxxxx&#039;,&lt;br /&gt;
    &#039;path&#039;: &#039;/index.php/admin/remotecontrol&#039;,&lt;br /&gt;
    &#039;connection&#039;: &#039;keep-alive&#039;,&lt;br /&gt;
    &#039;content-type&#039;: &#039;application/json&#039;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//*******AUTHENTIFICATION*******&lt;br /&gt;
options.body = JSON.stringify({method:&#039;get_session_key&#039;,params:[&#039;myusername&#039;,&#039;mypassword&#039;],id:1});&lt;br /&gt;
&lt;br /&gt;
request(options, function(error, response, body){&lt;br /&gt;
  if (!error &amp;amp;&amp;amp; response.statusCode == 200) {&lt;br /&gt;
      body = JSON.parse(body);&lt;br /&gt;
&lt;br /&gt;
    //*********KEEP THE KEY*********  &lt;br /&gt;
    if(SESSIONKEY===&amp;quot;&amp;quot;) {&lt;br /&gt;
      console.log(&amp;quot;NEW KEY --&amp;gt;&amp;quot;+body.result);&lt;br /&gt;
      SESSIONKEY=body.result;&lt;br /&gt;
      nextFonction();&lt;br /&gt;
    } &lt;br /&gt;
  }&lt;br /&gt;
  else console.log(&amp;quot;ERROR --&amp;gt;&amp;quot;+body);  &lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== R example and helper ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to use lsrc2 is by means of the limer package, See https://github.com/cloudyr/limer&lt;br /&gt;
&lt;br /&gt;
Example of usage of this client&lt;br /&gt;
&amp;lt;source lang=R&amp;gt;&lt;br /&gt;
# first limer (check version: must be recent) must be installed&lt;br /&gt;
if(!require(&amp;quot;devtools&amp;quot;)) {&lt;br /&gt;
  install.packages(&amp;quot;devtools&amp;quot;)&lt;br /&gt;
  library(&amp;quot;devtools&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
install_github(&amp;quot;cloudyr/limer&amp;quot;)&lt;br /&gt;
#############################################################&lt;br /&gt;
&lt;br /&gt;
library(limer)&lt;br /&gt;
&lt;br /&gt;
#change the next options (website, user, password)&lt;br /&gt;
options&lt;br /&gt;
(lime_api = &#039;https://www.XXX.nl/index.php/admin/remotecontrol&#039;)&lt;br /&gt;
options(lime_username = &#039;user&#039;)&lt;br /&gt;
options(lime_password = &#039;password&#039;)&lt;br /&gt;
#############################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# first get a session access key&lt;br /&gt;
get_session_key()&lt;br /&gt;
&lt;br /&gt;
# list all surveys. A dataframe is returned&lt;br /&gt;
survey_df&amp;lt;-call_limer(method=&#039;list_surveys&#039;)&lt;br /&gt;
print(survey_df)&lt;br /&gt;
#    sid           surveyls_title startdate             expires active&lt;br /&gt;
#1  999999  XXXX               NA 2016-03-08 15:20:30      Y&lt;br /&gt;
#2  999998  XXXX               NA   &amp;lt;NA&amp;gt;      Y&lt;br /&gt;
&lt;br /&gt;
#Read the data of the first survey (sid=999999) into a data.frame. &lt;br /&gt;
#Notice that the default sLanguageCode = en, so maybe you have to &lt;br /&gt;
#specify another language (here: All languages)&lt;br /&gt;
data&amp;lt;- get_responses(iSurveyID= 999999, sLanguageCode= &#039;&#039;, sResponseType=&#039;short&#039;)&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== C# (Copy &amp;amp; Paste from Forum) ==&lt;br /&gt;
&lt;br /&gt;
https://www.limesurvey.org/forum/development/99633-c-client-for-ls-remotecontrol2&lt;br /&gt;
&lt;br /&gt;
I have written a small json-rpc client in c#. It is a small one but enough for my purposes. You can use it in your wiki as example or maybe it helps here other people.&lt;br /&gt;
It is tested and works in my environment but it is possible that i havent found all bugs.&lt;br /&gt;
You need from nuget package manager Newtonsoft JSON.&lt;br /&gt;
&lt;br /&gt;
RPCclient.cs&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using Newtonsoft.Json;&lt;br /&gt;
using Newtonsoft.Json.Linq;&lt;br /&gt;
 &lt;br /&gt;
namespace JsonRPCclient {&lt;br /&gt;
 &lt;br /&gt;
  public class JsonRPCclient {&lt;br /&gt;
 &lt;br /&gt;
    private int id = 0;&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Set JSON-RPC webservice URL&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public string URL { set; get; }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Set JSON-RPC method&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public string Method { set; get; }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Add JSON-RPC params&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public JObject Parameters { set; get; }&lt;br /&gt;
 &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Results of the request&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public JsonRPCresponse Response { set; get; }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Create a new object of RPCclient &lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public JsonRPCclient() {&lt;br /&gt;
      Parameters = new JObject();&lt;br /&gt;
      Response = null;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Create a new object of RPCclient&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    /// &amp;lt;param name=&amp;quot;URL&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;
    public JsonRPCclient(string URL) {&lt;br /&gt;
      this.URL = URL;&lt;br /&gt;
      Parameters = new JObject();&lt;br /&gt;
      Response = null;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// POST the request and returns server response&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;
    public string Post() {&lt;br /&gt;
      try {&lt;br /&gt;
        JObject jobject = new JObject();&lt;br /&gt;
        jobject.Add(new JProperty(&amp;quot;jsonrpc&amp;quot;, &amp;quot;2.0&amp;quot;));&lt;br /&gt;
        jobject.Add(new JProperty(&amp;quot;id&amp;quot;, ++id));&lt;br /&gt;
        jobject.Add(new JProperty(&amp;quot;method&amp;quot;, Method));&lt;br /&gt;
        jobject.Add(new JProperty(&amp;quot;params&amp;quot;, Parameters));&lt;br /&gt;
 &lt;br /&gt;
        string PostData = JsonConvert.SerializeObject(jobject);&lt;br /&gt;
        UTF8Encoding encoding = new UTF8Encoding();&lt;br /&gt;
        byte[] bytes = encoding.GetBytes(PostData);&lt;br /&gt;
 &lt;br /&gt;
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);&lt;br /&gt;
        request.Method = &amp;quot;POST&amp;quot;;&lt;br /&gt;
        request.ContentType = &amp;quot;application/json&amp;quot;;&lt;br /&gt;
        request.KeepAlive = true;&lt;br /&gt;
        request.ContentLength = bytes.Length;&lt;br /&gt;
 &lt;br /&gt;
        Stream writeStream = request.GetRequestStream();&lt;br /&gt;
        writeStream.Write(bytes, 0, bytes.Length);&lt;br /&gt;
        writeStream.Close();&lt;br /&gt;
 &lt;br /&gt;
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();&lt;br /&gt;
        Stream responseStream = response.GetResponseStream();&lt;br /&gt;
        StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8);&lt;br /&gt;
 &lt;br /&gt;
        Response = new JsonRPCresponse();&lt;br /&gt;
        Response = JsonConvert.DeserializeObject&amp;lt;JsonRPCresponse&amp;gt;(readStream.ReadToEnd());&lt;br /&gt;
        Response.StatusCode = response.StatusCode;&lt;br /&gt;
 &lt;br /&gt;
        return Response.ToString();&lt;br /&gt;
      }&lt;br /&gt;
      catch (Exception e) {&lt;br /&gt;
        return e.ToString();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public void ClearParameters() {&lt;br /&gt;
      this.Parameters = new JObject();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public class JsonRPCresponse {&lt;br /&gt;
    public int id { set; get; }&lt;br /&gt;
    public object result { set; get; }&lt;br /&gt;
    public string error { set; get; }&lt;br /&gt;
    public HttpStatusCode StatusCode { set; get; }&lt;br /&gt;
 &lt;br /&gt;
    public JsonRPCresponse() { }&lt;br /&gt;
 &lt;br /&gt;
    public override string ToString() {&lt;br /&gt;
      return &amp;quot;{\&amp;quot;id\&amp;quot;:&amp;quot; + id.ToString() + &amp;quot;,\&amp;quot;result\&amp;quot;:\&amp;quot;&amp;quot; + result.ToString() + &amp;quot;\&amp;quot;,\&amp;quot;error\&amp;quot;:&amp;quot; + error + ((String.IsNullOrEmpty(error)) ? &amp;quot;null&amp;quot; : &amp;quot;\&amp;quot;&amp;quot; + error + &amp;quot;\&amp;quot;&amp;quot;) + &amp;quot;}&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
programm.cs&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
      string Baseurl = &amp;quot;http://localhost/limesurvey/index.php?r=admin/remotecontrol&amp;quot;;&lt;br /&gt;
      JsonRPCclient client = new JsonRPCclient(Baseurl);&lt;br /&gt;
      client.Method = &amp;quot;get_session_key&amp;quot;;&lt;br /&gt;
      client.Parameters.Add(&amp;quot;username&amp;quot;, &amp;quot;admin&amp;quot;);&lt;br /&gt;
      client.Parameters.Add(&amp;quot;password&amp;quot;, &amp;quot;mypassword&amp;quot;);&lt;br /&gt;
      client.Post();&lt;br /&gt;
      string SessionKey = client.Response.result.ToString();&lt;br /&gt;
 &lt;br /&gt;
      client.ClearParameters();&lt;br /&gt;
 &lt;br /&gt;
      if(client.Response.StatusCode == System.Net.HttpStatusCode.OK){&lt;br /&gt;
        client.Method = &amp;quot;import_survey&amp;quot;;&lt;br /&gt;
        client.Parameters.Add(&amp;quot;sSessionKey&amp;quot;, SessionKey);&lt;br /&gt;
        client.Parameters.Add(&amp;quot;sImportData&amp;quot;, Base64Encode(yourImportDataString));&lt;br /&gt;
        client.Parameters.Add(&amp;quot;sImportDataType&amp;quot;, &amp;quot;lss&amp;quot;);&lt;br /&gt;
        //client.Parameters.Add(&amp;quot;sNewSurveyName&amp;quot;, &amp;quot;test&amp;quot;);&lt;br /&gt;
        //client.Parameters.Add(&amp;quot;DestSurveyID&amp;quot;, 1);&lt;br /&gt;
        client.Post();&lt;br /&gt;
      }&lt;br /&gt;
 &lt;br /&gt;
      client.ClearParameters();&lt;br /&gt;
 &lt;br /&gt;
      Console.WriteLine(&amp;quot;new survey id:&amp;quot; + client.Response.result.ToString());&lt;br /&gt;
      Console.ReadLine();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= JSON-RPC notes =&lt;br /&gt;
&lt;br /&gt;
The content-type of the HTTP request &#039;&#039;&#039;must be application/json&#039;&#039;&#039;.  Most formatting errors are a failure to set the content-type header.  This will result in a null response from the server (not a JSON response).  Below is an example of a valid request and response pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;Request:&lt;br /&gt;
&lt;br /&gt;
 HTTP headers:&lt;br /&gt;
&lt;br /&gt;
   content-type=application/json&lt;br /&gt;
&lt;br /&gt;
   connection=Keep-Alive&lt;br /&gt;
&lt;br /&gt;
   host=mylimesurveyhost.com&lt;br /&gt;
&lt;br /&gt;
   content-length=67&lt;br /&gt;
&lt;br /&gt;
   user-agent=Apache-HttpClient/4.2.2 (java 1.5)&lt;br /&gt;
&lt;br /&gt;
 Post body:&lt;br /&gt;
&lt;br /&gt;
   {&amp;quot;method&amp;quot;:&amp;quot;get_session_key&amp;quot;,&amp;quot;params&amp;quot;:[&amp;quot;admin&amp;quot;,&amp;quot;mypassword&amp;quot;],&amp;quot;id&amp;quot;:1}&lt;br /&gt;
&lt;br /&gt;
Response body:&lt;br /&gt;
&lt;br /&gt;
 {&amp;quot;id&amp;quot;:1,&amp;quot;result&amp;quot;:&amp;quot;6htqat38fyr4v7iu72nqgv7xgavkvfcz&amp;quot;,&amp;quot;error&amp;quot;:null}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jelo</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=87018</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=87018"/>
		<updated>2018-02-11T11:59:33Z</updated>

		<summary type="html">&lt;p&gt;Jelo: added .shown at Q22_other&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Note: This feature is only available in LimeSurvey 1.92 or later. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Quick Start Tutorial= &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Overview== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
When customizing your surveys, you typically need a way to specify the following:&lt;br /&gt;
#&#039;&#039;&#039;Navigation/Branching&#039;&#039;&#039; - letting a subject&#039;s answers change the order in which questions are asked&lt;br /&gt;
#&#039;&#039;&#039;Tailoring/Piping&#039;&#039;&#039; - how to phrase the question (such as referring to prior answers, or conjugating sentences based upon the number or gender of your subjects), or how to generate custom reports (like assessment scores or tailored advice).&lt;br /&gt;
#&#039;&#039;&#039;Validation&#039;&#039;&#039; - ensuring that answers pass certain criteria, like min and max values, or matching an input pattern&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Expression Manager (EM) provides an intuitive way to specifying the logic for each of those features.  Nearly anything that you can write as a standard mathematical equation is a valid expression, even if you are calling functions.  EM currently provides access to 70 functions, and can be easily extended to support more.  It also lets you access your variables using human-readable variable names (rather than SGQA names).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Some surveys use &amp;quot;Goto Logic&amp;quot;, such that if you answer Question 1 with option C, then jump to Question 5. This approach is very limiting, since is hard to validate, and easily breaks when you have to re-order questions.  EM uses a Boolean relevance equation to specify all of the conditions under which a question might be valid.  If the question is relevant, then the question is shown, otherwise it is Not Applicable, and the value NULL is stored in the database.  This is similar to what can be done via the Conditions editor, but EM lets you easily specify much more complex and powerful criteria (and lets you use the variable name rather than SGQA naming).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
This image shows one way to review the relevance logic for a survey.  It computes Body Mass Index.  The relevance equation is shown in square bracket right after the variable name (which is in green).  So, the relevance of weight, weight_units, height and height_units are all 1, meaning that those questions are always asked.  However, the relevance for BMI is {!is_empty(height) and !is_empty(weight)}, which means that BMI will only be computed if the subject enters a value for both height and weight (thereby avoiding the risk of a divide by zero error).  Also, the Report question is only shown if the subject answers all four main questions (height, height_units, weight, weight_units).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance=== &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This equation computes the Body Mass Index (BMI).  It is only asked if the person first enters their height and weight.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Note that you do not use the curly braces when you enter a Relevance Equation.&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Group-Level Relevance=== &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
This is a sample census survey.  The first page asks how many people live with you and stores that in the &amp;quot;cohabs&amp;quot; variable.  This page is only shown if you have more than one cohabitant (so it is shown for the second person cohabitating with you), and also only shows if you specified how Person One is related to you (p1_rel).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
[[File:tutorial4.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
As you can see, the group also has question-level relevance criteria, such that each question only appears once you have answered the question before it (e.g. {!is_empty(p1_sex)}).  EM combines the Group and Question-level relevance for you.  Questions in a group are only asked  if the group as a whole is relevant.  Then, only the subset of questions within the group that are relevant are asked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Note that you do not use the curly braces when you enter a Relevance Equation.&lt;br /&gt;
&lt;br /&gt;
==Tailoring/Piping== &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
EM lets you easily do simple and complex conditional tailoring of your questions.  Sometimes you just need simple substitution, like saying, &amp;quot;You said you purchased &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;Product].  What did you like best about it?&amp;quot;.  Sometimes you need conditional substitution like &amp;quot;&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;Mr./Mrs.] &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;LastName], would you be willing to complete our survey?&amp;quot;.  In this case,  you want to use Mr. or Mrs. based upon the person&#039;s gender.  Other times you need even more complex substitution (such as based upon a mathematical computation).  EM supports each of these types of tailoring/piping.&lt;br /&gt;
&lt;br /&gt;
===Conditional Equations=== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The Body Mass Index example shows the ability to compute a person&#039;s BMI, even while letting them enter their height and weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Here weight_kg is {if(weight_units == &#039;kg&#039;, weight, weight * .453592)}.  This if() function means that if the subject entered the weight using kilograms, use that value, otherwise multiply the entered value (which was in pounds) by .453592 to convert it to kilograms.  The height_m variable uses a similar approach to compute the person&#039;s height in meters, even if he entered his height in inches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered. (&amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Although not well shown in the above image, weight_status uses nested if() statements to categorize the person as underweight to severely obese.  You can see its equation in the Show Logic View&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
[[File:tailoring8.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
From the edit window for this question, you can see two things:&lt;br /&gt;
#Tailoring must surround expressions with Curly Braces&lt;br /&gt;
#Expressions can span multiple lines if, as in this case, you want to make it easier to read the nested conditional logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports=== &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note: Dynamic tailoring may not work if answer options are made available in select boxes on the same question page. This results from the fact that tailoring inserts a &amp;lt;nowiki&amp;gt;&amp;lt;span&amp;gt;&amp;lt;/nowiki&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
As you can see, anything in curly braces is treated as an expression, so is syntax-highlighted (color coded) in the prior image.  If you had any typos (such as misspelled or undefined variable names or functions), EM would show an error, such as this, showing that height_unit is an undefined variable name (it is actually height_units), and rnd() is an undefined function (the proper function name is round()).  In both cases, the errors are surrounded by a red box to make it easier to spot and fix them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
[[File:tailoring12.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
You can also see that you can quickly create complex reports, such as a table of entered values or tailored advice.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Please remember that all tailoring must surround expressions with Curly Braces, so that LimeSurvey knows which parts of the question are free text and which should be parsed through Expression Manager.&lt;br /&gt;
&lt;br /&gt;
==Validation== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
EM controls how most of the advanced question options work.  These control aspects like min/max numbers of answers; min/max individual values; min/max sum values; and checking that entered values match specified string patterns.  You continue to enter those advanced question options as usual.  However, now any value in one of those fields is considered an expression, so you can have min/max criteria with complex conditional relationships to other questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
In all of these cases, since the advanced question option is always considered an expression, you do not use curly braces when specifying it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
LimeSurvey uses the new Expression Manager (EM) module which will let LimeSurvey support more complex branching, assessments, validation, and tailoring.  It will replace how LimeSurvey manages Replacements, Conditions, and Assessments on the back-end.  It will also speed up processing considerably since it eliminates most run-time database reads.  EM was developed by Dr. Thomas White (TMSWhite).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions== &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Expression&#039;&#039;&#039;:  Anything surrounded by curly braces&lt;br /&gt;
#*As long as there is no white space immediately after the opening brace or before the closing curly brace&lt;br /&gt;
#*The contents of Expressions are evaluted by EM, so they can contain mathematical formulas, functions, and complex string and date processing.&lt;br /&gt;
#&#039;&#039;&#039;Tailoring&#039;&#039;&#039;: Sometimes called &amp;quot;piping&amp;quot;, this is the process of conditionally modifying text&lt;br /&gt;
#*You have access to all &#039;replacement fields&#039;, TOKENs, and INSERTANS values&lt;br /&gt;
#*You also have easier access to questions, answers, and their properties.&lt;br /&gt;
#&#039;&#039;&#039;Relevance&#039;&#039;&#039; Equation:  A new question attribute controlling question visiblity&lt;br /&gt;
#*If there is a relevance equation, then the question is only shown if the relevance evaluates to true.&lt;br /&gt;
#*Internally, all array_filter and array_filter_exclude commands become sub-question-level relevance&lt;br /&gt;
#&#039;&#039;&#039;Equation&#039;&#039;&#039; Question Type:  A new question type that saves calculations or reports to the database&lt;br /&gt;
#*It is like a Boilerplate question, but its contents are saved to the database even if you set &amp;quot;Always Hide this Question&amp;quot;&lt;br /&gt;
#&#039;&#039;&#039;Question Code&#039;&#039;&#039;:  This is the preferred variable name for EM&lt;br /&gt;
#*This can be a descriptive name indicating the purpose of the question, making it easier to read complex logic&lt;br /&gt;
#*Valid question codes should NOT start with a number, so when using the question code to number your questions, simply use &amp;quot;q1&amp;quot;, or &amp;quot;q1a&amp;quot; or &amp;quot;g1q2&amp;quot;.&lt;br /&gt;
#*This is what currently becomes the variable name if you export data to SPSS or R, so if you do statistical analysis, you probably already made this unique.&lt;br /&gt;
&lt;br /&gt;
==Do I have to use EM?== &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
EM is fully backwards-compatible with existing surveys.  So, if you are happy to use Conditions and Assessments in the style that LimeSurvey used in versions &amp;lt;= 1.91+, you can continue to do so.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
However, EM completely replaces how LimeSurvey internally deals with Conditions.  Although you can still use the Conditions Editor to create and manage conditions, LimeSurvey 1.92 will convert those to the equivalent Relevance Equations.  As part of the upgrade, LimeSurvey 1.92 will auto-convert all existing Conditions to Relevance Equations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
This should give you the best of both worlds - you can continue using LimeSurvey as you are used to, but will see the Relevance Equation equivalent so you can gradually migrate to Relevance Equations directly whenever you see fit.&lt;br /&gt;
&lt;br /&gt;
==Can I mix use of Conditions and Relevance?== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Yes. You can use the Conditions editor for some questions and the Relevance editor for others.  Conditions are auto-converted to Relevance when you save the question.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
Note, we assume that if you are using the Conditions editor, that you want those Conditions to over-write any manually entered Relevance equation.  So, if you have existing Conditions and want to manually edit the Relevance, please delete the Conditions for that question first.  Specifically, copy the generated relevance equation to a text editor, use the Conditions menu to delete all of the conditions for that question (which will also delete the relevance), then edit the question and paste the generated relevance equation from the text editor back into the relevance field for that question (and save the question).  If there is enough demand for deleting conditions without deleting the generated relevance equation, we could add a bulk conversion process.&lt;br /&gt;
&lt;br /&gt;
==How should I choose between Conditions and Relevance?== &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Style!!Pros!!Cons&lt;br /&gt;
|-&lt;br /&gt;
|Conditions||1. Nice GUI for creating simple conditions &amp;lt;br/&amp;gt;2. GUI well documented and understood by support team||1. Only supports simple comparisons and does not AND/OR conditions well &amp;lt;br/&amp;gt;2. Cascading conditions work erratically &amp;lt;br/&amp;gt;3. Slow - database intensive, so can slow down long surveys &amp;lt;br/&amp;gt;4. Some reported problems with re-loading conditions &amp;lt;br/&amp;gt;5. GUI doesn&#039;t scale well when there are dozens, hundreds, or thousands of questions &amp;lt;br/&amp;gt;6. May be slow to convert paper-based surveys since must use SGQA names &amp;lt;br/&amp;gt;7. Often need a programmer to custom-code logic needed for complex branching&lt;br /&gt;
|-&lt;br /&gt;
|Relevance||1. Supports very complex logic, including 80+ functions and math/string operators &amp;lt;br/&amp;gt;2. Perfect support for cascading logic &amp;lt;br/&amp;gt;3. Fast - no extra database calls, so supports 1000+ question surveys &amp;lt;br/&amp;gt;4. No problems with re-loading logic since does not require SGQA codes &amp;lt;br/&amp;gt;5. Syntax-highlighting scales to 1000+ question surveys &amp;lt;br/&amp;gt;6. Easy and fast to use for groups wanting to computerize existing paper-based suveys.  &amp;lt;br/&amp;gt;7. Easily supports semi-structured interviews and epidemiological surveys without needing a programmers||1. No GUI for simple conditions - use syntax-highlighting instead &amp;lt;br/&amp;gt;2. New, so support teams have not mastered EM yet.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
The bottom is that if you are happy with how LimeSurvey 1.91+ works, there is no reason to change what you do.&lt;br /&gt;
&lt;br /&gt;
==What are some other benefits of using EM?== &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Here are some of the other reasons you might want to use EM.&lt;br /&gt;
#Calculations - you can create any calculation you can think of:&lt;br /&gt;
#*You have access to all common mathematical operators and functions&lt;br /&gt;
#*You have access to 70+ mathematical, date, and string processing functions&lt;br /&gt;
#*It is fairly easy for developers to add new functions if users need them&lt;br /&gt;
#Storing Calculations to Database&lt;br /&gt;
#*You can now compute simple and complex calculations and/or scale scores AND have them stored in the database without needing JavaScript.&lt;br /&gt;
#*You use the Equation question type to accomplish this.&lt;br /&gt;
#Assessments&lt;br /&gt;
#*You can now create assessments or scale scores from any question type, not just the subset that used to be supported&lt;br /&gt;
#*You can use Tailoring to show running or total assessment scores anywhere needed - even on the same page&lt;br /&gt;
#*You have more control over the reports generated based upon those assessment scores&lt;br /&gt;
#*You can store assessment scores in the database without needing JavaScript&lt;br /&gt;
#*You can hide assessment scores without needing JavaScript or CSS&lt;br /&gt;
#Replacement Fields&lt;br /&gt;
#*Instead of using {INSERTANS:SGQA}, you can just use the Question Code - this makes it easier to read and validate.&lt;br /&gt;
#*This also avoids the common need to edit questions to change the SGQA code to make everything work.&lt;br /&gt;
#Tailoring - you can conditionally display text based upon other values&lt;br /&gt;
#*Use the appropriate title for a subject, like (e.g. &amp;quot;Hello &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;Mr./Mrs.] Smith&amp;quot;)&lt;br /&gt;
#*Output gramatically correct sentences based when singular/plural matter:  (e.g. &amp;quot;You have 1 child&amp;quot; vs. &amp;quot;You have 2 children&amp;quot;)&lt;br /&gt;
#*Appropriately conjugate verbs and decline nouns based upon subject&#039;s gender and plurality.&lt;br /&gt;
#New Variable Attributes - you can access the following to do your tailoring:&lt;br /&gt;
#* (no suffix) -  an alias for qcode.code&lt;br /&gt;
#*.code - the selected response code for the question if it is relevant (otherwise blank), or the text value if it is not a coded question&lt;br /&gt;
#*.NAOK - same as .code, but can be part of calculations or lists even if irrelevant&lt;br /&gt;
#*.value - the assessment value for the question if it is relevant (otherwise blank), or the text value if it is not a coded question&lt;br /&gt;
#*.valueNAOK - same as .value, but can be part of calculations or lists even if irrelevant&lt;br /&gt;
#*.shown - the answer as displayed to the user (this is what {INSERTANS:xxx}  does)&lt;br /&gt;
#*.qid - the question ID&lt;br /&gt;
#*.gid - the group ID&lt;br /&gt;
#*.sgqa - the SGQA value for the question&lt;br /&gt;
#*.jsName - the correct javascript variable name for the question, regardless whether defined on this page or another&lt;br /&gt;
#*.qseq - the question sequence (starting from 0)&lt;br /&gt;
#*.gseq - the group sequence (starting from 0)&lt;br /&gt;
#*.mandatory - whether the question is mandatory (Y/N)&lt;br /&gt;
#*.question - the text of the question&lt;br /&gt;
#*.relevance - the relevance equation for the question&lt;br /&gt;
#*.grelevance - the relevance equation for the group&lt;br /&gt;
#*.relevanceStatus - whether or not the question is currently relevant (1 if true, 0 if false)&lt;br /&gt;
#*.type - the question type (the one character code)&lt;br /&gt;
#Dynamic On-Page Changes&lt;br /&gt;
#*All Relevance, Calculation, and Tailoring works dynamically on a page - so changes in values instantly update the page&lt;br /&gt;
#*So, you have questions dynamically appear/disappear based upon whether they are relevant&lt;br /&gt;
#*Questions are also dynamically tailored based upon responses on the page, so you can see running totals, tailored sentences and customized reports.&lt;br /&gt;
#New Data Entry Screen&lt;br /&gt;
#*In addition to using the current data-entry system, you can just use Survey-All-In-One.&lt;br /&gt;
#*This supports the on-page relevance and tailoring, so data entry clerks can quickly tab through and they will only have to enter the relevant responses&lt;br /&gt;
#*This can be critical if your data entry person needs to see the tailoring, which is also dynamic.&lt;br /&gt;
#Eliminates the need for most custom JavaScript&lt;br /&gt;
#*EM easily supports complicated computations, scoring, tailoring and conditional logic.&lt;br /&gt;
#*Some things will still need JavaScript (like custom layouts and conditionally hiding question sub-elements), but your JavaScript can use the EM functions so that you can access questions by their Qcode instead of SGQA, and access any of the question properties listed above.&lt;br /&gt;
&lt;br /&gt;
==What are some other helpful new features enabled by EM?== &amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
Regardless of whether you continue to use the Conditions Editor or manually compose Relevance Equations, you get these additional benefits:&lt;br /&gt;
#You can create more complex validation criteria&lt;br /&gt;
#*All of the advanced question attribute (like max_answers, min_num_value_n, max_num_value) can use Expressions.  So, you min/max criteria can be easily adjusted based upon prior responses, even if they are on the same page.&lt;br /&gt;
#*EM also handles all regular-expression-based validation, so you can robustly combine preg and equation-based question attributes.&lt;br /&gt;
#Easy Re-ordering (or deleting) of Questions and Groups&lt;br /&gt;
#*Prior to version 1.92, you could not re-order questions or groups if LimeSurvey thought that such-re-ordering could break conditions in which they were used.  Similarly, you could not delete questions if any other questions depended upon them.&lt;br /&gt;
#*With EM&#039;s syntax highlighting, it is easy to see and validate whether you try to use questions before they are declared.  So, we now let you re-order or delete questions and groups whenever you like.  EM will update all of the syntax highlighting to show you potential errors.&lt;br /&gt;
#*The re-order questions view has been enhanced to help with such review.  It now shows the question&#039;s relevance equation and tailoring, so you can immediately see whether any variables become pink (meaning they are used before being declared).&lt;br /&gt;
#The Question/Group Navigation Index is always available and accurate&lt;br /&gt;
#*Prior to version 1.92, these indexes were not available if there were complex conditions&lt;br /&gt;
#*With EM, we can guarantee that they are accurate.&lt;br /&gt;
#*Subjects can even jump back, to a prior question, change the answer, then jump forward (or submit)&lt;br /&gt;
#**When jumping forwards, EM will re-validate all of the intervening questions/groups.&lt;br /&gt;
#**If any questions become irrelevant, they will be NULLed in the database so that your data is internally consistent&lt;br /&gt;
#**If any questions become relevant or newly fail mandatory or validation rules, EM will stop on that page and force the user to answer those questions before jumping to their final destination.&lt;br /&gt;
#Auto-conversion of Conditions to Relevance&lt;br /&gt;
#*When you upgrade your database, all existing surveys that have conditions will have relevance equations generated for them&lt;br /&gt;
#*Whenever you import a survey, relevance equations will be created as needed&lt;br /&gt;
#*Whenever you add, delete, or modify conditions, EM will generate the appropriate relevance equation.&lt;br /&gt;
#Convenient Syntax Highlighting&lt;br /&gt;
#*When EM shows the relevance equation, it will show the Qcode, even if you entered an SGQA code, as we assume this will be easier to read.&lt;br /&gt;
#*All variables are color coded to show whether they were declared before or after the current question (or before or after the current group).  This lets you quickly detect and fix cases where you try to use variables for relevance (including array_filter), tailoring, or validation equations prior to declaring them.&lt;br /&gt;
#*In addition, if you hover your mouse over the color-coded variable, you will see the most important metadata about that question.   This includes the Group Sequence #, Question Sequence #, Qcode, Text of the question, and all available answer choices (if it is a question type with enumerated answer choices).&lt;br /&gt;
#**The list of answer choices uses this syntax:  &#039;answers&#039;:{key:val, ... }.&lt;br /&gt;
#**&#039;&#039;key&#039;&#039; has the syntax &#039;&#039;&#039;&#039;scale~code&#039;&#039;&#039;&#039; where &#039;&#039;scale&#039;&#039; is the answer scale (e.g. for dual scale), and &#039;&#039;code&#039;&#039; is the answer code.&lt;br /&gt;
#**&#039;&#039;val&#039;&#039; has the syntax &#039;&#039;&#039;&#039;value~shown&#039;&#039;&#039;&#039; where &#039;&#039;value&#039;&#039; is the assessment value (if using assessments, otherwise &#039;&#039;code&#039;&#039;)(e.g. Qcode.value), and &#039;&#039;shown&#039;&#039; is the display value as seen by the subject (e.g. Qcode.shown)&lt;br /&gt;
#**This means that many surveys can use calculations without needing assessment mode.  If you have enumerated answer options  that are unique, non-decimal, and non-negative, you can simply do calculations on the Qcode.code values.&lt;br /&gt;
#Easy review of entire survey logic and content&lt;br /&gt;
#*There is a new Show Survey Logic feature that lets you see everything about the survey (or group or question) on a single page.&lt;br /&gt;
#*It shows the Group, Question, Sub-Question, and Answer-level details for the selected scope (survey vs. group vs. question)&lt;br /&gt;
#*It also shows the relevance, sub-question-level relevance (for array_filter and array_filter_exclude), and generated validation equation (for preg and any validation rules like min/max sum/number of values), and all non-blank question attributes.&lt;br /&gt;
#*Everything is syntax-highlighted so that you can see potential syntax errors (like unbalanced parentheses or use of variables before they were declared)&lt;br /&gt;
#*The syntax-highligting supports rapid navigation and editing of the survey.&lt;br /&gt;
#**If you click on a variable name, it opens a browser window (or tab) that shows you that question and lets you edit it.&lt;br /&gt;
#**If you click on a group name, it opens a browser window (or tab) showing the group-reorder view so that you can easily move questions around.&lt;br /&gt;
#**All of the question attributes are also syntax highlighted.  This lets you set and see expressions within advanced question options (like basing the max/min number/sum of values on an expression)&lt;br /&gt;
#*The EM author used similar view (a little cleaner) to let his collaborating Epidemiologists and Institutional Review Board validate and authorize surveys with thousands of questions in highly branched and tailored structured interviews&lt;br /&gt;
&lt;br /&gt;
=Getting Started= &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install the latest stable version from http://www.limesurvey.org/en/download &lt;br /&gt;
*Import and explore the [[Expression Manager Sample Surveys|sample surveys]].&lt;br /&gt;
*Explore the [[Expression Manager HowTos|use cases and HowTos]] and [[Expression Manager Examples|step-by-step examples]].&lt;br /&gt;
*Explore the EM documentation (this page)&lt;br /&gt;
*Examine the built-in EM test suite&lt;br /&gt;
**From any survey, under tools, select the EM option&lt;br /&gt;
**Available Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolated Expressions&lt;br /&gt;
***shows examples of using all EM functions and operators, and the PHP and JavaScript results&lt;br /&gt;
***note there are few functions that generate different results in the PHP and JavaScript versions, so this page lets you plan your EM logic accordingly.&lt;br /&gt;
&lt;br /&gt;
=What Functionality does Expression Manager Extend/Replace? (LimeSurvey &amp;lt;= 1.91+)= &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
Conditions controlled which  questions are visible.  The general syntax was &#039;&#039;SGQA operator Value&#039;&#039;, like &#039;&#039;111X2X3 == &amp;quot;Y&amp;quot;&#039;&#039;.  Conditions could be ANDed or ORed together, but mixing ANDs and ORs was difficult.  The conditions themselves were stored in a separate table, and large portion of LimeSurvey&#039;s code was devoted to managing Conditions.  Because of extensive database access, processing large numbers of conditions could cause noticable performance problems.  Furthermore, once you had conditions assigned to questions or groups, you were often not allowed to re-order or delete them.&lt;br /&gt;
&lt;br /&gt;
==Assessments =&amp;gt; Equations and  Micro-Tailoring== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Assessments let users create scale scores from a collection of questions.  However, they could not dynamically change on the current page, and their values were not stored to the database.&lt;br /&gt;
&lt;br /&gt;
==Replacements =&amp;gt; Micro-Tailoring== &amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
Users could tailor some messages and questions based  upon prior responses.  For example, a question might be, &#039;&#039;{TOKEN:FIRSTNAME}, you said {INSERTANS:111X3X4} was your favorite sport&#039;&#039;.  However, it was not possible to do conditional tailoring (like say &amp;quot;Mr.&amp;quot; or &amp;quot;Mrs.&amp;quot; depending upon the person&#039;s gender), or conjugate verbs or decline nouns without fancy JavaScript.  Authors could implement surveys that seemed to tailor questions, but it required separate questions for each permutation, and complex conditions to decide which questions to display.&lt;br /&gt;
&lt;br /&gt;
==Validation== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Question could be validated with Regular expressions, or minimum/maximum values, or let an SGQA response serve as the minimum or maximum value.  However, validations could not be based upon calculations of other variables without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equations== &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
Equations could not be saved to the database (e.g. the final score for an assessment) without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
=How Will Expression Manager Replace/Extend That Functionality?= &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
The Expression Manager is a new core module within LimeSurvey that makes it much easier to support the type of complex functionality that used to require custom JavaScript.  It is also replacing the way LimeSurvey currently manages Conditions and Assessments.&lt;br /&gt;
&lt;br /&gt;
==New Terminology When Referring to Expression Manager (EM)== &amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
EM &amp;quot;thinks&amp;quot; of its functionality in the following terms:&lt;br /&gt;
*&#039;&#039;&#039;Relevance-based Branching&#039;&#039;&#039; - if a question is relevant, then ask it, otherwise don&#039;t (e.g. make it invisible, and mark it as NULL in the database).  There is a new Relevance field for all Question types, and also for each Group (so you can apply a set of conditions to an entire group without having to copy the same condition to each question, and/or combine group and question-level conditional logic).&lt;br /&gt;
*&#039;&#039;&#039;Tailoring&#039;&#039;&#039; - Once you know which questions should be asked, tailoring (sometimes called &#039;&#039;piping&#039;&#039;) specifies how the question should be asked. This lets you support not only simple subsitution (like {TOKEN:FIRSTNAME}), but also conjugation of verbs and declination of nouns based upon the gender or number of your subjects.  It also lets you change the message you deliver to a subject based upon whether they answered (or how they answered) other questions.&lt;br /&gt;
*&#039;&#039;&#039;Equations&#039;&#039;&#039; - EM adds a new question type called Equation which stores the result of an Expression.  These equations results are computed and written to the database, even if you hide them on the page.  Thus, they are useful for hidden scoring calculations, navigation based upon complex equations, assessments, and reports that should be generated and easily available within the database.&lt;br /&gt;
&lt;br /&gt;
===Relevance and Cascading Relevance=== &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
Every question type now has a Relevance option which controls whether the question is displayed.  EM processes each of the Relevance Equations in the order they should appear in the survey.  If the expression is true (or missing - to support legacy surveys), the question will be displayed. If it is not relevant, then the question will be hidden, and the value will be NULLed in the database.  If there are no relevant questions in a group, the entire group will be skipped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
Moreover, if any of the variables within an expression is irrelevant, then the expression always evaluates to false.  This enables Cascading Relevance so that you do not have to write very long Relevance equations for each question.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
Say you have 5 questions Q1-Q5, and you only want to show Q2 if Q1 was answered, and Q3 if Q2 was answered, etc.  The relevance equations might be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Question Code!!Relevance!!Question&lt;br /&gt;
|-&lt;br /&gt;
|Q1||1||What is your name?&lt;br /&gt;
|-&lt;br /&gt;
|Q2||Q1||{Q1}, how old are you?&lt;br /&gt;
|-&lt;br /&gt;
|Q3||Q2||So, you are {Q2} years old.  Are you married?&lt;br /&gt;
|-&lt;br /&gt;
|Q4||Q3 == &amp;quot;Y&amp;quot;||{Q1}, how long have you been married?&lt;br /&gt;
|-&lt;br /&gt;
|Q5||Q4||How many children do you have, {Q1}?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
The relevance calculations also work in JavaScript - so you could put all the above questions on one page and it would still work as expected.  In fact, EM totally replaces how EM processes Survey vs. Group vs. Question-at-a-time survey formats.  They now all use the exactly same navigation engine so they work identically regardless of survey style.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
As long as you are on the same page, any data you entered will still be there, just hidden.  So, if you enter some information, then choose an option that makes them irrelevant, then make them relevant again, your answers will still be available.  However, as soon as you move to a different page, all irrelevant responses will be lost to integrity of the dataset.&lt;br /&gt;
&lt;br /&gt;
===Group-Level Relevance=== &amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
Expression Manager also supports group-level relevance.  This makes it easier to implement looping.   Say you want to collect information about up to 10 entities (such a products or people in a household), where you first determine how many entities need follow-up (such as by asking how many people live in a household, or having people check which products they like from a long list).  After knowning how many entities need follow-up, you can use Group-level relevance like {count &amp;gt;= 1}, {count &amp;gt;=2}, ... {count &amp;gt;= 10} for each of the 10 groups of follow-up questions.  Within each group, you can have question-level conditional logic (e.g. gender or age-specific follow-up questions for each subject).  The question and group-level relevance equations are ANDed together to determine which should be shown.&lt;br /&gt;
&lt;br /&gt;
===Tailoring / Piping=== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Anything within curly braces is now treated as an Expression (with one exception described below).  Expressions have acccess to all of the LimeReplacementFields, all of the variables (via several aliases), all typical equation operators (mathematical, logical, and comparison), and dozens of functions (that even work dynamically on the client-side).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
Using these equations, you can do things such as:&lt;br /&gt;
#Conditionally show tailored messages to the respondants based upon prior responses&lt;br /&gt;
#Create Assessments and show Assessment results (or conditionally branch or show messages) based upon those results, all without using the Assessments module itself&lt;br /&gt;
#Conjugate verbs and decline nouns within questions, answers, and reports.&lt;br /&gt;
#Show summaries of responses before the &amp;quot;Show your answers&amp;quot; page at the end of the survey&lt;br /&gt;
&lt;br /&gt;
===Equations=== &amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
There is a new question type called  Equation.  It is like a Boilerplate questions, except that it stores the value of what is displayed in the database.  So, if the Equation Question text contains an Assessment computation, that value would be stored in the database in a variable that can be displayed within public or private statistics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax== &amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
Anything contained within curly braces is now considered an Expression (with one exception:  there must be no leading or trailing whitespace - this is needed to ensure the Expression Manager does not try to process embedded JavaScript).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
Note, it is OK for expressions to span multiple lines, as long as there is no whitespace after the opening  curly brace or before the closing curly brace.  This is especially helpful for nested if() statements like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
               &#039;&#039;&lt;br /&gt;
             )&lt;br /&gt;
           )&lt;br /&gt;
         )&lt;br /&gt;
       )&lt;br /&gt;
     )&lt;br /&gt;
   )&lt;br /&gt;
 )&lt;br /&gt;
)}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;EMsyntax&amp;quot;&amp;gt;Expression Manager supports the following syntax:&amp;lt;/div&amp;gt;&lt;br /&gt;
*All standard mathematical operators (e.g. +,-,*,/,!)&lt;br /&gt;
*All standard comparison operators (e.g. &amp;lt;,&amp;lt;=,==,!=,&amp;gt;,&amp;gt;=, plus these equivalents:  lt,le,eq,ne,gt,ge)&lt;br /&gt;
*Parentheses (so you can group sub-expressions)&lt;br /&gt;
*Conditional operators (e.g. &amp;amp;&amp;amp;,| | and these equivalents: and,or)&lt;br /&gt;
*Single and double-quoted strings (which can each embed strings with the other quote type)&lt;br /&gt;
*Comma operator (so can have a list of expressions and just return the final result)&lt;br /&gt;
*Assignment operator (=)&lt;br /&gt;
*Pre-defined variables (to refer to questions, question attributes, and responses) - e.g. all of the SGQA codes&lt;br /&gt;
*Pre-defined functions (there are already 70+, and it is easy to add more)&lt;br /&gt;
&lt;br /&gt;
=== Operators === &amp;lt;!--T:211--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Level!!Operator(s)!!Description&lt;br /&gt;
|-&lt;br /&gt;
|1||()||parentheses for grouping or calling functions&lt;br /&gt;
|-&lt;br /&gt;
|2||! - +||unary operators: not, negation, unary-plus&lt;br /&gt;
|-&lt;br /&gt;
|3||* /||times, divide&lt;br /&gt;
|-&lt;br /&gt;
|4||+ -||plus, minus&lt;br /&gt;
|-&lt;br /&gt;
|5||&amp;lt; &amp;lt;= &amp;gt; &amp;gt;= lt le gt ge||relative comparisons&lt;br /&gt;
|-&lt;br /&gt;
|6||== != eq ne||equality comparisons&lt;br /&gt;
|-&lt;br /&gt;
|7||and||logical AND&lt;br /&gt;
|-&lt;br /&gt;
|8||or||logical OR&lt;br /&gt;
|-&lt;br /&gt;
|9||=||assignment operator&lt;br /&gt;
|-&lt;br /&gt;
|10||,||comma operator&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
Note, for consistency between JavaScript and PHP, the plus operator (+) does addition if both operands are numeric, but does concatenation if both parts are non-numeric strings.  However, we recommend using the join() function for concatenation, as that makes your intent more clear, and avoids unexpected results if you were expecting strings but got numbers instead (or vice versa).&lt;br /&gt;
&lt;br /&gt;
===Caution about using Assignment Operator (=)=== &amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
Note, you should avoid using the assignment operators unless absolutely necessary, since they may cause unexpected side-effects.  For example, if you change the value of a previous response, the cascading relevance and validation logic between that question and the current question is not re-computed, so you could end up with internally inconsistent data (e.g. questions that stay answered but should have been NULLed, or questions that are skipped but should have been answered).  In general, if you want to assign a value to a variable, you should create an Equation question type, and use an expression to set its value.  However, there are some rare times that people really need this operator, so we made it available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
To help caution you about this operator, it is shown in red font within the syntax equations (so that you don&#039;t confuse it with &amp;quot;==&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Using Assignment Operator=== &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
The main reasons you may want to use assignment are:&lt;br /&gt;
*You need to set the default value for a question that does not accept defaults via equation (such as list radio, where the user interface lets you pick one of the answer options, but does not let you enter an equation).  However, be careful, as LimeSurvey will not be able to validate that your equation generates one of the allowable answers for that question.&lt;br /&gt;
*You need to forcibly change the response to a previous question based upon a later response&lt;br /&gt;
* etc...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:212--&amp;gt;&lt;br /&gt;
You can use all expression manager system for this purpose. It&#039;s better to use an [[Question_type_-_Equation|Equation question]] type to this purpose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:213--&amp;gt;&lt;br /&gt;
Some example:&lt;br /&gt;
* Set answer to a short text question in lowercase : &amp;lt;code&amp;gt;{QCODE=strtolower(QCODE.NAOK)}&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set a default answer to an array question type at start of a survey : &amp;lt;code&amp;gt;{Q1_SQ1=(is_empty(Q1_SQ1.NAOK),&amp;quot;A99&amp;quot;,Q1_SQ1.NAOK)}&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set a default answer to an array texts question type at start of a survey : &amp;lt;code&amp;gt;{Q1_SQY1_SQX1 = (is_empty(Q1_SQY1_SQX1.NAOK),&amp;quot;Inserted answer&amp;quot;, Q1_SQY1_SQX1.NAOK)}&amp;lt;/code&amp;gt;&lt;br /&gt;
* Set an answer with condition : &amp;lt;code&amp;gt;{QCODE=if(YesNo=&amp;quot;Y&amp;quot;,&amp;quot;A1&amp;quot;,&amp;quot;&amp;quot;)}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XSS security == &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
With XSS enable, some expression manager system can not be used : &lt;br /&gt;
* starting a HTML tag in expression but ending in another expression&lt;br /&gt;
* use a complex expression in URL. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
Example and workaround&lt;br /&gt;
* &amp;lt;code&amp;gt;{if( 1 ,&amp;quot;&amp;amp;lt;strong&amp;amp;gt;&amp;quot;,&amp;quot;&amp;quot;)}information{if( 1 ,&amp;quot;&amp;amp;lt;/strong&amp;amp;gt;&amp;quot;,&amp;quot;&amp;quot;)}&amp;lt;/code&amp;gt; is broken with XSS security, here you can use &amp;lt;code&amp;gt;{if(1,&amp;quot;&amp;lt;strong&amp;amp;gt;information&amp;amp;lt;/strong&amp;amp;gt;&amp;quot;,&amp;quot;information&amp;quot;)}&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;amp;lt;a href=&amp;quot;/script.php?value={if(QCODE == &amp;quot;Y&amp;quot;,&amp;quot;yes&amp;quot;,&amp;quot;no&amp;quot;)}&amp;quot;&amp;amp;gt;next&amp;amp;lt;/a&amp;amp;gt;&amp;lt;/code&amp;gt;, here you can use an equation question because using a complete question code is OK : &amp;lt;code&amp;gt;&amp;amp;lt;a href=&amp;quot;/script.php?value={EQUATION.NAOK}&amp;quot;&amp;amp;gt;next&amp;amp;lt;/a&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Access to Variables== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
Expression Manager provides read-only access to whichever variables we might need.  For backwards compatibility, it provides access to the following:&lt;br /&gt;
*TOKEN:xxx - the value of a TOKEN (e.g. TOKEN:FIRSTNAME, TOKEN:ATTRIBUTE_5) (Only for NOT anonymous survey).&lt;br /&gt;
*[[Adding a question#Information_from_previous_answers|INSERTANS:SGQA]] - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;). For Expression Manager it&#039;s the same that using {QCODE.shown}.&lt;br /&gt;
*All [[The_template_editor#Keywords|{XXX} values used by templates]].&lt;br /&gt;
*In question text, you can use {QID} replaced by the question id and {SGQ} replaced by the SGQA of the question&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
In addition, Expression Manager lets you refer to variables by the Question Code (the &#039;title&#039; column in the questions table within the database).  This is also the variable label used when you export your data to SPSS, R, or SAS.  For example, if you have questions about name, age, and gender, you could call those variables &#039;&#039;name&#039;&#039;, &#039;&#039;age&#039;&#039;, and &#039;&#039;gender&#039;&#039; instead of &#039;&#039;12345X13X22&#039;&#039;, &#039;&#039;12345X13X23&#039;&#039;, and  &#039;&#039;12345X13X24&#039;&#039;.  This makes equations easier for everyone to read and validate the logic, plus makes it possible to shuffle questions around without having to keep track of group or question numbers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:210--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;simplebox&#039;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; It is only safe to refer to variables that occur in preceding pages or questions.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:150--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Syntax!!Meaning!!Example!!Example Result&lt;br /&gt;
|-&lt;br /&gt;
|Qcode||an alias for Qcode.code||{implode(&#039;,&#039;,name,gender)}||&#039;Tom&#039;,&#039;M&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.code||the selected response code for the question if it is relevant (otherwise blank), or the text value if it is not a coded question||{implode(&#039;,&#039;,name.code,gender.code)}||&#039;Tom&#039;,&#039;M&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.NAOK||same as Qcode - see discussion of NAOK||{gender.NAOK}||&#039;M&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.value||the assessment value for the question if it is relevant (otherwise blank), or the text value if it is not a coded question||{gender.value}||&#039;1&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.valueNAOK||same as Qcode.value - see discussion about NAOK||{gender.valueNAOK}||&#039;1&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.shown||the dispay value for the question||{implode(&#039;,&#039;,name.shown,gender.shown)}||&#039;Tom&#039;,&#039;Male&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.question||the text of the question||{gender.question}||&#039;What is your gender?&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.mandatory||whether the question is mandatory (Y/N)||{gender.mandatory}||&#039;N&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.qid||the internal question number (not the sequential number)||{gender.qid}||337&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.type||the question type||{gender.type}||&#039;G&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.jsName||the correct javascript name for the question, regardless whether declared on or off this page||{gender.jsName}||&#039;java1827X3X337&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.gid||the internal group number (not the sequential number)||{gender.gid}||3&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.qseq||the sequential number of the question, starting from 0||{gender.qseq}||5&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.gseq||the sequential number of the group, starting from 0||{gender.gseq}||1&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.relevanceStatus||whether the question is currently relevant (0 or 1)||{gender.relevanceStatus}||1&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.relevance||the question-level relevance equation||{gender.relevance}||&#039;!is_empty(name)&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.grelevance||the  group-level relevance equation||{gender.grelevance}||&#039;num_children &amp;gt;= 5&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Qcode.sgqa||the SGQA value for this question||{gender.sgqa}||&#039;1827X3X337&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HTML editor issue=== &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
{{Alert|This issue is fixed after 2.05 build 140803}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
If you use HTML editor, some characters are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
If you use HTML editor you need to use :&lt;br /&gt;
* and for &amp;amp;&lt;br /&gt;
* lt for &amp;lt;&lt;br /&gt;
* le for &amp;lt;=&lt;br /&gt;
* gt for &amp;gt;&lt;br /&gt;
* ge for &amp;gt;=&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming== &amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
Here are the details of how to construct a Qcode (and access some properties) by question type.  In general, Qcodes are constructed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
  QuestionCode . &#039;_&#039; . SubQuestionID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
For &#039;&#039;&#039;comment&#039;&#039;&#039; and &#039;&#039;&#039;other&#039;&#039;&#039;, question code are QuestionCode_comment and QuestionCode_other&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Type!!Description!!Code!!SubQs!!Answer Options!!Scales!!Answer Code!!Answer Shown!!Relevance&lt;br /&gt;
|-&lt;br /&gt;
|5||5 Point Choice Radio-Buttons||Q1|| ||1-5|| ||{Q1}||{Q1.shown}||{Q1==3}&lt;br /&gt;
|-&lt;br /&gt;
|B||Array (10 Point Choice) Radio-Buttons||Q2||L1-L6||1-10|| ||{Q2_L2}||{Q2_L2.shown}||{Q2_L2==7}&lt;br /&gt;
|-&lt;br /&gt;
|A||Array (5 Point Choice) Radio-Buttons||Q3||1-5||1-5|| ||{Q3_1}||{Q3_1.shown}||{Q3_1&amp;gt;=3}&lt;br /&gt;
|-&lt;br /&gt;
|1||Array (Flexible Labels) Dual Scale||Q4||sq1-sq5||0:a1-a3||1:b1-b3||{Q4_sq1_0}||{Q4_sq1_1.shown}||{Q4_sq1_1==&#039;b2&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|H||Array (Flexible) - Column Format||Q5||1-5||s,m,t|| ||{Q5_1}||{Q5_1.shown}||{Q5_1==&#039;s&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|F||Array (Flexible) - Row Format||Q6||F1-F5||1-5|| ||{Q6_F3}||{Q6_F3.shown}||{Q6_F3==4}&lt;br /&gt;
|-&lt;br /&gt;
|E||Array (Increase/Same/Decrease) Radio-Buttons||Q7||1-7||I,S,D|| ||{Q7_4}||{Q7_4.shown}||{Q7_4==&#039;D&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|:||Array (Multi Flexi) 1 To 10||Q8||ls1,todo,ls2||min,max,avg|| ||{Q8_ls1_max}||{Q8_ls2_avg.shown}||{Q8_ls2_min==7}&lt;br /&gt;
|-&lt;br /&gt;
|;||Array (Multi Flexi) Text||Q9||hp,st,sw||1st,2nd,3rd|| ||{Q9_hp_3rd}||{Q9_hp_3rd.shown}||{Q9_hp_3rd==&#039;Peter&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|C||Array (Yes/Uncertain/No) Radio-Buttons||Q10||1-5||Y,N,U|| ||{Q10_1}||{Q10_1.shown}||{Q10_3==&#039;Y&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|X||Boilerplate Question||Q11|| || || || ||{Q11.shown}||&lt;br /&gt;
|-&lt;br /&gt;
|D||Date||Q12|| || || ||{Q12}||{Q12.shown}||&lt;br /&gt;
|-&lt;br /&gt;
|*||Equation||Q13|| || || ||{Q13}||{Q13.shown}||{Q13&amp;gt;5}&lt;br /&gt;
|-&lt;br /&gt;
|~124~||File Upload (records number of files uploaded)||Q14|| || || ||{Q14}|| ||{Q14&amp;gt;0}&lt;br /&gt;
|-&lt;br /&gt;
|G||Gender Drop-Down List||Q15|| ||M,F|| ||{Q15}||{Q15.shown}||{Q15==&#039;M&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|U||Huge Free Text||Q16|| || || ||{Q16}||{Q16.shown}||{strlen(Q16)&amp;gt;100}&lt;br /&gt;
|-&lt;br /&gt;
|I||Language Question||Q17|| || || ||{Q17}||{Q17.shown}||{Q17==&#039;en&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|!||List - Dropdown||Q18|| ||1-5|| ||{Q18}||{Q18.shown}||{Q18==3}&lt;br /&gt;
|-&lt;br /&gt;
|L||List Drop-Down/Radio-Button List||Q19|| ||A-Z|| ||{Q19}||{Q19.shown}||{Q19==&#039;X&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|O||List With Comment Drop-Down/Radio-Button List + Textarea||Q20|| ||A-F|| ||{Q20},{Q20comment}||{Q20.shown}||{Q20==&#039;B&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|T||Long Free Text||Q21|| || || ||{Q21}||{Q21.shown}||{strstr(Q21,&#039;hello&#039;)&amp;gt;0}&lt;br /&gt;
|-&lt;br /&gt;
|M||Multiple Choice Checkbox||Q22||A-F, other|| || ||{Q22_E}, {Q22_other}||{Q22_E.shown}, {Q22_other.shown}||{Q22_E==&#039;Y&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|P||Multiple Choice With Comments Checkbox + Text||Q23||A-F|| || ||{Q23_D}, {Q23_Dcomment}||{Q23_D.shown}||{!is_empty(Q23)}&lt;br /&gt;
|-&lt;br /&gt;
|K||Multiple Numerical Question||Q24||self,mom,dad|| || ||{Q24_self}||{Q24_self.shown}||{Q24_self&amp;gt;30}&lt;br /&gt;
|-&lt;br /&gt;
|Q||Multiple Short Text||Q25||A-F|| || ||{Q25_B}||{Q25_B.shown}||{substr(Q25_B,1,1)==&#039;Q&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|N||Numerical Question Type||Q26|| || || ||{Q26}||{Q26.shown}||{Q26 &amp;gt; 30}&lt;br /&gt;
|-&lt;br /&gt;
|R||Ranking Style||Q27||1-4|| || ||{Q27_1}||{Q27_1.shown}||{Q27_1==3}&lt;br /&gt;
|-&lt;br /&gt;
|S||Short Free Text||Q28|| || || ||{Q28}||{Q28.shown}||{Q28==&#039;mine&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|Y||Yes/No Radio-Buttons||Q29|| || || ||{Q29}||{Q29.shown}||{Q29==&#039;Y&#039;}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
Quite often, you want to evalute all parts of a question, such as counting how many sub-questions have been answered, or summing the scores.  Other times, you want to process just certain rows or columns of a question (such as getting the row or column sums and storing them in the database).  These reserved variables make that process relatively painless.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
The &#039;this&#039; variable is used exclusively within the &amp;quot;Whole question validation equation&amp;quot; and &amp;quot;Sub-question validation equation&amp;quot; advanced question options.  It expands to the variable names of each of the cells within those questions.  So, if you want to make sure that each entry is greater than three, you would set the &amp;quot;Sub-question validation equation&amp;quot; to (this &amp;gt; 3).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
The &#039;self&#039; and &#039;that&#039; variable are more powerful, and serve as macros which are expanded prior to processing equations.  The syntax choices are:&lt;br /&gt;
*self&lt;br /&gt;
*self.&#039;&#039;suffix&#039;&#039;&lt;br /&gt;
*self.&#039;&#039;sub-selector&#039;&#039;&lt;br /&gt;
*self.&#039;&#039;sub-selector&#039;&#039;.&#039;&#039;suffix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
&#039;&#039;sub-selector&#039;&#039; is one of:&lt;br /&gt;
*comments - only subquestions that are comments (e.g. from multiple choice with comment and list with comment)&lt;br /&gt;
*nocomments - only subquestions that are not comments&lt;br /&gt;
*sq_X - where X is a row or column identifier.  Only sub-questions matching pattern X are selected. Note that search is done on complete code identifier, then sq_X match and include subquestions nX, X, Xn (e.g. if you use sq_1, subquestions a1, 1a, 1, 11 or 001 was included). Put attention at dual scale question type where subquestions code are QCODE_SQCODE_1 and QCODE_SQCODE_1 and to ranking question type where subquestions code are QCODE_1,QCODE_2 ....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
*Has any part of a question been answered?  {count(self.NAOK)&amp;gt;0}&lt;br /&gt;
*What is the assessment score for this question?  {sum(self.value)}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
You can also use these to get row and column totals.  Say you have a array of numbers with rows A-E and columns 1-5.&lt;br /&gt;
*What is the grand total?  {sum(self.NAOK)}&lt;br /&gt;
*What is the total of row B?  {sum(self.sq_B.NAOK)}&lt;br /&gt;
*What is the total of column 3? {sum(self.sq_3.NAOK)}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
The &#039;that&#039; variable is like the &#039;self&#039; variable, but lets you refer to other questions.  Its syntax is:&lt;br /&gt;
*that.&#039;&#039;qname&#039;&#039;&lt;br /&gt;
*that.&#039;&#039;qname&#039;&#039;.&#039;&#039;suffix&#039;&#039;&lt;br /&gt;
*that.&#039;&#039;qname&#039;&#039;.&#039;&#039;sub-selector&#039;&#039;&lt;br /&gt;
*that.&#039;&#039;qname&#039;&#039;.&#039;&#039;sub-selector&#039;&#039;.&#039;&#039;suffix&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:166--&amp;gt;&lt;br /&gt;
&#039;&#039;qname&#039;&#039; is the question name without any sub-question extensions.  So, say you create a question &#039;q1&#039;, that is its &#039;&#039;qname&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
Examples:&lt;br /&gt;
*Has any part of question q1 been answered?  {count(that.q1.NAOK)&amp;gt;0}&lt;br /&gt;
*What is the assessment score for q2?  {sum(that.q2.NAOK)}&lt;br /&gt;
*What is the grand total of q3? {sum(that.q3.NAOK)}&lt;br /&gt;
*What is the total of row C in q4?  {sum(that.q4.sq_C.NAOK)}&lt;br /&gt;
*What is the total of column 2 in q4? {sum(that.q4.sq_2.NAOK)}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:168--&amp;gt;&lt;br /&gt;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:169--&amp;gt;&lt;br /&gt;
The one caveat is that when you use the [[Show Logic File|Show Logic File]] feature, it will show you the expanded value of &#039;self&#039; and &#039;that&#039;.  This lets you see the actual equation that will be generated so that you (and Expression Manager) can validate that the variables exist.  This may seem confusing since you may see quite lenghty equations.  However, if you edit the question, you will see the original equation using &#039;self&#039; and/or &#039;that&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:170--&amp;gt;&lt;br /&gt;
Also note that you should not use these variables if (a) you want to explicitly name each variable used in an equation, or (b) use variables that do not have sub-questions (e.g. single response questions).  In those cases, prefixing a variable with &#039;that&#039; is overkill, and you run the risk of getting unexpected results.&lt;br /&gt;
&lt;br /&gt;
==Usage of NAOK== &amp;lt;!--T:218--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
NAOK --&amp;gt; &amp;quot;Not Applicable&amp;quot; (NA) is alright (OK)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
Using NAOK, means that all or some of the variables are irrelevant (e.g. &amp;quot;Not Applicable&amp;quot; (NA) is alright (OK)). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:225--&amp;gt;&lt;br /&gt;
When you put some variable from question in any equation : if this question (or subquestion) is hidden by condition : this disable all equation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
For example : count(Q1_SQ1,Q1_SQ2,Q1_SQ3,Q1_SQ4) give always an empty string if one subquestion of Q1 is filtered.&lt;br /&gt;
To count the number of checked subquestion in such question can be count(Q1_SQ1.NAOK,Q1_SQ2.NAOK,Q1_SQ3.NAOK,Q1_SQ4.NAOK). If the sub question is hidden :Expression manager return an empty string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
Without NAOK : if one question or one subquestion is hidden : Expression Manager return always an empty string, same to return false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
The .shown always use the NAOK system (empty string if hidden) but if you need the code of the answer : it&#039;s always a good idea to add .NAOK after the question code. Except if you need it and know what you do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:223--&amp;gt;&lt;br /&gt;
Another example and information is provided at [[#Overriding_Cascading_Conditions|Overriding Cascading Conditions]]&lt;br /&gt;
&lt;br /&gt;
==Access to Functions== &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:172--&amp;gt;&lt;br /&gt;
Expression Manager provides access to mathematical, string, and user-defined functions, as shown below.  It has PHP and JavaScript equivalents for these functions so that they work identically on server-side (PHP) and client-side (JavaScript).  It is easy to add new functions.&lt;br /&gt;
&lt;br /&gt;
===Implemented Functions=== &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function!!Meaning!!Syntax&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.abs.php abs]||Absolute value||number abs(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.acos.php acos]||Arc cosine||number acos(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.addslashes.php addslashes]||Quote string with slashes||string addslashes(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.asin.php asin]||Arc sine||number asin(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.atan.php atan]||Arc tangent||number atan(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.atan2.php atan2]||Arc tangent of two variables||number atan2(number, number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.ceil.php ceil]||Round fractions up||number ceil(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.checkdate.php checkdate]||Returns true(1) if it is a valid date in gregorian calendar||bool checkdate(month,day,year)&lt;br /&gt;
|-&lt;br /&gt;
|convert_value||Convert a numerical value using a inputTable and outputTable of numerical values||number convert_value(fValue, iStrict, sTranslateFromList, sTranslateToList)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.cos.php cos]||Cosine||number cos(number)&lt;br /&gt;
|-&lt;br /&gt;
|count||count the number of answered (non-blank)questions in the list||number count(arg1, arg12, ..., argN)&lt;br /&gt;
|-&lt;br /&gt;
|countif||Count the number of answered questions in the list equal the first argument||number countif(matches, arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|countifop||Count the number of answered questions in the list which pass the criteria (arg op value)||number countifop(op, value, arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.date.php date]||Format a local date/time||string date(format &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, timestamp=time()])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.exp.php exp]||Calculates the exponent of e||number exp(number)&lt;br /&gt;
|-&lt;br /&gt;
|fixnum||Display numbers with comma as radix separator, if needed||string fixnum(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.floor.php floor]||Round fractions down||number floor(number)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.gmdate.php gmdate]||Format a GMT date/time||string gmdate(format &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, timestamp=time()])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.html-entity-decode.php html_entity_decode]||Convert all HTML entities to their applicable characters (always uses ENT_QUOTES and UTF-8)||string html_entity_decode(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.htmlentities.php htmlentities]||Convert all applicable characters to HTML entities (always uses ENT_QUOTES and UTF-8)||string htmlentities(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.htmlspecialchars.php expr_mgr_htmlspecialchars]||Convert special characters to HTML entities (always uses ENT_QUOTES and UTF-8)||string htmlspecialchars(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.htmlspecialchars-decode.php expr_mgr_htmlspecialchars_decode]||Convert special HTML entities back to characters (always uses ENT_QUOTES and UTF-8)||string htmlspecialchars_decode(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.idate.php idate]||Format a local time/date as integer||string idate(string &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, timestamp=time()])&lt;br /&gt;
|-&lt;br /&gt;
|if||Excel-style if(test,result_if_true,result_if_false)||if(test,result_if_true,result_if_false)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.implode.php implode]||Join array elements with a string||string implode(glue,arg1,arg2,...,argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.intval.php intval]||Get the integer value of a variable||int intval(number &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, base=10])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.empty.php is_empty]||Determine whether a variable is considered to be empty||bool is_empty(var)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.is-float.php is_float]||Finds whether the type of a variable is float||bool is_float(var)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.is-int.php is_int]||Find whether the type of a variable is integer||bool is_int(var)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.is-nan.php is_nan]||Finds whether a value is not a number||bool is_nan(var)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.is-null.php is_null]||Finds whether a variable is NULL||bool is_null(var)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.is-numeric.php is_numeric]||Finds whether a variable is a number or a numeric string||bool is_numeric(var)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.is-string.php is_string]||Find whether the type of a variable is string||bool is_string(var)&lt;br /&gt;
|-&lt;br /&gt;
|join{{NewIn|2.0|b=130129}}||Join elements as a new string||join(arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|list||Return comma-separated list of non-blank values||string list(arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.log.php log]|| The logarithm of number to base, if given, or the natural logarithm. ||number log(number,base=e)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.ltrim.php ltrim]||Strip whitespace (or other characters) from the beginning of a string||string ltrim(string &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, charlist])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.max.php max]||Find highest value||number max(arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.min.php min]||Find lowest value||number min(arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.mktime.php mktime]||Get UNIX timestamp for a date (each of the 6 arguments are optional)||number mktime([hour [, minute [, second [, month [, day [, year ]]]]]])&lt;br /&gt;
|-&lt;br /&gt;
|modulo-function||The modulo function is &#039;&#039;&#039;not supported&#039;&#039;&#039; yet. You can use the floor() function instead||floor(x/y)==(x/y)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.nl2br.php nl2br]||Inserts HTML line breaks before all newlines in a string||string nl2br(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.number-format.php number_format]||Format a number with grouped thousands||string number_format(number)&lt;br /&gt;
|-&lt;br /&gt;
|pi||Get value of pi||number pi()&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.pow.php pow]||Exponential expression||number pow(base, exp)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.quoted-printable-decode.php quoted_printable_decode]||Convert a quoted-printable string to an 8 bit string||string quoted_printable_decode(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.quoted-printable-encode.php quoted_printable_encode]||Convert a 8 bit string to a quoted-printable string||string quoted_printable_encode(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.quotemeta.php quotemeta]||Quote meta characters||string quotemeta(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.rand.php rand]||Generate a random integer, see [[Expression Manager Sample Surveys#Randomly Ask One Question Per Group|this example]]||int rand() OR int rand(min, max)&lt;br /&gt;
|-&lt;br /&gt;
|regexMatch||compare a string to a [[Using regular expressions|regular expression]]||bool regexMatch(pattern,input)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.round.php round]||Rounds a number to an optional precision||number round(val &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, precision])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.rtrim.php rtrim]||Strip whitespace (or other characters) from the end of a string||string rtrim(string &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, charlist])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.sin.php sin]||Sine||number sin(arg)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.sprintf.php sprintf]||Return a formatted string||string sprintf(format, arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.sqrt.php sqrt]||Square root||number sqrt(arg)&lt;br /&gt;
|-&lt;br /&gt;
|stddev||Calculate the Sample Standard Deviation for the list of numbers||number stddev(arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.str-pad.php str_pad]||Pad a string to a certain length with another string||string str_pad(input, pad_length &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, pad_string])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.str-repeat.php str_repeat]||Repeat a string||string str_repeat(input, multiplier)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.str-replace.php str_replace]||Replace all occurrences of the search string with the replacement string||string str_replace(search, replace, subject)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strcasecmp.php strcasecmp]||Binary safe case-insensitive string comparison||int strcasecmp(str1, str2)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strcmp.php strcmp]||Binary safe string comparison||int strcmp(str1, str2)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strip-tags.php strip_tags]||Strip HTML and PHP tags from a string||string strip_tags(str, allowable_tags)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.stripos.php stripos]||Find position of first occurrence of a case-insensitive unicode string (starting by 0, return false if not found)|||int stripos(haystack, needle &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, offset=0])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.stripslashes.php stripslashes]||Un-quotes a quoted string||string stripslashes(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.stristr.php stristr]||Case-insensitive strstr||string stristr(haystack, needle &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, before_needle=false])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strlen.php strlen]||Get string length||int strlen(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strpos.php strpos]||Find position of first occurrence of an unicode string (starting by 0, return false if not found)||int strpos(haystack, needle &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt; offset=0])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strrev.php strrev]||Reverse a string||string strrev(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strstr.php strstr]||Find first occurrence of a string||string strstr(haystack, needle&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, before_needle=false])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strtolower.php strtolower]||Make a string lowercase||string strtolower(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strtotime.php strtotime]||Parse about any English textual datetime description into a Unix timestamp||int strtotime(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.strtoupper.php strtoupper]||Make a string uppercase||string strtoupper(string)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.substr.php substr]||Return part of an unicode string||string substr(string, start &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, length])&lt;br /&gt;
|-&lt;br /&gt;
|sum||Calculate the sum of values in an array||number sum(arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|sumifop||Sum the values of answered questions in the list which pass the criteria (arg op value)||number sumifop(op, value, arg1, arg2, ... argN)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.tan.php tan]||Tangent||number tan(arg)&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.time.php time]||Return current UNIX timestamp||number time()&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.trim.php trim]||Strip whitespace (or other characters) from the beginning and end of a string||string trim(string &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, charlist])&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.php.net/manual/en/function.ucwords.php ucwords]||Uppercase the first character of each word in a string||string ucwords(string)&lt;br /&gt;
|-&lt;br /&gt;
|unique||Returns true if all non-empty responses are unique||boolean unique(arg1, ..., argN)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered=== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
Other functions that are planned (or being considered) but which are not implemented yet include the following.  Some of these are for backwards compatability with another survey tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Syntax!!Meaning!!Comments&lt;br /&gt;
|-&lt;br /&gt;
|e()||returns the value of e||&lt;br /&gt;
|-&lt;br /&gt;
|formatDate(X,PAT)||return the string value of date X formatted according to Java data format pattern PAT||&lt;br /&gt;
|-&lt;br /&gt;
|formatNumber(X,PAT)||return the string value of number X formatted according to Java number format pattern PAT||&lt;br /&gt;
|-&lt;br /&gt;
|getAnsOption(X)||returns the text corresponding to the selected option for answer X||this is the same as X.shown&lt;br /&gt;
|-&lt;br /&gt;
|getAnsOption(X,Y)||returns the text corresponding to the option at index Y of node X||&lt;br /&gt;
|-&lt;br /&gt;
|getRelevance(X)||returns the relevance equation for question X||&lt;br /&gt;
|-&lt;br /&gt;
|getStartTime()||returns the date corresponding to the system time when the interview was started||&lt;br /&gt;
|-&lt;br /&gt;
|getType(X)||returns the string name of the datatype - e.g. *NA* if isNA()||&lt;br /&gt;
|-&lt;br /&gt;
|gotoFirst()||jumps to the first relevant set of questions - this violates the normal flow of the system||&lt;br /&gt;
|-&lt;br /&gt;
|gotoNext()||jumps to the next set of relevant questions - this violates the normal flow of the system||&lt;br /&gt;
|-&lt;br /&gt;
|gotoPrevious()||jumps to the previous set of relevant questions - this violates the normal flow of the system||&lt;br /&gt;
|-&lt;br /&gt;
|isAsked(X)||returns true if the answer is neither *NA*, *INVALID*, nor *UNASKED*||&lt;br /&gt;
|-&lt;br /&gt;
|isInvalid(X)||returns true if the answer is of type *INVALID*||&lt;br /&gt;
|-&lt;br /&gt;
|isNA(X)||returns true if the answer is of type *NA*||&lt;br /&gt;
|-&lt;br /&gt;
|isNotUnderstood(X)||returns true if the answer if of type *HUH*||&lt;br /&gt;
|-&lt;br /&gt;
|isRefused(X)||returns true if the answer is of type *REFUSED*||&lt;br /&gt;
|-&lt;br /&gt;
|isSpecial(X)||returns true if the answer is of type *UNASKED*, *NA*, *REFUSED*, *INVALID*, *UNKNOWN*, or *HUH*||&lt;br /&gt;
|-&lt;br /&gt;
|isUnknown(X)||returns true if the answer is of type *UNKNOWN*||&lt;br /&gt;
|-&lt;br /&gt;
|jumpTo(X)||jump to the group containing the named question -- this violates the normal flow of the system||&lt;br /&gt;
|-&lt;br /&gt;
|jumpToFirstUnasked()||jump to the first unasked question &amp;lt;strike&amp;gt; thus bypassing previous answered questions &amp;lt;/strike&amp;gt; this violates the normal flow of the system||&lt;br /&gt;
|-&lt;br /&gt;
|lastIndexOf(X,Y)||returns the last index (base 0) of string Y in string X. Returns -1 if Y is not contained within X||&lt;br /&gt;
|-&lt;br /&gt;
|list(X,...)||a string containing a comma separated list of the positive values with &amp;quot;and&amp;quot; separating the last two||&lt;br /&gt;
|-&lt;br /&gt;
|mean(X,...)||returns the mean of a list of values||&lt;br /&gt;
|-&lt;br /&gt;
|numAnsOptions(X)||returns the number of answer options that question X has||&lt;br /&gt;
|-&lt;br /&gt;
|orlist(X,...)||a string containing a comma separated list of the positive values, with &amp;quot;or&amp;quot; separting the last two||&lt;br /&gt;
|-&lt;br /&gt;
|parseDate(X,PAT)||returns the date value of string X parsed with Java date format pattern PAT||&lt;br /&gt;
|-&lt;br /&gt;
|parseNumber(X,PAT)||returns the numerical value of string X parsed with Java number format pattern PAT||&lt;br /&gt;
|-&lt;br /&gt;
|showAllResponsesExcept( questionList,attributeList,attributeTitleList)||questionList = pipe-delimited list of question identifiers; attributeList = pipe-delimited list of attributes (like question#, title, text, type - so you can decide what to show); attributeTitleList = pipe-delimited list of table headers, so can internationalize the report.||&lt;br /&gt;
|-&lt;br /&gt;
|showTheseResponses( questionList,attributeList,attributeTitleList)||questionList = pipe-delimited list of question identifiers; attributeList = pipe-delimited list of attributes (like question#, title, text, type - so you can decide what to show); attributeTitleList = pipe-delimited list of table headers, so can internationalize the report.|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local== &amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
In order to properly build the JavaScript for page, Expression Manager needs to know which variables are set on the page, and what their JavaScript ID is (e.g. for document.getElementById(x)).  It also must know which variables are set on other pages (so that it can ensure that the needed &amp;lt;input type=&#039;hidden&#039; value=&#039;x&#039;&amp;gt; fields are present and populated).&lt;br /&gt;
&lt;br /&gt;
==Cascading Conditions== &amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:182--&amp;gt;&lt;br /&gt;
If any of the variables are irrelevant, the whole equation will be irrelevant (false).  For example, in the following table, N/A means that one of the variables was not relevant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:183--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Operator!!Example!!a!!b!!Result&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;+ (unary)&amp;lt;/nowiki&amp;gt;||&amp;lt;nowiki&amp;gt;+a&amp;lt;/nowiki&amp;gt;||N/A|| ||false&lt;br /&gt;
|-&lt;br /&gt;
|- (unary)||-a||N/A|| ||false&lt;br /&gt;
|-&lt;br /&gt;
|!||!a||N/A|| ||false&lt;br /&gt;
|-&lt;br /&gt;
|== (or eq)||a == b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|== (or eq)||a == b||N/A||0||false&lt;br /&gt;
|-&lt;br /&gt;
|== (or eq)||a == b||N/A||N/A||false&lt;br /&gt;
|-&lt;br /&gt;
|!= (or ne)||a != b||N/A||5|| false&lt;br /&gt;
|-&lt;br /&gt;
|!= (or ne)||a != b||N/A||N/A|| false&lt;br /&gt;
|-&lt;br /&gt;
|!= (or ne)||a != b||N/A||0||false&lt;br /&gt;
|-&lt;br /&gt;
|&amp;gt; (or gt)||a &amp;gt; b||N/A||5|| false&lt;br /&gt;
|-&lt;br /&gt;
|&amp;gt;= (or ge)||a &amp;gt;= b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt; (or lt)||a &amp;lt; b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;= (or le)||a &amp;lt;= b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|and||a and b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|and||a and b||N/A||N/A||false&lt;br /&gt;
|-&lt;br /&gt;
|or||a or b||N/A||N/A||false&lt;br /&gt;
|-&lt;br /&gt;
|or||a or b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;+&amp;lt;/nowiki&amp;gt;||a + b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|-||a - b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|*||a * b||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|/||a / b||5||N/A||false&lt;br /&gt;
|-&lt;br /&gt;
|()||(a)||N/A|| ||false&lt;br /&gt;
|-&lt;br /&gt;
|(exp)||(a &amp;amp;&amp;amp; b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|(exp) op (exp)||(b + b) &amp;gt; (a &amp;amp;&amp;amp; b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|function||sum(a,b,b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|function||max(a,b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|function||min(a,b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|function||implode(&#039;, &#039;,a,b,a,b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|function||if(a,a,b)||N/A||5||false&lt;br /&gt;
|-&lt;br /&gt;
|function||is_empty(a)||N/A|| ||false&lt;br /&gt;
|-&lt;br /&gt;
|function||is_empty(a)||0 (or blank)|| ||true&lt;br /&gt;
|-&lt;br /&gt;
|function||!is_empty(a)||N/A|| ||false&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions=== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
Say you want to show a running total of all relevant answers.  You might try to use the equation {sum(q1,q2,q3,...,qN)}.  However, this gets translated internally to LEMif(LEManyNA(&#039;q1&#039;,&#039;q2&#039;,&#039;q3&#039;,...,&#039;qN&#039;),&#039;&#039;,sum(LEMval(&#039;q1&#039;),LEMval(&#039;q2&#039;),LEMval(&#039;q3&#039;),...,LEMval(&#039;qN&#039;))).  So, if any of the values q1-qN are irrelevant, the equation will always return false.  In this case, the sum() will show 0 until all questions are answered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
To get around this, each variable can have a &amp;quot;.NAOK&amp;quot; suffix (meaning that Not Applicable is OK) added to it.  In such cases, the following behavior occurs.  Say you have a variable q1.NAOK&lt;br /&gt;
#q1 is not added to the LEManyNA() clause&lt;br /&gt;
#LEMval(&#039;q1&#039;) will  continue to check whether the response is relevant, and will return &amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt; if it is not (so individual irrelevant responses will be ignored, but they will not void the entire expression).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
So, the solution to the running total problem is to use the equation sum(q1.NAOK,q2.NAOK,q3.NAOK,...,qN.NAOK).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converge on common paths later.  For example, say subjects answer a survey in a way that is outside the normal range of responses.  The author could alert the subjects that they may not get valid results, and ask them whether they really want to  continue with the survey.  If they say Yes, then the rest of the questions will be shown.  The condition for the &amp;quot;rest of the questions&amp;quot; would check whether the initial responses were answered within the normal range OR whether the subject said Yes to the question that is only relevant if they answered outside the normal range.&lt;br /&gt;
&lt;br /&gt;
==How does Expression Manager Support Conditional Micro-Tailoring?== &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
Here is an example of micro-tailoring (where Question Type==&#039;expr&#039; means an Equation):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Question Code!!Relevance!!Question Type!!Question&lt;br /&gt;
|-&lt;br /&gt;
|name||1||text||What is your name?&lt;br /&gt;
|-&lt;br /&gt;
|age||1||text||How old are you?&lt;br /&gt;
|-&lt;br /&gt;
|badage||!is_empty(age)||expr||{(age&amp;lt;16) or (age&amp;gt;80)}&lt;br /&gt;
|-&lt;br /&gt;
|agestop||badage||message||Sorry, {name}, you are too {if( (age&amp;lt;16),&#039;young&#039;,if( (age&amp;gt;80),&#039;old&#039;,&#039;middle-aged&#039;) ) } for this test.&lt;br /&gt;
|-&lt;br /&gt;
|kids||!badage||yesno||Do you have children?&lt;br /&gt;
|-&lt;br /&gt;
|parents||1||expr||{!badage &amp;amp;&amp;amp; kids==&#039;Y&#039;}&lt;br /&gt;
|-&lt;br /&gt;
|numKids||parents||text||How many children do you have?&lt;br /&gt;
|-&lt;br /&gt;
|kid1||parents &amp;amp;&amp;amp; numKids &amp;gt;= 1||text||How old is your first child?&lt;br /&gt;
|-&lt;br /&gt;
|kid2||parents &amp;amp;&amp;amp; numKids &amp;gt;= 2||text||How old is your second child?&lt;br /&gt;
|-&lt;br /&gt;
|kid3||parents &amp;amp;&amp;amp; numKids &amp;gt;= 3||text||How old is your third child?&lt;br /&gt;
|-&lt;br /&gt;
|kid4||parents &amp;amp;&amp;amp; numKids &amp;gt;= 4||text||How old is your fourth child?&lt;br /&gt;
|-&lt;br /&gt;
|kid5||parents &amp;amp;&amp;amp; numKids &amp;gt;= 5||text||How old is your fifth child?&lt;br /&gt;
|-&lt;br /&gt;
|sumage||1||expr||{sum(kid1.NAOK,kid2.NAOK,kid3.NAOK,kid4.NAOK,kid5.NAOK)}&lt;br /&gt;
|-&lt;br /&gt;
|report||parents||yesno||{name}, you said you are {age} and that you have {numKids}.  The sum of ages of your first {min(numKids,5)} kids is {sumage}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
All of these questions can be on a single page (e.g. in the same group), and only the relevant questions will display.  Moreover, as you enter the ages of children, the sum() expression in the last question will dynamically update on the page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:193--&amp;gt;&lt;br /&gt;
Expression Manager provides this functionality by surrounding each expression with a named &amp;lt;span&amp;gt; element.  Every time a value changes, it recomputes the expression that should appear in that &amp;lt;span&amp;gt; element and regenerates the display.  You can have dozens, or even hundreds, of such tailored expressions on the same page, and the page will re-display all of them in a single screen refresh.&lt;br /&gt;
&lt;br /&gt;
==Mapping of LimeSurvey 1.91+ to Expression Manager Functionality== &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:195--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Old Feature!!New Feature!!Comments&lt;br /&gt;
|-&lt;br /&gt;
|Conditions||Relevance||You can use very complex conditional equations, and access a broader range of variables&lt;br /&gt;
|-&lt;br /&gt;
|Assessments||Equation||Any assessment scores can be re-structured into an Equation. This both ensures that the score is written to the database, and also lets you see dynamic changes to the score value on the current page&lt;br /&gt;
|-&lt;br /&gt;
|Replacements||Expression Manager||The core engine takes the input string and treats everything within curly braces as an Expression - so it handles all historical replacements types.  To avoid messing up embedded JavaScript, Expression Manager only processes content between curly braces as long as (a)  there is no leading or trailing whitespace within the curly braces - e.g. {expr} is an expression, but { expr}, {expr }, and { expr } are not expressions.  Furthermore, Expression Manager does not process content within its own strings (e.g. {list(&#039;hi&#039;,&#039;there {braces}&#039;)} generates &amp;quot;hi there {braces}&amp;quot;).  It also ignores escaped curly braces (e.g. \{this is not an expression\})&lt;br /&gt;
|-&lt;br /&gt;
|Validation||Expression Manager||The plan is to take the current min/max Question Attributes and have Expression Manager process them.  That way the min/max values can be expressions themselves&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting= &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
To help with entering and validating expressions, EM provides syntax highlighting with the following features:&lt;br /&gt;
&lt;br /&gt;
==Types and Meanings of Syntax Highlighting== &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Color!!Sample!!Meaning!!Tooltip!!Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||style=&#039;background-color: #eee8aa&#039;|Sample||the whole equation||none||Anything within curly braces that is recognized as an equation (e.g. there is no leading or trailing whitepace) will be color-coded with a tan background to help distinguish it from surrounding text&lt;br /&gt;
|-&lt;br /&gt;
|bold red text||style=&#039;color:#ff0000; background-color:#eee8aa&#039;|&#039;&#039;&#039;Sample&#039;&#039;&#039;||An error||Some explanation on error||Can be an unknow variable or an error in function, .... Survey can be totally broken, this don&#039;t show to public user.&lt;br /&gt;
|-&lt;br /&gt;
|blue text||style=&#039;color:#0000ff; background-color:#eee8aa&#039;|Sample||function name||meaning and allowable syntax||function names, or things that should be functions since they are followed by an opening parenthesis, are presented in bold blue text.  Tooltips show the meaning and allowable syntax for the function.&lt;br /&gt;
|-&lt;br /&gt;
|grey text||style=&#039;color:#808080; background-color:#eee8aa&#039;|Sample||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|cyan text||style=&#039;color:#4169e1; background-color:#eee8aa&#039;|Sample||variable set on the same page,||&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;name or SGQA code]: question; value; answerList showing codes for each value||Any variable that is set on the same page to the current question is shown in cyan text, showning it can be updated in javascript.  The tooltip shows its name (if you used INSERTANS:xxx) or SGQA code (if you used the new naming system), the actual question, and its current value (or blank if not set).  If the question type expects responses from an enumerated value set, the mapping of the codes to display values is show.&lt;br /&gt;
|-&lt;br /&gt;
|green text||style=&#039;color:#008000; background-color:#eee8aa&#039;|Sample||variable set on a prior page||&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;name or SGQA code]: question; value; answerList showing codes for each value||Any variable that is set on a prior page is shown in bold green text.  The tooltip shows its name (if you used INSERTANS:xxx) or SGQA code (if you used the new naming system), the actual question, and its current value (or blank if not set).  If the question type expects responses from an enumerated value set, the mapping of the codes to display values is show.&lt;br /&gt;
|-&lt;br /&gt;
|bold pink text||style=&#039;color:#9370db; background-color:#eee8aa&#039;|Sample||variable set on a later page &amp;lt;sup&amp;gt;in general : empty at survey start, but can be filled with index or move previous&amp;lt;/sup&amp;gt;||&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;name or SGQA code]: question; value; answerList showing codes for each value||Any variable that is set on a prior page is shown in bold pink text.  The tooltip shows its name (if you used INSERTANS:xxx) or SGQA code (if you used the new naming system), the actual question, and its current value (or blank if not set).  If the question type expects responses from an enumerated value set, the mapping of the codes to display values is show.&lt;br /&gt;
|-&lt;br /&gt;
|bold tan text||style=&#039;color:#a0522d; background-color:#eee8aa&#039;|Sample||a lime replacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE}) are shown in bold tan text.  &lt;br /&gt;
|-&lt;br /&gt;
|red text||style=&#039;color:#ff4500; background-color:#eee8aa&#039;|Sample||assignment operator (=) ||warning message||If you use one of the assignment operator (=) that operator will be displayed in red text.  This is meant to help prevent accidental re-assignment of values when you really meant to check whether a == b instead of  setting the value of a = b.&lt;br /&gt;
|-&lt;br /&gt;
|normal black text||style=&#039;color:black; background-color:#eee8aa&#039;|Sample||punctuation||none||All other punctuation within the expression is shown as normal black text.&lt;br /&gt;
|-&lt;br /&gt;
|red-boxed text||a bold red line surrounds the error||syntax error||description of the error||Any detected syntax errors are shown by surrounding the error with a red box.  The tooltip shows the error.  Examples include unmatched parentheses, use of undefined functions, passing the wrong number of arguments to functions, poorly structured expressions (e.g. missing operators between variables), trying to assign a new value to a read-only variable, trying to assign values to non-variables, or using unsupported syntax.  Note that the syntax error dectection system may only report one error in an expression even if there are multiple errors; however, if any errors are detected, at least one error will be shown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Additional Reading= &amp;lt;!--T:202--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]== &amp;lt;!--T:203--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]== &amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].== &amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]== &amp;lt;!--T:206--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]== &amp;lt;!--T:207--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jelo</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=82902</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=82902"/>
		<updated>2017-11-17T14:08:37Z</updated>

		<summary type="html">&lt;p&gt;Jelo: /* Introduction */  Version of Twig edited. Important to know if Twig 1.X or 2.X can be used. At least for reading the right documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; will do exactly what it says: if you edit anything inside the file and then click on that button, it will copy the file to the template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example: click on the file layout_global.twig, then just before the block content ( {% block content %}) add the text “TEST” and click the button. You can see that the label of the file changed from “inherited” to “local” and now the button is a simple button &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you open a file explorer and go to the directory upload/templates/extends_monochrome/views/, you will see that it contains only one file, the file layout_global.twig and that the string “TEST” is there.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  If you’re curious to know what it does, you can find it in the code here (version of RC3): [https://github.com/LimeSurvey/LimeSurvey/blob/f3737a75e428f604d68d2e5ba958f3eba3eba2e1/application/core/LS_Twig_Extension.php#L219-L237 image() function in RC3]&lt;br /&gt;
If you don’t understand the code: don’t worry, you don’t need to know how it works, but why to use it and how to use it.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* The function image loops through the template to find the image. If the template you’re working on is extended to another template, and if you copy the file to where you inserted the picture locally, but that picture is not copied in the local template, it will loop through the template inheritance tree to find where that picture is.&lt;br /&gt;
* It will use the asset manager, so it will improve the performance of your template. See the Yii Asset Manager documentation for more information about it: http://www.yiiframework.com/wiki/148/understanding-assets/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
When you open the options of a given template, you can choose between “simple options” and “advanced options”. “Advanced options” is just a naked form that gives you access to the main fields of the Template Configuration in the database. To understand how it works, you should also read all about the XML file and the creation of a template from scratch. So, it’s rather complex and made for advanced users.&lt;br /&gt;
[[File:Advanced.png|thumb|410px|center|&#039;&#039;the advanced options fields&#039;&#039;]]&lt;br /&gt;
*&#039;&#039;&#039;Files css&#039;&#039;&#039;: the CSS files that should be added to the template&lt;br /&gt;
*&#039;&#039;&#039;Files js&#039;&#039;&#039;: the JS files that should be added to the template&lt;br /&gt;
*&#039;&#039;&#039;Files Print Css&#039;&#039;&#039;: the CSS files to load when printing a template&lt;br /&gt;
*&#039;&#039;&#039;Options&#039;&#039;&#039;: the options (and their value) that should be parsed to the template view  &lt;br /&gt;
*&#039;&#039;&#039;CssFramework Name&#039;&#039;&#039;: The name of the CSS framework to load. For now, only Bootstrap or nothing.&lt;br /&gt;
*&#039;&#039;&#039;Cssframework Css&#039;&#039;&#039;: here, you can replace the core bootstrap.css by a different custom version of i&lt;br /&gt;
*&#039;&#039;&#039;Cssframework Js&#039;&#039;&#039;: here, you can replace the core bootstrap.js by a different custom version of it&lt;br /&gt;
*&#039;&#039;&#039;Packages To Load&#039;&#039;&#039;: here, you can load some core asset packages from LimeSurvey&lt;br /&gt;
&lt;br /&gt;
You’ll notice an upload input at the top, it gives you the possibility to upload a file into the file directory.&lt;br /&gt;
With those parameters, the entire appearance of the template can be changed. Of course, end users with no technical background should not directly use it.&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jelo</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Persona_Work_In_Progress&amp;diff=66586</id>
		<title>Persona Work In Progress</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Persona_Work_In_Progress&amp;diff=66586"/>
		<updated>2016-04-05T18:21:25Z</updated>

		<summary type="html">&lt;p&gt;Jelo: /* Personas: LimeSurvey Users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Personas: LimeSurvey Users=&lt;br /&gt;
&lt;br /&gt;
== 1. Executive Manager==&lt;br /&gt;
&lt;br /&gt;
img/wiki_up/exec_man.jpg&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Lou Matsumoto&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; &#039;&#039;Executive Manager&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039; &#039;&#039;Executive Manager&#039;&#039; in a bigger &#039;&#039;IT-Company&#039;&#039; called &#039;&#039;IT-Labs&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests:&#039;&#039;&#039;&amp;lt;br /&amp;gt;Lou has a wife and two little girls.&amp;lt;br /&amp;gt;Frustratingly the time he can spend with his family is strongly limited as he is often traveling all around the world meeting business partners.&amp;lt;br /&amp;gt;Because of him traveling his relationship is a permanent marriage crisis.&amp;lt;br /&amp;gt;In his few spare hours he is playing &#039;&#039;golf&#039;&#039; and &#039;&#039;go&#039;&#039; with friends and business partners (or both).&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039;&amp;lt;br /&amp;gt;Mostly working on a laptop in every kind of location, as i.e. office, airplane, hotel-room/-bar.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039;&lt;br /&gt;
# He has still some technical knowledge from his days as a student. But nowadays he is not interested in any technical detail.&lt;br /&gt;
# He is also not interested in statistical details on response calculations.&lt;br /&gt;
# His job is to make decisions (which is mostly based on his personal experience and company guidelines) and to stay informed about his clients.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
# Monitor responses (see whether results are still within certain boundaries)&lt;br /&gt;
# Query survey for the same reports&lt;br /&gt;
# Monitor the state of the survey (as how soon the survey will end, the latest results)&lt;br /&gt;
# Looking up responses from certain clients&lt;br /&gt;
# Occasionally he is building his report format using embedded LS tools&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
# The Software &#039;&#039;just has to work&#039;&#039; (any call for technical support is perceived as disturbance, no time to read manuals).&lt;br /&gt;
# It is important to him to monitor responses of his clients quickly.&lt;br /&gt;
# With limited time and technical knowledge he needs an interface with a steep learning curve (little time - high mastery level)(keyboard short cuts and other tweaks are pointless to him)&lt;br /&gt;
# Reports and Report configuration has to work on smaller notebook screens.&lt;br /&gt;
&lt;br /&gt;
=== Activity Scenarios===&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== 2. Marketing Manager==&lt;br /&gt;
&lt;br /&gt;
img/wiki_up/mark_man_2.jpg&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Stan Barber&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; &#039;&#039;Marketing Manager&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039;  Marketing Manager of &#039;&#039;Market Research&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests&#039;&#039;&#039;&amp;lt;br /&amp;gt;He is married and has one son.&amp;lt;br /&amp;gt;In his free-time he likes to hang out with his friends, playing poker.&amp;lt;br /&amp;gt;He is a very communicative person and talkes a lot.&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039;&amp;lt;br /&amp;gt;Mostly working in the office. Occasionally at home.&amp;lt;br /&amp;gt;A lot of time he is spending talking/mailing to customers. He also has a lot of meetings on the schedule.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039;&lt;br /&gt;
# No technical knowledge beyond Office and his CMS.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Gathering reports for executive managers&amp;lt;br /&amp;gt; most reports have to be delivered regularly with the same configuration&amp;lt;br /&amp;gt; additionally certain parameters have to be monitored and reported when they diverge from normal&lt;br /&gt;
# Statistics is not his profession, rather his boss is interested in nice looking figures, baselines and trends. (fancy eye-candy charting)&lt;br /&gt;
# Creating new surveys from time to time.&amp;lt;br /&amp;gt;These are often customer satisfaction surveys, but may also be used for &#039;&#039;internal&#039;&#039; data collection purposes.&lt;br /&gt;
# &#039;&#039;Note: This person is not installing/administrating the survey by himself.&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
# As reporting is the most time-consuming task it has to work quick and easy.&lt;br /&gt;
# Generating regular reports automatically.&lt;br /&gt;
# Nice charts to present to the boss.&lt;br /&gt;
# Easy MS-Office integration for the reports to prepare presentation material&lt;br /&gt;
# Large variety on question types to try new fancy questionnaires&lt;br /&gt;
# Easy, non technical usage of conditions for questions&lt;br /&gt;
# Less interested in psychological validity - randomization, standardized likert-types etc.&lt;br /&gt;
# Extensive Help - As he is not so actively participating in the community a good help - especially on the topic of reporting is important to him.&lt;br /&gt;
&lt;br /&gt;
=== Activity Scenarios===&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== 3. Survey Researcher/Developer==&lt;br /&gt;
&lt;br /&gt;
img/wiki_up/survey_res_fem.jpg&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Madeleine Holiday&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; &#039;&#039;Survey constructor&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039; User Researcher at &#039;&#039;Surveys-Online&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests:&#039;&#039;&#039;&amp;lt;br /&amp;gt;Studied Industrial Psychology &amp;lt;br /&amp;gt;Unfortunately, still single.&amp;lt;br /&amp;gt;She is usually working overtime.&amp;lt;br /&amp;gt; The remaining free-time is filled with meetings friends and playing with her dog &#039;&#039;sally&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039;&amp;lt;br /&amp;gt;She is working in a small office compartment.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039;&amp;lt;br /&amp;gt;She has limited knowledge about Webpublishing (html).&amp;lt;br /&amp;gt;She knows that a database is some special place to keep all the data in tables.&amp;lt;br /&amp;gt;Competent in survey research, test construction and statistical analysis.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Survey construction, implementation&lt;br /&gt;
# Data analysis&lt;br /&gt;
# Report generation&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Layouting/templating with limited technical knowledge&lt;br /&gt;
# As questionnaires often resemble each other, it is important for her to transfer her work from one survey to another&lt;br /&gt;
# Descriptive statistical analysis (mean values, frequency distributions, percentages)&lt;br /&gt;
# Several measures have to be combined into a report easily, including charts&lt;br /&gt;
# Responsive support - She needs support when setting up a new type of survey from time to time.&lt;br /&gt;
&lt;br /&gt;
== 4. Survey Admin==&lt;br /&gt;
&lt;br /&gt;
img/wiki_up/survey_developer.jpg&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Louis Parker&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; &#039;&#039;System administrator&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039; System administrator at Market Research&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests:&#039;&#039;&#039;&amp;lt;br /&amp;gt;He has a girlfriend for almost 10 years now.&amp;lt;br /&amp;gt;Classic geeky type of person.&amp;lt;br /&amp;gt;He is a fan of final fantasy and other computer games.&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039;&amp;lt;br /&amp;gt;He shares an office with 2 other SysAdmins in the basement of the company building. &amp;lt;br /&amp;gt;Works on a powerbook.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039;&amp;lt;br /&amp;gt;Louis knows all about Networks, Operating Systems, Databases.&amp;lt;br /&amp;gt;He hardly knows what a survey is, for him LimeSurvey is a webapp with a database backend.&amp;lt;br /&amp;gt;He just loges into LimeSurvey to setup user-accounts or when something in the app seems to be broken.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Installing/Setting up limesurvey.&lt;br /&gt;
# Creating User/Admin Accounts&lt;br /&gt;
# Connect LimeSurvey to repository of participants (as databases or LDAP)&lt;br /&gt;
# When people mess things up by doing strange things with the app, he is the one who has to fix it.&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Out-of-the-box installment&lt;br /&gt;
# It should just work like other webapps (1. extract the codebase, 2. setup and populate database, 3. configure webserver - done!)&lt;br /&gt;
# LimeSurvey has to be compatible with repositories of participants&lt;br /&gt;
# Reliability of the app and monitoring the state of the database (corrupt tables are a nightmare) - People should just not be able to mess up the application.&lt;br /&gt;
# Scalability, he has to administer one installation of LimeSurvey that includes many surveys and many people accessing this survey at the same time, while others administer other surveys and generate reports etc. (Maybe he even needs to cluster the database and webservers?)&lt;br /&gt;
# Responsive developer-community - he likes submitted bugs to be fixed soon.&lt;br /&gt;
# OpenSource App - When things are getting real bad, he wants to have an open source application to be able to fix bugs for himself&lt;br /&gt;
&lt;br /&gt;
== 5. Academic Scientist (Project Leader)==&lt;br /&gt;
&lt;br /&gt;
img/wiki_up/researcher.jpg&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Endogan Davis&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; Academic Scientist (Project Leader)&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039; &amp;lt;br /&amp;gt;Professor at the University of Heidelberg, Faculty of Developmental Psychology &amp;lt;br /&amp;gt;He is involved in a lot of studies conducted at his faculty.:&amp;lt;br /&amp;gt;State-aided projects, several BA-,MSc-,PhD-Thesis, own research projects&amp;lt;br /&amp;gt;He is mostly giving input in terms of project planning, experimental design and academic writing and &#039;&#039;not&#039;&#039; conducting studies (and surveys) himself.&amp;lt;br /&amp;gt;Although he has to monitor the research/survey progress.&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests:&#039;&#039;&#039;&amp;lt;br /&amp;gt; Married, 1 son.&amp;lt;br /&amp;gt; He lives in a one-family home outside the city.&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039; &amp;lt;br /&amp;gt;His Office at the University, or University Lab, occasionally computer rooms at conferences.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039; &amp;lt;br /&amp;gt;He has detailed domain knowledge in developmental Psychology. &amp;lt;br /&amp;gt;Expert knowledge of experimental design and survey research. &amp;lt;br /&amp;gt;Less technical knowledge of LimeSurvey itself. &amp;lt;br /&amp;gt;No computer experience beyond, office, powerpoint, email etc.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Monitor the state of a survey (how many participants?, Data summary)&lt;br /&gt;
# Although not implementing the survey himself, he insists on controlling every detail that could lead to experimental bias or artifacts i.e. &amp;lt;br /&amp;gt;randomization &amp;lt;br /&amp;gt;theming &amp;lt;br /&amp;gt;presentation timing&lt;br /&gt;
# He needs advanced features of experimental design as: &amp;lt;br /&amp;gt;random assignment to groups(control vs. treatment) &amp;lt;br /&amp;gt; &#039;&#039;TODO&#039;&#039;&lt;br /&gt;
# He wants to test surveys, his students implemented.&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Low Hardware Requirements (communication with the computing-center is rather limited and difficult)&lt;br /&gt;
# Low-Budget&lt;br /&gt;
# Quick monitoring of the survey status&lt;br /&gt;
# Testing facility to look at the survey his students prepared, and possibility to quickly tell them what has to be changed (i.e. hard-links to questions?)&lt;br /&gt;
&lt;br /&gt;
== 6. Academic Researcher==&lt;br /&gt;
&lt;br /&gt;
img/wiki_up/survey_res2.jpg&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Jonathan Shepp&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; &#039;&#039;Academic Survey Constructor&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039; &amp;lt;br /&amp;gt;Jonathan is working on his PhD thesis in the field of computer science. After each run of his experiments, he has appended a post-questionnaire to measure certain experimental variables.&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests:&#039;&#039;&#039; &amp;lt;br /&amp;gt;Has a girlfriend whom he met on a conference recently. Loves mountain biking, climbing and other outdoor activities&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039; &amp;lt;br /&amp;gt;He is working in a computer room for PhD-Students and in a lab where he runs his experiments.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039; &amp;lt;br /&amp;gt;Jonathan has an extensive computer/programming background.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# He has to set up LimeSurvey for himself on a computer in the lab.&lt;br /&gt;
# He needs to control the experimental environment carefully (i.e. controlling of error sources, randomization to avoid response bias)&lt;br /&gt;
# He has a lot of special needs to adapt the survey to particular experimental situations.&lt;br /&gt;
# He has different scientific tools to integrate into LimeSurvey (from brian: probably know about datavers and may want to decouple certain aspects of LS&#039;s out of the box settings ???)&lt;br /&gt;
# As the report functionality in LimeSurvey is not sufficient for doing statistical analysis, he needs to export his results in various formats as CSV, SPSS, SQL.&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Money is more critical than time&lt;br /&gt;
# He can also search for a workaround to achieve his special needs - it just has to be possible.&lt;br /&gt;
# To implement additional stuff he needs, a Plugin/API Interface is highly desired.&lt;br /&gt;
# He needs documented code and detailed support for questions concerning the source-code.&lt;br /&gt;
&lt;br /&gt;
== 7. Data Entry Agent==&lt;br /&gt;
* &#039;&#039;&#039;Name:&#039;&#039;&#039; &#039;&#039;Joanne Paperfill&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role:&#039;&#039;&#039; &#039;&#039;Data Typist&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039; &amp;lt;br /&amp;gt;Joanne is working in a marketing company which is doing combined online and field paper surveys. Her task is to enter the data of paper surveys which have been created in interviews with pedestrians on the street into the same survey that is done with people filling it online.&lt;br /&gt;
* &#039;&#039;&#039;Working environment:&#039;&#039;&#039; &amp;lt;br /&amp;gt;She is working in a little office room, only half-days.&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge:&#039;&#039;&#039; &amp;lt;br /&amp;gt;Joanne is a student or single mother, has basic Office knowledge and knows how to use a browser.&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
+Dataentry for the paper surveys&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey:&#039;&#039;&#039;&lt;br /&gt;
# Ease of Data Entry with according liability, she is working without the mouse wherever possible. Keyboard shortcuts are essential to be really fast on data entry.&lt;br /&gt;
# Time is important since she has only four hours each day. She needs to start and finishes her work on time&lt;br /&gt;
&lt;br /&gt;
== 8. LS Developer==&lt;br /&gt;
* &#039;&#039;&#039;Name&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Working environment&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 9. LS Survey Tester ==&lt;br /&gt;
* &#039;&#039;&#039;Name&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039;  Test surveys and gives feedback. &lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Working environment&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey&#039;&#039;&#039;  &amp;quot;Test surveys for glitches.  Be able to comment on every question via a textfield. Be able to skip groups/pages/questions. Be able to active/deactivate validation/conditions.  Be able to manipulate variables during runtime.&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Personas: LimeSurvey Takers=&lt;br /&gt;
&lt;br /&gt;
== Annonymous survey-taker==&lt;br /&gt;
* &#039;&#039;&#039;Name&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Working environment&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Aware survey-taker==&lt;br /&gt;
* &#039;&#039;&#039;Name&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Role&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Jobdescription:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Personal Info / private Interests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Working environment&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Background Knowledge&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Goals to accomplish with LimeSurvey&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Successfactors working with LimeSurvey&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jelo</name></author>
	</entry>
</feed>