<?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=Admin</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=Admin"/>
	<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/Special:Contributions/Admin"/>
	<updated>2026-08-10T16:31:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Using_regular_expressions&amp;diff=143443</id>
		<title>Using regular expressions</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Using_regular_expressions&amp;diff=143443"/>
		<updated>2019-06-28T10:04:28Z</updated>

		<summary type="html">&lt;p&gt;Admin: &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;
Regular Expressions must start and finish with a forward slash (&amp;quot;/&amp;quot;). You can find a good library of regular expressions at http://www.regexlib.net/. These patterns will almost always work if they are surrounded by forward slashes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
To test your regex you can [https://regex101.com/ use this regex tester].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
{{Note|To improve this wiki section, we kindly ask you to add your successfully tested regular expression(s) to provide a better understanding of this feature to the new LimeSurvey (potential) users.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text= Please note that all the below examples are written on one line!}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Important: Regular Expressions in conditions= &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Note that when using regular expressions in the condition editor, do NOT include the beginning and ending slash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Email validation= &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
Update (12/2018): Since these days domain names cannot only hold special characters like “ü” but also use more than 3 characters as domain name like .&#039;&#039;tech&#039;&#039; or .&#039;&#039;company&#039;&#039;, the below email regex only checks if “@” and “.” exists within the entered email address.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
/^.+?@.+?\..+$/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
At this outdated regex the domain name is limited to 3 characters which doesn&#039;t cover all available domains:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Postcodes= &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Australian postcodes:== &amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[0-9]{4}/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Brazilian postcodes== &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[0-9]{2}\.[0-9]{3}-[0-9]{3}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Canadian postcodes== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[a-zA-Z]\d{1}[a-zA-Z](\-| |)\d{1}[a-zA-Z]\d{1}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==US postal codes== &amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[0-9]{5}([- /]?[0-9]{4})?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the postal code to start with zero, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[0-9]{5}(?:-[0-9]{4})?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UK postcodes== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[A-Z][A-Z]?[0-9][A-Z0-9]? ?[0-9][ABDEFGHJLNPQRSTUWXYZ]{2}$/i&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Note that this is not very exact, and a more exact validation is much more complex. For example, see [https://stackoverflow.com/questions/164979/uk-postcode-regex-comprehensive StackOverflow answer] and [https://en.wikipedia.org/wiki/Talk:Postcodes_in_the_United_Kingdom#Regular_Expressions Wikipedia] for more information.&lt;br /&gt;
&lt;br /&gt;
==French postcodes== &amp;lt;!--T:133--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/(^[0-8]\d\d{3}$)|(^9[0-5]\d{3}$)|(^97[1-6]\d{2}$)|(^98[46-8]\d{2}$)/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
The above expression is very precise and it will check whether or not the French Department exists (first two digits), including overseas Departments and overseas Territories (DOM-TOM).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Phone numbers= &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==US phone numbers== &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[\(\)\.\- ]{0,}[0-9]{3}[\(\)\.\- ]{0,}[0-9]{3}[\(\)\.\- ]{0,}[0-9]{4}[\(\)\.\- ]{0,}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
This second option will match all phone Canadian and US phone numbers that include non-digit symbols including:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt; . ( ) - (space)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
This will allow you to match phone numbers which resemble below:&lt;br /&gt;
*(555)555 5555&lt;br /&gt;
*555.555.5555&lt;br /&gt;
*555 555 5555&lt;br /&gt;
*(555)-555-5555&lt;br /&gt;
*555-555-5555&lt;br /&gt;
*555555555&lt;br /&gt;
&lt;br /&gt;
==Australian phone numbers== &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
The following patterns match all various Australian mobile and landline phone numbers including with &amp;quot;+61&amp;quot; country prefix:&lt;br /&gt;
*(02) 9123 6535&lt;br /&gt;
*03 1234-5345&lt;br /&gt;
*0412 345 678&lt;br /&gt;
*+61 2 3456 789&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
But not:&lt;br /&gt;
* 234 3450 234&lt;br /&gt;
*a234 534 3432&lt;br /&gt;
*134567&lt;br /&gt;
*123456789013&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Brackets, white space and hypens are ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
The &#039;Very precise:&#039; versions listed here match against the first four or five digits in a number to ensure that they are valid Australian numbers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
The &#039;Not very precise:&#039; only match against the first and second digit so may allow invaid numbers.&lt;br /&gt;
&lt;br /&gt;
===All Australian phone numbers (mobile and landline - area code required)=== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^\(?(?:\+?61|0)(?:(?:2\)?[ -]?(?:3[ -]?[38]|[46-9][ -]?[0-9]|5[ -]?[0-35-9])|3\)?(?:4[ -]?[0-57-9]|[57-9][ -]?[0-9]|6[ -]?[1-67])|7\)?[ -]?(?:[2-4][ -]?[0-9]|5[ -]?[2-7]|7[ -]?6)|8\)?[ -]?(?:5[ -]?[1-4]|6[ -]?[0-8]|[7-9][ -]?[0-9]))(?:[ -]?[0-9]){6}|4\)?[ -]?(?:(?:[01][ -]?[0-9]|2[ -]?[0-57-9]|3[ -]?[1-9]|4[ -]?[7-9]|5[ -]?[018])[ -]?[0-9]|3[ -]?0[ -]?[0-5])(?:[ -]?[0-9]){5})$/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\+?61|0)[2-478](?:[ -]?[0-9]){8}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All Australian phone numbers (landlines only - area code required)=== &amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^\(?(?:\+?61|0)(?:2\)?[ -]?(?:3[ -]?[38]|[46-9][ -]?[0-9]|5[ -]?[0-35-9])|3\)?(?:4[ -]?[0-57-9]|[57-9][ -]?[0-9]|6[ -]?[1-67])|7\)?[ -]?(?:[2-4][ -]?[0-9]|5[ -]?[2-7]|7[ -]?6)|8\)?[ -]?(?:5[ -]?[1-4]|6[ -]?[0-8]|[7-9][ -]?[0-9]))(?:[ -]?[0-9]){6}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\+?61|\(?0)[2378]\)?(?:[ -]?[0-9]){8}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===New South Wales landline phone numbers (area code optional)=== &amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)2\)?[ -]?)?(?:3[ -]?[38]|[46-9][ -]?[0-9]|5[ -]?[0-35-9])(?:[ -]?[0-9]){6}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)2\)?(?:[ -]?[0-9]){7}[0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Victorian and Tasmanian landline phone numbers (area code optional)=== &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)3\)?[ -]?)?(?:4[ -]?[0-57-9]|[57-9][ -]?[0-9]|6[ -]?[1-67])(?:[ -]?[0-9]){6}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)3\)?(?:[ -]?[0-9]){7}[0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Queensland landline phone numbers (area code optional)=== &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)7\)?[ -]?)?(?:[2-4][ -]?[0-9]|5[ -]?[2-7]|7[ -]?6)(?:[ -]?[0-9]){6}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)7\)?(?:[ -]?[0-9]){7}[0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===South Australia, Northern Territory, Western Australia landline phone numbers (area code optional)=== &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)8\)?[ -]?)?(?:5[1-4]|6[0-8]|[7-9][0-9])$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)8\)?(?:[ -]?[0-9]){7}[0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Australian mobile phone numbers only=== &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
Very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\+?61|0)4 ?(?:(?:[01] ?[0-9]|2 ?[0-57-9]|3 ?[1-9]|4 ?[7-9]|5 ?[018]) ?[0-9]|3 ?0 ?[0-5])(?: ?[0-9]){5}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Not very precise:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:\(?(?:\+?61|0)4\)?(?:[ -]?[0-9]){7}[0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Belgian phone number== &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^((\+|00)32\s?|0)(\d\s?\d{3}|\d{2}\s?\d{2})(\s?\d{2}){2}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
==Belgian mobile phone number==&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^((\+|00)32\s?|0)4(60|[789]\d)(\s?\d{2}){3}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
==French phone number==&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^((\+|00)33\s?|0)[1-59](\s?\d{2}){4}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
==French mobile phone number==&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^((\+|00)33\s?|0)[67](\s?\d{2}){4}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
==Luxemburg phone number==&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^((\+|00\s?)352)?(\s?\d{2}){3,4}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
==Luxemburg mobile phone number==&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^((\+|00\s?)352)?\s?6[269]1(\s?\d{3}){2}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
=German marks (with optional plus or minus)=&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-6]{1}[\+|\-]?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Age validation= &amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
Example: Age 20-99&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/([2-9][0-9])/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
Example: Age 18-35&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/(1[8-9]|2[0-9]|3[0-5])/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
Example: Age 19-65&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(1[8-9]|[2-5][0-9]|6[0-5])$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Number validation= &amp;lt;!--T:138--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Numbers from 1 to 99999== &amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9])$/&amp;lt;/source&amp;gt;&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-9][0-9]{0,4}$/ does the same as above but should run a little faster&amp;lt;/source&amp;gt;&lt;br /&gt;
==Numbers from 1 to 999, 1.000 to 999.999 to 999.999.999==&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-9][0-9]{0,2}(?:\.[0-9]{3}){0,2}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
Accepts numbers from 1 to 999, 1.000 to 999.999 to 999.999.999 but&lt;br /&gt;
rejects numbers like 999.1.1 , 94.22.22, 999.1.22, 999.11.1, 999.1.333&lt;br /&gt;
&lt;br /&gt;
==Number validation with optional decimal (for price)== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
Accepts numbers from 0 to 199, with 2 decimal optional:&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^([1][0-9][0-9]|[1-9][0-9]|[0-9])((\.)[0-9][0-9])?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Number validation with thousand separator==&lt;br /&gt;
Space as separator, no minus&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?!0)\d{1,3}(\ \d{3})*$/&amp;lt;/source&amp;gt;&lt;br /&gt;
Dot as separator, minus allowed&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^-?(?!0)\d{1,3}(\.\d{3})*$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
It forces two decimal points and accepts numbers from 1.00 to 999,999,999.00 with an optional comma delimiting thousands/millions&lt;br /&gt;
including all of the following: 1.00, 1,000.00, 12,345.67, 12345,02, 123,456,468.00, 1234566.00, 123456789.00&lt;br /&gt;
but not 1,23.00, 12,3.4 or 1234,43.04&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-9][0-9]{0,2}(?:,?[0-9]{3}){0,3}\.[0-9]{2}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Similar to the above: Forces two decimal points but accepts a &amp;quot;0&amp;quot; before decimal separator &amp;quot;,&amp;quot;.&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/[0-9]{0,2}(?:,?[0-9]{3}){0,3}\.[0-9]{2}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
Same as above, but the two decimal points are optional:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-9][0-9]{0,2}(?:,?[0-9]{3}){0,3}(?:\.[0-9]{2})?$/ &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Month (1-12)== &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
If you want to ask for the month a person was born you can validate the input as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[0]*[1-9]$|^[0]*1[0-2]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Minimum width (set to 3 in this example)= &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^.{3,}$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Currency= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==US currency (dollar sign and cents optional)== &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^\$?\d+(\.(\d{2}))?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
Check for comma usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^\$?\d{1,3}(\d+(?!,))?(,\d{3})*(\.\d{2})?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swiss price== &amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
A number with two decimal numbers after the decimal point of which the last one is either a 5 or a 0:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(\d+)(\.\d(05)?)?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Validate score= &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==1-10== &amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-9]{1}$|^10$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==1-100== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[1-9]?[0-9]{1}$|^100$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Text validation= &amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
The [[Question type - Multiple short text|multiple short text question type]] doesn&#039;t support minimum or maximum answers at the moment. One way around this is to use a [[Question type - Long free text|long free text question type]] with a regular expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
The below expression tests for at least one word per line for at least 3 lines and no more than 10 lines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/(?:[^,.;:?!&amp;amp; \n\r]+(?: [^,.;:?!&amp;amp; \n\r]+)*)(?:[,.;:?!&amp;amp; \n\r]?(?:\n|\r|\n\r|\r\n)(?:[^,.;:?!&amp;amp; \n\r]+(?: [^,.;:?!&amp;amp; \n\r]+)*)){2,10}/is&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
If you want, say five words per line, you could change the first and last star/asterisk to {4,}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/(?:[^,.;:?!&amp;amp; \n\r]+(?: [^,.;:?!&amp;amp; \n\r]+){4,})(?:[,.;:?!&amp;amp; \n\r]?(?:\n|\r|\n\r|\r\n)(?:[^,.;:?!&amp;amp; \n\r]+(?: [^,.;:?!&amp;amp; \n\r]+){4,})){2,10}/is&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
If you wanted one or more words per line (between line 1 and line 5), you can change the content located within the last curly braces to &#039;&#039;&#039;0,4&#039;&#039;&#039; (note you use 0 because you&#039;re already matching the first line).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/(?:[^,.;:?!&amp;amp; \n\r]+(?: [^,.;:?!&amp;amp; \n\r]+)*)(?:[,.;:?!&amp;amp; \n\r]?(?:\n|\r|\n\r|\r\n)(?:[^,.;:?!&amp;amp; \n\r]+(?: [^,.;:?!&amp;amp; \n\r]+)*)){0,4}/is&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Word count== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
The following restricts the number of words allowed to a minimum of 1 and a maximum of 200:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^[-\w]+(?:\W+[-\w]+){0,199}\W*$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
To increase the minimum change the zero part of {0,199}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
To increase or decrease the maximum change the &amp;quot;199&amp;quot; part of {0,199}.&lt;br /&gt;
&lt;br /&gt;
=Time validation= &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are a number of ways to write time formats. Some of the possible options are 12 hour or 24 hour, with seconds or without. Although it is an option to use the [[Question type - Date|date question type]] (it can also capture time) you can use the [[Question type - Short free text|short free text question type]] with one of the below validation regular expressions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
The following three validation strings test for 24 hour time (in order of appearances) without seconds, with optional seconds lastly with seconds required:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:[01][0-9]|2[0-3]):[0-5][0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:130--&amp;gt;&lt;br /&gt;
The following three match 12 hour time, as above with seconds, optional seconds and with seconds required:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?&amp;quot;&amp;gt;00:[0-5][0-9] (?:am|AM)|(?:0[1-9]|1[01]):[0-5][0-9] (?:[ap]m|[AP]M)|12:[0-5][0-9] (?:pm|PM))$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:00:[0-5][0-9](?::[0-5][0-9])? (?:am|AM)|(?:0[1-9]|1[01]):[0-5][0-9](?::[0-5][0-9])? (?:[ap]m|[AP]M)|12:[0-5][0-9](?::[0-5][0-9])? (?:pm|PM))$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:00:[0-5][0-9]:[0-5][0-9] (?:am|AM)|(?:0[1-9]|1[01]):[0-5][0-9]:[0-5][0-9] (?:[ap]m|[AP]M)|12:[0-5][0-9]:[0-5][0-9] (?:pm|PM))$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
The following three match either 12 or 24 hour time as above with seconds, optional seconds and with seconds required:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:(?:00:[0-5][0-9] (?:am|AM)|(?:0[1-9]|1[01]):[0-5][0-9] (?:[ap]m|[AP]M)|12:[0-5][0-9] (?:pm|PM))|(?:[01][0-9]|2[0-3]):[0-5][0-9])$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:(?:00:[0-5][0-9](?[0-5][0-9])? (?:am|AM)|(?:0[1-9]|1[01]):[0-5][0-9](?[0-5][0-9])? (?:[ap]m|[AP]M)|12:[0-5][0-9](?[0-5][0-9])? (?:pm|PM))|(?:[01][0-9]|2[0-3]):[0-5][0-9](?[0-5][0-9])?)$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?:(?:00:[0-5][0-9]:[0-5][0-9] (?:am|AM)|(?:0[1-9]|1[01]):[0-5][0-9]:[0-5][0-9] (?:[ap]m|[AP]M)|12:[0-5][0-9]:[0-5][0-9] (?:pm|PM))|(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=US states= &amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To validate for one state use the following (example is Texas):&lt;br /&gt;
*TX uppercase only: &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(TX)$/&amp;lt;/source&amp;gt;&lt;br /&gt;
*tx lowercase only: &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(tx)$/&amp;lt;/source&amp;gt;&lt;br /&gt;
*TX upper or lowercase: &amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^([T|t][X|x])$/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Profanity Filter= &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
To filter profanity words from an answer:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;/^(?i)((?!\bENTERPROFANITYHERE\b).)*$(?-i)/&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
Replace &amp;quot;ENTERPROFANITYHERE&amp;quot; with your bad word.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
The \b will allow passing of words such as &amp;quot;assassination&amp;quot; and &amp;quot;hello&amp;quot; if you enter &amp;quot;ass&amp;quot; or &amp;quot;hell&amp;quot; as your profanity word. This also works if you are trying to omit other words, names etc. from answers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Helpful links= &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
In the beginning of this wiki section, we recommend you to use https://regex101.com/ to test/create regular expressions. You can also use https://www.regextester.com/ to create expressions in case you are unhappy about the first option.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=QS:Relevance&amp;diff=57535</id>
		<title>QS:Relevance</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=QS:Relevance&amp;diff=57535"/>
		<updated>2013-10-10T08:04:57Z</updated>

		<summary type="html">&lt;p&gt;Admin: AL-HARBI:HACKER&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relevance equation=== &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
{{FeatureStarting|v=1.92}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
All questions let you specify a relevance equation.  This is the successor to conditions and support much more complex conditional logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Syntax Highlighting&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Whenever you save the relevance equation, it will be evaluated and syntax-highlighted.  Any errors will be color coded so that you can quickly detect and fix them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Valid values&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Any equation, using [[Expression Manager|Expression Manager]] syntax, without surrounding curly braces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Examples&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Here are good examples of [[Expression Manager HowTos#Syntax Highlighting|syntax highlighting]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
[[Category:Question Settings]][[Category:Core Question Settings]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
xv1@Outlook.sa&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Project_Ideas_for_GSoC_2013&amp;diff=2532</id>
		<title>Project Ideas for GSoC 2013</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Project_Ideas_for_GSoC_2013&amp;diff=2532"/>
		<updated>2013-03-11T21:19:49Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Welcome=&lt;br /&gt;
&lt;br /&gt;
Welcome Google Summer of Code Student aspirants (:razz:)&lt;br /&gt;
&lt;br /&gt;
This page lists project ideas developed by the LimeSurvey Community. These tend to be areas that will get the most support as projects since they have been developed by people who know the project and what it needs the most. &#039;&#039;&#039;However&#039;&#039;&#039;, if you have your own idea for a project discuss your awesome idea with us in our [http://www.limesurvey.org/en/forum forums], [https://lists.sourceforge.net/lists/listinfo/limesurvey-developers mailing list] or at [http://www.limesurvey.org/en/support/live-chat #limesurvey on irc.freenode.net]. Then submit your proposal. Good Luck (:biggrin:)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Project ideas=&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Refactor all question types to a modular OOP format==&lt;br /&gt;
&lt;br /&gt;
If you look at the LimeSurvey source code (yii branch) you will notice that the code for the question types is strewn across the application.&lt;br /&gt;
&lt;br /&gt;
The goal of this task is to rewrite all question types to be objects, primarily inherited from one or more base question objects. A question type should have methods for display (several types of display like front ent/printable survey), response saving, configuration, statistics, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
*Extensive knowledge of PHP &amp;amp; Yii framework&lt;br /&gt;
*Very good kownledge of LimeSurvey inner workings&lt;br /&gt;
*Very good OOP knowledge&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
*Hard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Carsten Schmitz (c_schmitz)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Implement a fully featured XML-RPC API + API tests + unit test==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey urgently needs an API so all administration functions (and later even survey-taking functions) can be accessed without using the GUI. In addition you will be implementing an according unit test framework and implement unit &amp;amp; API tests across the whole application so we can make sure at any point in the development process that the application is functioning as it should.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
*Good PHP, SQL, Yii knowledge&lt;br /&gt;
*Good knowledge of the LimeSurvey administration and code&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
*Hard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
c_schmitz&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==User Interface Improvements and Backend Tidy Ups==&lt;br /&gt;
&lt;br /&gt;
Help improve LimeSurvey&#039;s usability and flexibility through a range of small tasks such as:&lt;br /&gt;
* develop improved &#039;bulk&#039; question handling UI&lt;br /&gt;
* Tidy up input values on public surveys by moving required values from html inputs to javascript variables&lt;br /&gt;
&lt;br /&gt;
The idea is to provide ways of updating and modifying multiple questions, or multiple groups in one go. Often in a survey a user will need to make parallel changes to 5 or 6 questions all at once across a range of different groups. Being able to select various elements of questions, and then select a range of questions to edit would dramatically improve LimeSurvey&#039;s usability from the administrators perspective.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PHP, SQL, Yii, Authentication protocols (openID, CAS, LDAP-bind, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Medium&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Jason Cleeland (jcleeland)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Implement a plugin framework for authentication/languages/ import/export modules==&lt;br /&gt;
&lt;br /&gt;
The idea is to design and implement a modular &amp;quot;framework&amp;quot; for LimeSurvey as well as convert the existing functionality to according modules. The framework will define the API each plugin type must (or may) implement and propose basic methods that can be used by plugins (for instance how to store the plugins parameters in DB, etc.).&lt;br /&gt;
&lt;br /&gt;
The plugin framework should be in parts similar to the framework used by Joomla (XML description files in the plugin packages)&lt;br /&gt;
&lt;br /&gt;
Example description for authentication moduls:&lt;br /&gt;
&lt;br /&gt;
Currently authentication is only used for the survey-administration GUI and not the participants interface (tokens are used for this). With the new authentication framework it should be possible to define several authentication backends for frontend (survey participation) and backend (administration)&lt;br /&gt;
&lt;br /&gt;
A generic authentication framework must define the following services:&lt;br /&gt;
* User authentication: this interface must return the identity of the authenticated user if authentication is successful.&lt;br /&gt;
** Authentication may not always be based on a simple user/password form, so the proposed framework must be generic enough to enable authentication based on other schemes (using any numbers or interaction-pages between the server and the end-user or any other contextual parameter such as Referrer, session variable...&lt;br /&gt;
* User provisioning:&lt;br /&gt;
** when activated on the survey administration interface, an authentication module might be able to create a newly authenticated user into the LimeSurvey internal DB (which is required for setting the user rights on the platform). The newly created user can be assigned a default profile or a per-user profile (queried from an external database).&lt;br /&gt;
** when activated on the participants interface, the authentication module will provision the token table of the corresponding survey // alternatively the general-purpose cross-survey participants-database as described in the above GSoC idea.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PHP, SQL, Yii&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
c_schmitz&lt;br /&gt;
&lt;br /&gt;
Diogo Gon&amp;amp;ccedil;alves (dionet)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Want to know more&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please read the [http://docs.limesurvey.org/tiki-index.php?page=GSOC+2010++Authentication+framework#FAQ FAQ about this project]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Custom Report Generation==&lt;br /&gt;
&lt;br /&gt;
The task is to make a module which will generate custom reports. Module should be able to do these things(at least) :-&lt;br /&gt;
*Creating various types of reports i.e. using tables, pie charts, graphs and bar-charts to name few.&lt;br /&gt;
*The resulting charts and other illustrations should be easy to read and understand, and should include the ability to export into standard office suites.&lt;br /&gt;
*Reports can be general or survey specific.&lt;br /&gt;
**General in the sense that it should show basic findings of a general survey graphically like number of users completing the survey, average time taken to complete the survey, average number of correct responses etc.&lt;br /&gt;
**Survey specific results should also be addressed properly e.g. how many users choose first option as there answer of a particular question, how many users didn&#039;t answer a specific question etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
OOP experience in PHP and experience with a PHP framework like CakePHP or CodeIgniter, jQuery. Strong mathematical background will help!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Moderate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Carsten Schmitz (c_schmitz)&lt;br /&gt;
&lt;br /&gt;
Jason Cleeland (jcleeland)&lt;br /&gt;
&lt;br /&gt;
Diogo Gon&amp;amp;ccedil;alves (dionet)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Adding new questions/subquestions and groups dynamically==&lt;br /&gt;
&lt;br /&gt;
Currently in LimeSurvey once a survey is activate we can not&lt;br /&gt;
*Add or delete groups&lt;br /&gt;
*Add or delete questions&lt;br /&gt;
*Add or delete subquestions or change their codes&lt;br /&gt;
&lt;br /&gt;
The idea is to cover these shortcomings. And in addition, all those participants who have already taken that survey must also be notified about the changes. You should also work out in detail what happens to existing results when a survey is changed that way.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Experience with the PHP framework Yii and knowledge of inner working of LimeSurvey is must!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Moderate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Jason Cleeland (jcleeland)&lt;br /&gt;
&lt;br /&gt;
Diogo Gon&amp;amp;ccedil;alves (dionet)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Enhance Expression Manager==&lt;br /&gt;
&lt;br /&gt;
Starting with LimeSurvey 1.92, all of the front-end (survey-taking) processing is now managed using Expression Manager (EM).  EM implements a safe subset of PHP syntax so that authors can write complex equations.  It is integrated into LimeSuvey to control navigation (branching via relevance), validation, and tailoring/piping of content.  Although it is quite powerful, users are already asking for enhancements.&lt;br /&gt;
#Add a GUI for Expression Manager&lt;br /&gt;
**Background:  LimeSurvey has a nice GUI for building conditions, but it does not support complex equations such as those available within EM.  EM does have robust syntax highlighting after an equation is saved, which makes it easy to fix any syntax errors.  Hoever, users would like a GUI to ease authoring of equations.&lt;br /&gt;
**Strategy - use CodeMirror - see [http://bugs.limesurvey.org/view.php?id=5279 here]&lt;br /&gt;
***Create CodeMirror syntax file to do appropriate syntax highlighting (use C as base language), ensuring that CodeMirror knows the set of valid operators&lt;br /&gt;
***Use CodeMirror API to let it know the names of registered function and variable names&lt;br /&gt;
***Utilize auto-complete, ideally letting users see and choose among the availalbe function  syntaxes (e.g. when a function can take several paameters).&lt;br /&gt;
***Auto-completion of variable names should show the question and question type to make it easier for users to pick the correct variable.&lt;br /&gt;
#Support sub-question-level Relevance&lt;br /&gt;
**Background:  EM already supports user-entered relevance equations at the group and question levels.  It also generates sub-question-level relevance for features like array_filter.  Users would like to be able ot add additional relevance criteria at the sub-question level.&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Add a relevance column to the display of sub-questions, and ensure entered relevance is saved the to database (the data model is already OK)&lt;br /&gt;
***Refactor createFieldMap() (or its successor) to read sub-question-level relevance into the run-time data structures so that passed to EM&lt;br /&gt;
***Enhance EM&#039;s sub-question-level data structures to hold sub-question-level releavance&lt;br /&gt;
***Update EM&#039;s _ValidateQuestion() and JavaScript generation functions to AND any manually-entered sub-question-level relevance equations with that auto-generated for array_filter and array_filter_exclude&lt;br /&gt;
***Update ShowSurveyLogicFile() to show sub-question-level relevance equations ***Rigorously unit and regresssion test these changes.&lt;br /&gt;
#Add Sub-question-level Validation&lt;br /&gt;
**Background:  The question-level validation supports regular-expression-based validation of each sub-question.  Users would like to have sub-question-level validation to implement things like a question for collecting user contact information, where there are different validation criteria for address parts (e.g. city, state, postal code) and phone numbers.&lt;br /&gt;
**Strategy:  Similar to sub-question-level relevance&lt;br /&gt;
***Add data entry fields for regular expression validation at the sub-question level, and ensure saved to database (which already has a preg field at the sub-question level)&lt;br /&gt;
***Ensure EM gets access to the new preg values (via upgrade to createFieldMap)&lt;br /&gt;
***Upgrade EM _ValidateQuesation() and function for generation of validation equations to include these new critiera.  EM already supports validation at the sub-question level (and changes the CSS style to show fields that fail this validation)&lt;br /&gt;
***Upgrade ShowSurveyLogicFile() to show sub-question-level validation rules&lt;br /&gt;
***Rigorously unit and regresssion test these changes.&lt;br /&gt;
#Add Sub-question-level mandatory criteria&lt;br /&gt;
**Background:  Many users have asked, via the forums, for ways to make parts of a multi-part questions mandatory, but make other parts optional.  LimeSurvey already provides many options, such as minimum and maxium numbers of answers; but users have asked for more fine-grained control, and currently can only achieve that via custom JavaScript.&lt;br /&gt;
**Strategy:  Similar to sub-question-level relevance&lt;br /&gt;
***Add checkbox to indicate mandatory status at the sub-question level&lt;br /&gt;
#Add native support for input-masks at the question and sub-question level&lt;br /&gt;
**Background:  One of the commonly used work-arounds deals with input masks, such as the jQuery meimomask plugin.&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Add mask attribute at question and sub-question level&lt;br /&gt;
***Have EM generate needed JavaScript code to create and manage those masks&lt;br /&gt;
#Add EM reporting functions (tables)&lt;br /&gt;
**Background: There is commonly request for enhancemnt of the print answers table at the end of the survey.  Some users want to generate custom reports mid-survey.&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Implement showAllResponsesExcept(attributeList,attributeTitleList,questionList) function.  questionList = 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;
***Implement showTheseResponses(attributeList,attributeTitleList,questionList) function. questionList = 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;
#Add better EM support for operations on array type questions&lt;br /&gt;
**Background:  Many of the EM validation rules are effectively statements like count the number of empty sub-questions, or sum the values of the sub-questions.  EM generates these functions itself, so there is no burden on the user, even if there ar dozens of sub-quetions.  However, manual editing of these questions is cumbersom. Users could benefit from special variables to access all of the elements of a question so that they could write functions like (sum(this) == 10)) and have it be expanded to (sum(q1_1, q1_2, ..., q1_N) == 10).  Note, there is already a &amp;quot;this&amp;quot; variable, but it does not apply to sub-questions.&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Extend EM so that &amp;quot;this&amp;quot; variable gets expanded into a comma separate list of sub-question references if there are sub-questions.  Have this expansion carry the suffix, so this.valueNAOK would become q_1.valueNAOK, q_2.valueNAOK, ..., q_N.valueNAOK.&lt;br /&gt;
***This macro expansion should occur in group.php (e.g. in the process of generating JavaScript), rather than having this variable be resolved at run-time within JavaScript.&lt;br /&gt;
***Provide similar array-expansion macros for all variables (not just &amp;quot;this&amp;quot;) - such as qcode_vars.*.  This would also functions like sum(qcode_vars.NAOK), count(qcode_vars.NAOK), implode(&#039; &#039;, qcode_vars.valueNAOK)&lt;br /&gt;
***For questions with comments, create macros like qcode_vars_nc and qcode_vars_oc for no-comments and  only-comments&lt;br /&gt;
***For arrays that might need row or  column-level processing, create aliases  like qcode_rowname_vars and qcode_colname_vars so can expand each.  This would let us replace the current system for generating row and column sums with equations like sum(qcode_rowname_vars.NAOK) and be sure that the sums will honor array_filter and array_filter_exclude.&lt;br /&gt;
#Add EM functions to validate data entry against value sets managed by Enterprise Vocabulary Systems&lt;br /&gt;
**Background:  Healthcare and biological sciences increasing use large controlled vocabularies, terminologies, or ontologies.  Data entry systems for such domains require validation against those vocabularies.  Large open-source projects, like [https://cabig.nci.nih.gov/community/tools/LexEVS_Server LexEVS] and [http://apelon.com/Products/DTS/tabid/97/Default.aspx Apelon DTS] provide open APIs to access that content.  Such tools let one validate diagnostic codes, and even do incremental search into those vocabularies as one types.  The main open projects are standardizing on the [http://hssp.wikispaces.com/cts2 CTS-2] (Clinical Terminology Services-2) specification.&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Create EM-compatible PHP and JavaScript functions to access CTS-2 compliant EVS systems&lt;br /&gt;
***Should include question and sub-question-level validation rules to validate the final entry.  Currently, thre are em_validation_q and em_validation_sq advanced quation attributes for validating questions and sub-questions based upon calls to external functions.  It may be desirable to support custom sub-question-level validation to validate each sub-question against different value sets.  If so, can follow the model of adding sub-question-level validation and relevance.  Alternatively, may be desirable to add sub-question-level advanced question options (if LimeSurvey community feels that there may be enough such extensions that such customization should be stored in a general attribute table rather than making the questions table wider).&lt;br /&gt;
***Should also include ability to do incremetal searches into the value sets&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PHP, SQL, PHP Debugging (e.g. xdebug), Yii, LimeSurvey&#039;s Expression Manager and code-base in general&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Medium to Hard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Thomas White (TMSWhite)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Optimize LimeSurvey for Long Surveys (and better performance and maintenance in general)==&lt;br /&gt;
&lt;br /&gt;
Although LimeSurvey is excellent for short and mid-length surveys, it is not optimized for surveys with hundreds or thousands of questions - such as those used by epidemiologists or in clinical trials.  This project would tackle each of those main limitations.  Those sub-tasks, and the development strategy include:&lt;br /&gt;
#Support for more than 1000 database columns&lt;br /&gt;
**Background: LS creates a horizontal table for survey data collection, and such tables often are limited to at most 1000 columns&lt;br /&gt;
**Strategies:&lt;br /&gt;
***Remove unneeded columns from horizontal table (e.g. type &#039;X&#039;)&lt;br /&gt;
***Conditionally remove unneeded equation columns (e.g. let users specify a prefix for variable names that should not be stored)&lt;br /&gt;
***Add option for Entity Attribute Value data model for data collection (which can support unlimited number of columns.  See details [http://bugs.limesurvey.org/view.php?id=5289 here].&lt;br /&gt;
#Memory and Code Optimization&lt;br /&gt;
**Background: LS loads the survey definition data model into several different data structures, such that it uses at least twice as much storage as it really needs.  Expression Manager now holds all of the instrument definition data, so the other data stores are no longer needed.&lt;br /&gt;
**Strategy&lt;br /&gt;
***Remove need for buildsurveysession() - gap analysis to add in any missing content to EM&lt;br /&gt;
***Remove need for createFieldMap() - similar gap analysis&lt;br /&gt;
***Normalize EM data structures to avoid internal duplication (and refactor code to use normalized structures) (and document new data structures so that future developers know which to use, and how to use them)&lt;br /&gt;
****gInfo - renaming of groupSeqInfo, plus add missing group-level attributes (relevance, description)&lt;br /&gt;
****qInfo - renaming of questionSeq2relevance, plus add any missing attributes from $fieldarray; remove aid, sqid; move grelevance to gInfo&lt;br /&gt;
****aInfo - for storing answer arrays?&lt;br /&gt;
****sqInfo - renaming of q2subqInfo, indexed on sgqa(?); remove content gleaned from gInfo and qInfo&lt;br /&gt;
****gStatus - renaming of indexGseq - make hold only dynamic values; so move gtext and gname to gInfo; also remove gRelInfo, keeping any unique variables it contains&lt;br /&gt;
****qStatus - renaming of indexQseq - make hold only dynamic values; so move qtext, qhelp, gtext, gname to qInfo&lt;br /&gt;
****sqStatus - renaming of subQrelInfo - make hold only dynamic values&lt;br /&gt;
****groupRelevanceInfo - consolidate into indexGseq?&lt;br /&gt;
****knownVars - instead of copying content, use reference to gInfo and qInfo (e.g. remove question, relevance, grelevance, qcode, ansList, ansArray, onlynum).&lt;br /&gt;
****varNameAttr - remove; generate on the fly from gInfo, qInfo, and knownVars&lt;br /&gt;
****alias2varName - remove; generate on the fly from knownVars&lt;br /&gt;
***Refactor EM so that stores normalized copies of secondary language text&lt;br /&gt;
***Optionally load only current group for each page transition rather than holding entire survey definition in memory&lt;br /&gt;
***Refactor EM for consistent variable naming&lt;br /&gt;
****e.g. questionId =&amp;gt; qid; groupNum =&amp;gt; gid; groupSeq =&amp;gt; gseq; questionSeq =&amp;gt; qseq&lt;br /&gt;
#Run-Time Performance Optimization&lt;br /&gt;
**Background:  qanda.php loads the content to create the questions and answers.  It used to do this by separate database queries per question.&lt;br /&gt;
**Strategy&lt;br /&gt;
***Refactor qanda.php to remove queries (like for &amp;quot;other&amp;quot;, or sub-question text) - have it get that information from EM&lt;br /&gt;
***Refactor LS so that language switching does not require a re-load of the core logic, but just the new language content  (and that it gets this from EM)&lt;br /&gt;
***Refactor replacements.php and EM&lt;br /&gt;
****Should only need to call replacements.php once per page, so set those valeus as locally static in EM per page.&lt;br /&gt;
****Refactor group.php to pass {QUESTION_*} via replacements array, rather than as globals passed to templatereplace&lt;br /&gt;
#Design-Time Performance Optimization&lt;br /&gt;
**Background:  LS used to only load the information from the data model that was needed for the given question or group.  EM had to load the entire data model to properly syntax highlight everything.  This can lead to some performance degradation in very long surveys&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Add methods to EM to just load changes to model as questions or groups are added, removed, or updated&lt;br /&gt;
***Pass those updates into EM internals so that syntax highlighting continues to be correct&lt;br /&gt;
***Ensure that admin pages only call the subset of EM functions needed to do accurate syntax highlighting.&lt;br /&gt;
#Optimizations for Rapid Development&lt;br /&gt;
**Background:  LS has a nice GUI for editing single questions at a time.  However, it is not optimized to make changes to multiple questions at a time.  Some competitor systems let authors design surveys using an Excel template (e.g. so that they can do bulk find and replace, or easily copy similar portions or answer lists).  Short of a full-blown AJAX-enabled admin system, this has the highest throughput potential&lt;br /&gt;
**Strategy:&lt;br /&gt;
***Create an Excel data model that would work for importing surveys&lt;br /&gt;
***Create import and validation routines from that model&lt;br /&gt;
***A similar model, which could be extended for LS, is noted [http://bugs.limesurvey.org/view.php?id=5105 here].&lt;br /&gt;
#Performance Validation&lt;br /&gt;
**Load test surveys of varying lenghts&lt;br /&gt;
**Identify performance and memory bottlenecks&lt;br /&gt;
**Idenfity minimum memory requirements for certain survey lengths and concurrent user volumes&lt;br /&gt;
**Propose strategy to overcome those performance issues&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PHP, SQL, PHP Debugging (e.g. xdebug), Yii, LimeSurvey&#039;s Expression Manager and code-base in general, Load testing tool (e.g. webload), PHP Profiler&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Medium to Hard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Thomas White (TMSWhite)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Idea template==&lt;br /&gt;
&lt;br /&gt;
Describe the idea here in general terms&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Explain what sort of coding skills would be needed for a student to implement this project&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Explain the level of difficulty involved&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Probable Mentors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Put your name (and tag) here if you are willing to mentor a student for this idea&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=More information=&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
[[GSoC getting started|Check out our &#039;Get started&#039; page]] for setting up the development environment, coding standards, and all the other important stuff that you need to know before the real fun begins!&lt;br /&gt;
&lt;br /&gt;
==Frequently Asked Questions==&lt;br /&gt;
&lt;br /&gt;
Check out [[GSoC FAQ|our GSoC FAQ page.]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Survey_settings&amp;diff=4106</id>
		<title>Survey settings</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Survey_settings&amp;diff=4106"/>
		<updated>2013-03-08T21:04:41Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Additional pages:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
To create a new survey, click on the Add button [[File:add.png]] on the right side of the administration button bar and a &amp;quot;Create New Survey&amp;quot; screen will appear. You can edit most of these settings later again by click the &#039;Edit survey settings&#039; icon [[File:token_manage_30.png]] in the &#039;Survey properties&#039; dropdown menu of the survey toolbar.&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
&lt;br /&gt;
All survey settings and functions are organized in tabs. The following is a description of each tab and field.&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
#&#039;&#039;&#039;Base language&#039;&#039;&#039;: This sets the base language for the survey. Once saved, you cannot change it later. The language-set is the base language for possible translations of the survey. That way you can have multilingual surveys. During survey creation you cannot add additional languages. You will be able do that if you edit the survey properties again, later.&lt;br /&gt;
#&#039;&#039;&#039;Title&#039;&#039;&#039;: This is the brief descriptive name of the survey (ie: &amp;quot;Enterprise Bargaining Survey 2003&amp;quot;, or &amp;quot;Views on Ice Cream&amp;quot;). This title will be displayed on every page of the public survey.&lt;br /&gt;
#&#039;&#039;&#039;Description&#039;&#039;&#039;: This allows you to enter a description of the survey. (ie: &amp;quot;A survey to collect your ideas on the next round of enterprise bargaining&amp;quot; or &amp;quot;A survey to find out the popularity of chocolate ice cream&amp;quot;). You can incorporate HTML elements such as images or videos in this section using the WYSIWYG editor. By default, description is used on invitation email.&lt;br /&gt;
#&#039;&#039;&#039;Welcome message&#039;&#039;&#039;: This allows you to enter a message that will display when a participant first logs into your survey. (ie: &amp;quot;Thank you for taking the time to participate in this survey..&amp;quot;) You can incorporate HTML elements such as images or videos in this section using the WYSIWYG editor.&lt;br /&gt;
#&#039;&#039;&#039;End message&#039;&#039;&#039;: This allows you to enter a message that will display when a participant completes your survey. (ie: &amp;quot;Thank you for completing our survey. We will publish results soon.&amp;quot;). You can incorporate HTML elements such as images or videos in this section using the WYSIWYG editor.&lt;br /&gt;
#&#039;&#039;&#039;End URL&#039;&#039;&#039;: This URL will be presented as a link at the end of the survey, and allows you to direct your participants back to your home page (or, in fact, anywhere). The End URL has to be entered with &amp;quot;http://&amp;quot; at the beginning, eg. http://www.limesurvey.org. &amp;lt;br/&amp;gt;You can use they placeholder {SAVEDID}, {TOKEN}, {SID} and {LANG} in this URL.&amp;lt;br/&amp;gt;SAVEDID is the id assigned to this particular submission, TOKEN is the token used to participate in the survey, SID is the survey ID and LANG is the language code&amp;lt;br/&amp;gt;eg. http://www.limesurvey.org/test.php?var1={SAVEDID}&amp;amp;var2;={TOKEN}&amp;amp;var3;={SID}&amp;amp;lang;={LANG} &amp;lt;br/&amp;gt;From version 1.82+ you can use [[URL fields]] with this field to pass parameters from the start URL to then end URL. &amp;lt;br/&amp;gt;You can also use {INSERTANS:SGQA} in this URL (since 1.82+). This allows adding the response to a specific question in the survey to the final url. This can be useful for sending a response to an external script (ie an email address collected during the survey). eg: &amp;quot;http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}&amp;quot;&lt;br /&gt;
#&#039;&#039;&#039;URL description&#039;&#039;&#039;: The description for the link using the End URL.&lt;br /&gt;
#&#039;&#039;&#039;Administrator&#039;&#039;&#039;: This is the name of the contact person who administers the survey. It will be included in emails sent out inviting participants to respond.&lt;br /&gt;
#&#039;&#039;&#039;Admin email&#039;&#039;&#039;: This is the email address of the administrator (as above) and is used as the &#039;reply to:&#039; address on any emails sent. You can also enter several email addresses separated with a semicolon - that way survey administrator notifications are sent to more than one person. (Example: &amp;quot;firstaddress@test.com;secondaddress@test.com&amp;quot;)&lt;br /&gt;
#&#039;&#039;&#039;Bounce email&#039;&#039;&#039;: This is the email address where a delivery error notification email should be sent. By default, this is the same as the administrator&#039;s email address. If you want to use a custom script to parse delivery error emails, then use a special Bounce Email address here and automatically process emails reaching this address with your script. This script could then update the Email Status field of the token line corresponding to this email address (see tokens).&lt;br /&gt;
#&#039;&#039;&#039;Fax to&#039;&#039;&#039;: This field is used to give a fax number on the &amp;quot;printable survey&amp;quot; - ie: when you want to send someone a hard copy because they cannot use the online survey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Caution&#039;&#039;&#039;: the HTML WYSIWYG editor doesn&#039;t allow you to upload files during the survey creation process. Trying to do so will end up with an error message like: &amp;quot;&#039;&#039;This file uploader is disabled&#039;&#039;&amp;quot;. If you need to upload pictures or any other ressources, please do so after survey creation, by editing the newly created survey.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Presentation &amp;amp; navigation==&lt;br /&gt;
#&#039;&#039;&#039;Format&#039;&#039;&#039;: Choose from &amp;quot;Question by question&amp;quot;, &amp;quot;Group by group&amp;quot; or &amp;quot;All in one&amp;quot;.&lt;br /&gt;
**&#039;&#039;&#039;Question by Question&#039;&#039;&#039;: Public survey will display one question per page.&lt;br /&gt;
**&#039;&#039;&#039;Group by Group&#039;&#039;&#039;: Public survey will display all questions in a group per page. Group at a time surveys still have a separate &amp;quot;welcome&amp;quot; page and &amp;quot;submit&amp;quot; page, like &amp;quot;One at a time&amp;quot; surveys.&lt;br /&gt;
**&#039;&#039;&#039;All in one&#039;&#039;&#039;: Public survey will display all questions in one single page. Activated All in one surveys do not have a &amp;quot;welcome&amp;quot; page or &amp;quot;submit&amp;quot; page - the welcome message and submit button all appear on the same page.&lt;br /&gt;
#&#039;&#039;&#039;Template&#039;&#039;&#039;: Choose from the installed templates in your system. The default template is rather dull, but functional. More information on creating your own templates is available in the LimeSurvey [[Templates / The Template Editor]] Guide.&lt;br /&gt;
#&#039;&#039;&#039;Show welcome screen&#039;&#039;&#039;:  Yes/No. If Yes, then the welcome message defined in Text Elements section will be displayed.    Default is Yes.&lt;br /&gt;
#&#039;&#039;&#039;Navigation delay&#039;&#039;&#039;:  Number of seconds before Previous and Next buttons are enabled.   Default 0 seconds&lt;br /&gt;
#&#039;&#039;&#039;Show &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;&amp;lt;&amp;lt; Prev] button&#039;&#039;&#039;: This option defaults to yes, however if you set it to &amp;quot;No&amp;quot; then users will not have the option of moving to a previous page while completing the survey.&lt;br /&gt;
#&#039;&#039;&#039;Show question index / allow jumping&#039;&#039;&#039;:  Yes/No. Default No.  When Yes, an index will be displayed on the right side.    Users can jump to any section in the survey.&lt;br /&gt;
#&#039;&#039;&#039;Keyboard-less operation&#039;&#039;&#039;: By activating this setting there will be a virtual keyboard available for certain question types.&lt;br /&gt;
#&#039;&#039;&#039;Show progress bar&#039;&#039;&#039;: Yes/No.  Default Yes.   Allow the administrator to turn off the Progress bar&lt;br /&gt;
#&#039;&#039;&#039;Participants may print answers?&#039;&#039;&#039;: This option defaults to no. When it is set to yes, a participant can print a summary of responses at submit time.&lt;br /&gt;
#&#039;&#039;&#039;Public statistics&#039;&#039;&#039;: Yes/No.   Default No.   If set to &amp;quot;Yes&amp;quot; users who have submitted the survey will be presented a link to statistics of the current survey. The admin can set which questions should be included at these statistics by [[Advanced question settings|#public_statistics|applying the according question attribute]].&lt;br /&gt;
#&#039;&#039;&#039;Show graphs in public statistics&#039;&#039;&#039;: (&#039;&#039;since 1.80&#039;&#039;) Determines if public statistics for this survey include graphs or only show a tabular overview. Creating graphs for huge surveys with lots of answers takes some time and server resources so this is the switch to turn them on/off (default setting: &#039;&#039;off&#039;&#039;).&lt;br /&gt;
#&#039;&#039;&#039;Automatically load URL when survey complete&#039;&#039;&#039;:  Yes/No.  Default No.   If yes, when the survey is submitted, it will automatically redirect to the End URL. The end URL can be defined in the Text Elements Section. Please note that this only works on an active survey.&lt;br /&gt;
#&#039;&#039;&#039;Show &amp;quot;There are X questions in this survey&amp;quot;&#039;&#039;&#039;:  Yes/No.  Default Yes.   If Yes, the message will be displayed on the Welcome Screen.    This option will not affect the print version.&lt;br /&gt;
#&#039;&#039;&#039;Show group name and/or group description&#039;&#039;&#039;:  Will control the display of Group Names and Descriptions.   This option will not affect the print version. Four Options:&lt;br /&gt;
**&#039;&#039;&#039;Show Both&#039;&#039;&#039; - Default&lt;br /&gt;
**&#039;&#039;&#039;Show Group Names Only&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;&#039;Show group description Only&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;&#039;Hide Both&#039;&#039;&#039;&lt;br /&gt;
#&#039;&#039;&#039;Show question number and/or code&#039;&#039;&#039;:&lt;br /&gt;
**&#039;&#039;&#039;Show Both&#039;&#039;&#039; - Default&lt;br /&gt;
**&#039;&#039;&#039;Show Question Number Only&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;&#039;Show Question Code Only&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;&#039;Hide Both&#039;&#039;&#039;&lt;br /&gt;
#&#039;&#039;&#039;Show &amp;quot;No answer&amp;quot;&#039;&#039;&#039;: Yes/No.  Default Yes.   When Yes, the No Answer will be displayed as the default option for non-mandatory single-select questions. Be aware that if you switch this off, the partticipant won&#039;t be able to unselect a chosen answer option in a non-mandatory question.&lt;br /&gt;
&lt;br /&gt;
==Publication &amp;amp; access control==&lt;br /&gt;
#&#039;&#039;&#039;List survey publicly&#039;&#039;&#039;: Yes/No.  Default No. When it is set to yes, your survey will be listed in the &#039;available surveys&#039; portal&lt;br /&gt;
# &#039;&#039;&#039;Start date/time&#039;&#039;&#039;: Set this to some date if you want your survey to start on a certain date. The survey will start on midnight of that day and only then will people be able to answer to it. To disable this just clear the date from the input field.&lt;br /&gt;
#&#039;&#039;&#039;Expiry date/time&#039;&#039;&#039;: Set this to some date if you want your survey to expire on a special date. This is the last date on which the public survey script will let people participate. (Example: If you set it for the 31st of December, then people will no longer be able to use the survey script on the 1st of January). To disable this just clear the date from the input field.&lt;br /&gt;
#&#039;&#039;&#039;Set cookie to prevent repeated participation?&#039;&#039;&#039;: If you set this to &#039;Yes&#039;, and your survey does not use a tokens table to control participant access, then a cookie will be saved to the client computer of each survey participant once they have submitted a survey. This cookie will stop the same user on that computer from accessing the survey more than once. There are inherent limitations in the &#039;security&#039; strength of such a system, but, in general, it allows you to retain some control over multiple entries on public surveys.&lt;br /&gt;
#&#039;&#039;&#039;Use CAPTCHA for&#039;&#039;&#039;: With this option you can decide when you want a CAPTCHA to be used. Default is to enable CAPTCHA only for the public Registration page, but you can also enable it before accessing the survey, and before Load/Saving partial answers.&lt;br /&gt;
&lt;br /&gt;
==Notification &amp;amp; data management==&lt;br /&gt;
#&#039;&#039;&#039;Send basic admin notification email to:&#039;&#039;&#039; and &#039;&#039;&#039;Send detailed admin notification email to:&#039;&#039;&#039; These fields allow you to send notifications or survey responses to additional email addresses once the survey is submitted. You can edit the templates for these emails under &#039;Email templates&#039;. Multiple recipients can be set by seperating the entries with a semicolon (;) - eg &amp;quot;yourname@test.com; myname@test.com;hisname@test.com&amp;quot; OR when using placeholders &amp;quot;yourname@test.com;{INSERTANS:82733X12X73};{TOKEN:EMAIL}&amp;quot;. Make sure that at least your administrator email is set properly in the survey settings - otherwise no email will be sent or there will be an &#039;Invalid address:&#039; message when a participant finishes a survey. Please note that there are three different ways for entering an address:&lt;br /&gt;
##Enter a specific &#039;&#039;email address&#039;&#039; (ie: yourname@test.com)&lt;br /&gt;
##Enter a &#039;&#039;SGQA code&#039;&#039; and the response will be sent to an email address entered as an answer to that particular question (use the format {INSERTANS:9999X88X12}, in the same way you would [http://docs.limesurvey.org/tiki-index.php?page=Adding+a+question&amp;amp;structure;=English+Instructions+for+LimeSurvey#Information_from_previous_answers Re-use information from previous answers]&lt;br /&gt;
##Enter a &#039;&#039;Token code&#039;&#039; (only possible if your survey is &#039;&#039;not&#039;&#039; anonymous) and the response will be sent to an email address retrieved from a token field (use the format {TOKEN:EMAIL} or {TOKEN:ATTRIBUTE_1} in the same way you would [http://docs.limesurvey.org/tiki-index.php?page=Adding+a+question&amp;amp;structure;=English+Instructions+for+LimeSurvey#Information_from_tokens_table Re-use Information from the Tokens Table]&lt;br /&gt;
##&#039;&#039;As of Version 1.92:&#039;&#039; Enter a valid expression conforming to [[Expression Manager|Expression Manager]] syntax.  This lets you use question code instead of SGQA syntax (for easier readability), plus conditional logic (e.g. route the notifications to different people depending upon the data entered into the survey).&lt;br /&gt;
#&#039;&#039;&#039;Date stamp?&#039;&#039;&#039;: This field allows you to determine whether the survey will datestamp all responses. If you choose &amp;quot;Yes&amp;quot;, then when a response is submitted, a field will be included in that response indicating the time and date that the response was made. (See configuration settings for $timeadjust setting.)&lt;br /&gt;
#&#039;&#039;&#039;Save IP address?&#039;&#039;&#039;: This field allows you to determine whether the survey will save an IP-address for all responses. If you choose &amp;quot;Yes&amp;quot;, then when a response is submitted, a field will be included in that response indicating the ip-address of the participant.&lt;br /&gt;
#&#039;&#039;&#039;Save referrer URL?&#039;&#039;&#039;: This field allows you to determine whether the survey will save the referrer URL for all responses. If you choose &amp;quot;Yes&amp;quot;, then when a response is submitted, a field will be included in that response where this URL is saved. A referrer URL is the URL from which the user was led to your survey URL.&lt;br /&gt;
#&#039;&#039;&#039;Enable assessment mode?&#039;&#039;&#039;: With this setting you can enable/disable [[Assessments|assessments]] for this survey.&lt;br /&gt;
#&#039;&#039;&#039;Save timings&#039;&#039;&#039;: If activate then on survey activation a separate table will be created where timings for your questions will be saved, e.g. how long a user stays on one page during taking the survey.&lt;br /&gt;
#&#039;&#039;&#039;Participant may save and resume later?&#039;&#039;&#039;: This setting allows a participant to save his responses and resume to answer the survey at a later time. Please note that this makes most sense with open surveys or surveys with anonymized answer. If you are using tokens and the survey is not anonymous in most cases it is better to activate &#039;Token-based response persistence&#039; in the token tab.&lt;br /&gt;
#&#039;&#039;&#039;Google Analytics API Key for this survey&#039;&#039;&#039;:  Allows for integration with Google Analytics. The API key can be inserted into templates using {GOOGLE_ANALYTICS_API_KEY}. The full JavaScript that Google Analytics expects (including the key) can be included in templates via {GOOGLE_ANALYTICS_JAVASCRIPT}&lt;br /&gt;
#&#039;&#039;&#039;Google Analytics Style for this Survey&#039;&#039;&#039;:  Choices are:&lt;br /&gt;
##&#039;&#039;&#039;Do not use Google Analytics&#039;&#039;&#039; - so {GOOGLE_ANALYTICS_JAVASCRIPT} is an empty string&lt;br /&gt;
##&#039;&#039;&#039;Default Google Analytics&#039;&#039;&#039; - {GOOGLE_ANALYTICS_JAVASCRIPT} uses the standard Google Analytics code, inserting the proper Google Analytics Key&lt;br /&gt;
##&#039;&#039;&#039;SurveyName-&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;SID]/GroupName&#039;&#039;&#039; - {GOOGLE_ANALYTICS_JAVASCRIPT} contains customized Google Analytics code to log the URL as {SURVEYNAME}-&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;{SID}]/{GROUPNAME}.  This can be  helpful if you want to analyze navigation paths through your survey, time spent per page, and drop-off rates per page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Google API howto&#039;&#039;&#039;:&lt;br /&gt;
# Register/login on Google Analytics (GA): [http://www.google.com/analytics/ www.google.com/analytics/]&lt;br /&gt;
# Create a key (the site should not point to the survey, but to the part before &#039;index.php?&#039;) The key should be UA-xxxxx.&lt;br /&gt;
# Go to your survey&#039;s global settings in Limesurvey.&lt;br /&gt;
# Put the key in appropriate field (Google Analytics API Key). It&#039;s probably the best to set GA Style to track all pages as you can have more info.&lt;br /&gt;
# You don&#039;t need to do anything in shipped templates, as the {GOOGLE_ANALYTICS_JAVASCRIPT} part is already there.&lt;br /&gt;
# Activate the survey.&lt;br /&gt;
# Do the survey.&lt;br /&gt;
# Go to GA panel mainsite. (select appropriate account in left-hand upper corner if you have more than one). You should see some graphs with the statistics. Beware of the dates in upper right corner.&lt;br /&gt;
&lt;br /&gt;
==Tokens==&lt;br /&gt;
#&#039;&#039;&#039;Anonymized responses?&#039;&#039;&#039;: This allows you to determine whether responses to your survey are matched up with information from your surveys tokens table, or kept &#039;anonymous&#039;. The default is &#039;No&#039;. If you choose &#039;Yes&#039; then your survey is set to radically anonymize responses - there is really no way to connect answers and participants. Even the admin can&#039;t link response data and participant/token data. However you will always be able to specifically view each response entered by your participants in the survey. Thus individual, but anonymous, statistics is still possible to do. &#039;&#039;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&#039;&#039;: If this feature is activated the response submission date and the token completed date are always set to 1980-01-01 00:00, no matter of other settings. Why? Invalidating the submission date ensures no match with webserver logs where the token key might show up when a survey is started. Invalidating the token completed date makes sure that you can&#039;t align the order of submitted responses to the order of the token date/time.&lt;br /&gt;
#&#039;&#039;&#039;Allow editing of answers after completion?&#039;&#039;&#039;: Default: No If you activate this setting the participants may return to his survey by clicking the invitation link, even if he already submitted the survey. This only works with non-anonymized surveys.&lt;br /&gt;
#&#039;&#039;&#039;Enable token-based response persistence&#039;&#039;&#039;: If your survey uses tokens and your responses are not anonymized, then you may want to enable this feature. If you turn this on, then your participants can leave your survey and resume later at any time without using the &#039;Resume later&#039; function - for example if he/she gets distracted or his browser crashes. Upon clicking the invitation link again he will find his survey answers so far still in place when returns to the survey and will even continue on the last page seen.&lt;br /&gt;
#&#039;&#039;&#039;Allow public registration&#039;&#039;&#039;: If you use tokens to control access to your survey, the only people who can use the survey are those who have an entry and a unique token from the token table. If you would like to use tokens, but also allow public registration, set this to &amp;quot;Yes&amp;quot;.  The &amp;quot;Yes&amp;quot; setting will allow a visitor to register his name and email address. The script will create a new entry in your tokens table for this person, then send them an invitation email. The script will ensure that only one person per email address can complete your survey.&lt;br /&gt;
#&#039;&#039;&#039;Use HTML format for token emails?&#039;&#039;&#039;: When set to yes, all emails sent by the token management interface (invite, reminder, confirmation) will be formatted as HTML. You&#039;ll then be able to use rich formatting for this emails. Default is Yes at survey creation. Caution, when you switch on/off this feature, you&#039;ll have to double check that your email templates are still displayed as you want.&lt;br /&gt;
#&#039;&#039;&#039;Set token length to&#039;&#039;&#039;: Usually you don&#039;t need to change this, the default setting of 15 digits (max. supported value: 99) is fine. If changing this setting please enter a number (X) which should be greater than 5 (if the number entered is &amp;lt;5 it will be converted to the default value of 15). When generating tokens all tokens will use a length of X digits.&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
&lt;br /&gt;
Alternatively you can [[Importing a survey structure|import a survey structure]] from this tab on survey creation. You have the option to let LimeSurvey automatically convert relative URLs to local images/media files and INSERTANS tags (recommended).&lt;br /&gt;
&lt;br /&gt;
==Copy==&lt;br /&gt;
&lt;br /&gt;
Alternatively you can copy an existing survey from this tab on survey creation. You have the option to let LimeSurvey automatically convert relative URLs to local images/media files and INSERTANS tags (recommended). The other options are pretty self-explaining. Please note that when copying a survey the start date and the end date of a survey cleared.&lt;br /&gt;
&lt;br /&gt;
==Panel integration (URL parameters)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Please note that this tab is currently not visible on survey creation but only when you edit the survey settings after saving them for the first time.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On this tab you can set which additional URL parameters will be accepted by your survey. If you like you can also save the value as a response of a &amp;quot;Short text question&amp;quot; or &amp;quot;Multiple short text question&amp;quot; type (you will be able to select any short text question to save it to). Even if you do NOT save the value of the URL parameter you will be able to use this parameter in the end URL. Please have a look at the documentation of the End-URL for further information.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
This tab lets you manage files (pictures, media files) that were uploaded in the HTML Editor and it is only visible if you edit a survey - not during survey creation.&lt;br /&gt;
&lt;br /&gt;
You can:&lt;br /&gt;
* Browse available files&lt;br /&gt;
* Export files as a ZIP archive&lt;br /&gt;
* Import a ZIP archive of files&lt;br /&gt;
&lt;br /&gt;
Important hints:&lt;br /&gt;
* Authorized files extensions are defined in config-defaults.php.&lt;br /&gt;
* Files for the survey are in the upload/surveys/&amp;lt;sid&amp;gt; subdirectory.&lt;br /&gt;
* Uploaded files will only been seen while browsing resources on this survey (groups, questions, answers) not in other surveys or objects (labels).&lt;br /&gt;
* Do not expect this limited visibility to ensure confidentiality of the resources as they are reachable with a simple browser to anyone who know the URL to the file.&lt;br /&gt;
* You can&#039;t import a ZIP file containing subdirectories.&lt;br /&gt;
&lt;br /&gt;
=2nd Step - Additional languages=&lt;br /&gt;
&lt;br /&gt;
To add more language to a survey you have to create and save it - then edit it again. Now you can add and remove additional languages to the survey. If you remove a language from a survey the complete contents of that language in that survey is deleted permanently so be careful what you are doing.&lt;br /&gt;
&lt;br /&gt;
By clicking on the button &#039;Save and continue&#039; on the first page in the survey settings you will be taken to the language-specific page which lets you change all texts for each language like &#039;&#039;Survey name&#039;&#039;, &#039;&#039;Welcome Text&#039;&#039;, etc. You can also edit the date format which should be used for a certain language.&lt;br /&gt;
&lt;br /&gt;
Previous [[Creating surveys - Introduction]]&lt;br /&gt;
&lt;br /&gt;
Next [[Importing a survey structure]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Alternatives_to_the_LimeSurvey_import_function&amp;diff=1539</id>
		<title>Alternatives to the LimeSurvey import function</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Alternatives_to_the_LimeSurvey_import_function&amp;diff=1539"/>
		<updated>2013-03-08T21:03:05Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Import using the administration interface=&lt;br /&gt;
&lt;br /&gt;
If you have previously exported a survey structure, you can import it from the &amp;quot;New Survey&amp;quot; screen. Click on the browse button to choose the SQL/CSV file, and then click on the button. The import process reads the following formats:&lt;br /&gt;
*v1.50 or later .CSV files created by LimeSurvey&lt;br /&gt;
*v1.90 or later .LSS files created by LimeSurvey&lt;br /&gt;
&lt;br /&gt;
That way you can import old surveys from previous version. The import &#039;intelligently&#039; re-numbers the survey, group, question, answer and condition IDs so that they all match each other - &#039;&#039;&#039;no existing surveys will be overwritten&#039;&#039;&#039;. See section on [[Exporting a survey structure]] for more information.&lt;br /&gt;
&lt;br /&gt;
=Import using the commandline utility=&lt;br /&gt;
&lt;br /&gt;
Since version 1.50 it is possible to import surveys from the command line (or shell). To use this functionality you have to have access to the shell and the PHP interpreter has to be configured to allow shell execution of scripts.&lt;br /&gt;
&lt;br /&gt;
This functionality is useful when you have timeout problems with the web version that could happen when you have very long surveys to import.&lt;br /&gt;
&lt;br /&gt;
To use it, in the shell go to the limesurvey/admin folder and execute:&lt;br /&gt;
&lt;br /&gt;
php cmdline_importsurvey &amp;lt;File to import&amp;gt; &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;&amp;lt;user&amp;gt; &amp;lt;password&amp;gt;]&lt;br /&gt;
*&amp;lt;File to import&amp;gt; has to be one of the described above&lt;br /&gt;
*&amp;lt;user&amp;gt; has to be a user with the right to create surveys&lt;br /&gt;
*&amp;lt;password&amp;gt; the password for the user &amp;lt;br/&amp;gt;*&amp;lt;user&amp;gt; and &amp;lt;password&amp;gt; are only required if the control access is active&lt;br /&gt;
&lt;br /&gt;
If you need to see the parameters you can execute:&lt;br /&gt;
&lt;br /&gt;
php cmdline_importsurvey -h&lt;br /&gt;
&lt;br /&gt;
=Importing surveys from other applications=&lt;br /&gt;
&lt;br /&gt;
We are often getting requests to import a survey from other applications or survey providers. The problem is that providers like SurveyMonkey lock you in - it is not possible to export the survey structure from SurveyMonkey, only the response data. So you can see that using non-open propietary software or providers can be a bad idea in the first place.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=LimeSurvey_roadmap&amp;diff=2081</id>
		<title>LimeSurvey roadmap</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=LimeSurvey_roadmap&amp;diff=2081"/>
		<updated>2013-03-04T19:03:22Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:__TOC__&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
This page lists future development and release goals. We will update this regularly with more details as they become available. Goals cannot be fulfill by itself so if you want to give a helping hand please get in touch! Following you will find our first public project status and any future project status will replace this one. All project statuses can/will be found on the[[Past project statuses]] page.&lt;br /&gt;
&lt;br /&gt;
=LimeSurvey project status January 4th, 2013=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 2.0+ is currently considered to be stable - due to the recent switch to the Yii framework there are certain issues coming up regarding cross-DB compatibilities which are addressed by regular releases of new builds. LimeSurvey 2.1 is currenty in development and will show the start of a plugin-architecture.&lt;br /&gt;
&lt;br /&gt;
=Timeline=&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Est. date||Goal||Remarks/features&lt;br /&gt;
|-&lt;br /&gt;
|15 April 2013||Release 2.1 alpha version||-Improved plug-in system&amp;lt;br/&amp;gt;-Question types are now plugins&lt;br /&gt;
|-&lt;br /&gt;
|Unknown||Release 2.2||- New question designer&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Unknown||Release 2.3||- Locking&amp;lt;br/&amp;gt;- Trans-process caching&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_-_LimeSurvey_CE&amp;diff=1574</id>
		<title>Installation - LimeSurvey CE</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_-_LimeSurvey_CE&amp;diff=1574"/>
		<updated>2013-03-03T15:31:41Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Additional pages:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt; {maketoc title=&amp;quot;On this page:&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Note: These installation instructions are for version 2.0 or later. Older instructions for 1.92 can be found here [[Installation Version 1.92 or older|here]] &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
The LimeSurvey project offers two ways of installating LimeSurvey:&lt;br /&gt;
*On your webserver:&lt;br /&gt;
&lt;br /&gt;
+In that case just follow the instructions on this page starting with step 1.&lt;br /&gt;
*On your local Windows PC:&lt;br /&gt;
&lt;br /&gt;
+You usually only want to install LimeSurvey on your local PC if you want to create surveys locally (mainly for speed or test reasons) and upload them later to your live LimeSurvey installation on a web server. For this we have prepared a special package for LimeSurvey which includes the web server, the database and the LimeSurvey application and [[Installation of the LimeSurvey XAMPP package|instructions how to install it]].&lt;br /&gt;
&lt;br /&gt;
=1. Make sure you can use LimeSurvey on your website=&lt;br /&gt;
&lt;br /&gt;
Make sure your server meets the following additional requirements. Most of these requirements will also be checked during the installation.&lt;br /&gt;
&lt;br /&gt;
Required:&lt;br /&gt;
* Minimum 80 MB disk space&lt;br /&gt;
* MySQL 4.1.0 or later &#039;&#039;&#039;OR&#039;&#039;&#039;    Microsoft SQL Server 2005 or later &#039;&#039;&#039;OR&#039;&#039;&#039;  Postgres 8.1 or later&lt;br /&gt;
* PHP 5.1.6 or later with the following modules/libraries enabled:&lt;br /&gt;
** mbstring (Multibyte String Functions) extension library (see also [http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ])&lt;br /&gt;
** PDO database driver for MySQL (pdo_mysql or pdo_mysqli) or Postgres (pdo_pgsql) or MSSQL (pdo_sqlsrv)&lt;br /&gt;
** For PHP versions &amp;lt;5.2 you will need to have the PECL JSON library( see [http://pecl.php.net/package/json]) installed&lt;br /&gt;
** Also we assume in general that all PHP  default libraries are enabled (like hash, session, etc.).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Please note that LimeSurvey 2.x uses different database drivers than 1.x . If you get a message not No DBO driver was found during the installation you will have to contact your webspace provider and ask them to activate one of the aforementioned database driver libraries. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional PHP Extensions:&lt;br /&gt;
* &#039;&#039;&#039;GD-Library&#039;&#039;&#039; &#039;&#039;&#039;with FreeType support&#039;&#039;&#039; installed is needed for captchas or nice charts in statistics - see [http://de3.php.net/manual/en/image.setup.php PHP GD-Library Extension documentation]&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; (pretty standard) is needed for the [[Email bounce tracking system]] - see [http://www.php.net/manual/en/imap.setup.php PHP IMAP Extension documentation]&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; installed is needed to import tokens using LDAP - see [http://de.php.net/manual/en/ldap.installation.php PHP LDAP Documentation]&lt;br /&gt;
* &#039;&#039;&#039;Zip&#039;&#039;&#039; (pretty standard) for template upload and import resources Zip archives - see [http://www.php.net/manual/en/zip.setup.php PHP Zip Extension documentation]&lt;br /&gt;
* &#039;&#039;&#039;Zlib&#039;&#039;&#039; (pretty standard) is needed for the [[ComfortUpdate]] - see [http://www.php.net/manual/en/zlib.setup.php PHP Zlib Extension documentation]&lt;br /&gt;
&lt;br /&gt;
In most cases your webspace provider or system administrator will be able to help you out on these optional components.&lt;br /&gt;
&lt;br /&gt;
If you want to try LimeSurvey on your local machine we recommend [http://www.apachefriends.org/en/xampp.html XAMPP] which is an easy to install software package containing a complete web server with Apache, MySQL, PHP and Perl. LimeSurvey will run on XAMPP with no configuration needed.&lt;br /&gt;
&lt;br /&gt;
If you want to run Microsoft&#039;s IIS server take a look at &amp;quot;[[Installation of LimeSurvey on a Windows XP machine]]&amp;quot; and &amp;quot;[[Installation on XP with IIS]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==1.1 Hosting for LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey should work with most hosting companies which provide PHP and MYSQL. If you want a ready-installed version of LimeSurvey consider using LimeService, else check out our [[LimeSurvey-compatible hosting companies|list of LimeSurvey-compatible hosting companies]].&lt;br /&gt;
&lt;br /&gt;
=2. Download the LimeSurvey package=&lt;br /&gt;
&lt;br /&gt;
[http://www.limesurvey.org/en/download Download] the latest stable LimeSurvey zip package (there are also gzip, bz2 and 7zip packages available for your convenience) and save it to your local disk.&lt;br /&gt;
&lt;br /&gt;
=3. Unpack the LimeSurvey package=&lt;br /&gt;
&lt;br /&gt;
Uncompress the zip file into a dedicated directory/folder using your preferred compression software. When you uncompress the file make sure that you uncompress the directory structure with the files (this is default behavior for most compression programs). The path name for the installation directory should not include &#039;&#039;&#039;(&#039;&#039;&#039; or &#039;&#039;&#039;)&#039;&#039;&#039; characters, but may include the &#039;&#039;&#039;space&#039;&#039;&#039; character&lt;br /&gt;
&lt;br /&gt;
=4. Collect information about your server=&lt;br /&gt;
&lt;br /&gt;
You will need to know the following things to install LimeSurvey on your web server correctly:&lt;br /&gt;
*Your intended website URL where your scripts will reside (e.g: &#039;&#039;http://my.domain.com/limesurvey&#039;&#039;)&lt;br /&gt;
*The physical disk location on your server where your scripts will reside (ie: &#039;&#039;/home/usr/htdocs/limesurvey&#039;&#039;)&lt;br /&gt;
*The IP/net location of your database server (ie: &#039;&#039;localhost&#039;&#039;)&lt;br /&gt;
*If your database server uses a non-standard port find out which port it is.&lt;br /&gt;
*Your username and password for your database server&lt;br /&gt;
*With most providers you can&#039;t let the script create the database but have to do it yourself.  If you are using such a provider please create a database (for example &#039;&#039;limesurvey&#039;&#039;) yourself.&lt;br /&gt;
&lt;br /&gt;
=5. Upload the files to your web server=&lt;br /&gt;
&lt;br /&gt;
Using your FTP program, connect to your web server and create a directory to store your scripts. Then upload the files using the directory structure they are in. Make sure you &#039;&#039;&#039;upload the files in binary mode&#039;&#039;&#039; (check the settings of your FTP program). Please note that uploading in ASCII mode can lead to uncommon errors (e.g. &#039;class not found&#039; error during installation), also images may not be uploaded correctly.&lt;br /&gt;
&lt;br /&gt;
=7.1 Set Directory permissions=&lt;br /&gt;
&lt;br /&gt;
For the script to work properly it needs certain access to some directories - this applies especially to Linux/*nix systems.&lt;br /&gt;
*The &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; directory and all its subdirectories and files are used for imports &amp;amp; uploads and should be set to &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver.&lt;br /&gt;
*The &#039;&#039;&#039;&amp;quot;/limesurvey/upload/&amp;quot;&#039;&#039;&#039; directory and all its subdirectories and files must also have &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver in order to enable picture and media files upload.&lt;br /&gt;
*The &#039;&#039;&#039;&amp;quot;/limesurvey/application/config/&amp;quot;&#039;&#039;&#039; directory also needs &#039;&#039;Read &amp;amp; Write&#039;&#039; permissions for your webserver.&lt;br /&gt;
*The other directories can be set to &#039;&#039;Read Only&#039;&#039; or in Linux/Unix. You may wish to set the permissions on each file within the /limesurvey/admin directory to &#039;&#039;Read Only&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039; If you are using Linux then depending on your webserver configuration you will have to chmod the rights on the writable folders to 755 or 777. Try 755 first - if it does not work &#039;upgrade&#039; to 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=7.2 Create a database user=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey will create a database and the tables inside it. To be able to do this it will need the username and password of a database user. In general we recommend to create a database user with the following permissions:&lt;br /&gt;
&lt;br /&gt;
- MySQL: SELECT, CREATE, INSERT, UPDATE, DELETE, ALTER, DROP, INDEX&lt;br /&gt;
&lt;br /&gt;
- PostgreSQL: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, TRIGGER&lt;br /&gt;
&lt;br /&gt;
- Microsoft SQL Server:&lt;br /&gt;
&lt;br /&gt;
=8. Run the installation script=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Go to &amp;quot;http://your.domain.com/limesurvey/admin&amp;quot;&#039;&#039;&#039;. If you configured everything correctly the LimeSurvey installer should be starting - just follow the instructions. You will be asked if to create the database and/or create the tables inside the database. Limesurvey then creates the needed tables in the database.&lt;br /&gt;
&lt;br /&gt;
=9. Connect to the administration script for the first time=&lt;br /&gt;
&lt;br /&gt;
After the installer has finished you are done! Open your browser and enter the URL of your admin.php script. Assuming you used LimeSurvey as the directory name to store the files in, this will be something like &amp;quot;http://your.domain.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should get a login screen. The default login credentials (if not changed during in the installation) are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; User: admin&lt;br /&gt;
&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be prompted to change the default password after you logged in. Have fun!&lt;br /&gt;
&lt;br /&gt;
=10. What if I have problems...=&lt;br /&gt;
&lt;br /&gt;
Like all computer programs, most of the time things will work just like the instructions say, but sometimes they just won&#039;t. There are too many possible reasons for things not going according to plan to describe here. If you have trouble, first check out the [[Installation FAQ]]. If you don&#039;t find your answer there please post your problem and any error messages in the [http://www.limesurvey.org/en/forum LimeSurvey forums] on limesurvey.org or join the [irc://irc.freenode.net/limesurvey|LimeSurvey IRC channel]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&#039;&#039;&#039;[http://www.limesurvey.org/en/community-services/live-chat Direct link to the official LimeSurvey IRC Channel]&#039;&#039;&#039;&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Question_type_-_Array_dual_scale&amp;diff=2652</id>
		<title>Question type - Array dual scale</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Question_type_-_Array_dual_scale&amp;diff=2652"/>
		<updated>2013-02-21T18:19:09Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Short description=&lt;br /&gt;
&lt;br /&gt;
This type provides two scales of answer options for each subquestion.  A heading can be set for each scale using the advanced settings:&lt;br /&gt;
&lt;br /&gt;
[[File:1_DSC.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can set a special question attribute to use this question type with dropdown boxes:&lt;br /&gt;
&lt;br /&gt;
[[File:1_DSC_DD.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Download english sample question: [[Media:1_-_Dual_Scale.csv|1_-_Dual_Scale.csv]]&lt;br /&gt;
&lt;br /&gt;
Download english sample question: [[Media:1_-_Dual_Scale_Drop_Down.csv|1_-_Dual_Scale_Drop_Down.csv]]&lt;br /&gt;
&lt;br /&gt;
=Core settings=&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Core question settings&amp;quot;,start=&amp;quot;!mandatory&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
==These Core Settings are available in Version 1.92 and beyond==&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Core question settings&amp;quot;,start=&amp;quot;!relevance&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
=Advanced settings=&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!answer_width&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!random_order&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!random_group&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!hidden&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!dualscale_headerA&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!dualscale_headerB&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!use_dropdown&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!dropdown_separators&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!dropdown_prepostfix&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!array_filter&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!array_filter_exclude&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!page_break&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!public_statistics&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!scale_export&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
==These Advanced Settings are available in Version 1.92 and beyond==&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!array_filter_style&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!min_answers&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;With Array dual scale an completed answer is an answer at each scale.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{INCLUDE(page=&amp;quot;Advanced question settings&amp;quot;,start=&amp;quot;!max_answers&amp;quot;,stop=&amp;quot;---&amp;quot;)}{INCLUDE}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;With Array dual scale an completed answer is an answer at each scale.&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=4464</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=4464"/>
		<updated>2013-02-07T15:12:42Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&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=&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&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;
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;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)==&lt;br /&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 if you have to re-order questions.  EM uses an 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 asked, 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;
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, weight_kg 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;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance===&lt;br /&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;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&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===&lt;br /&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;
[[File:tutorial4.jpg]]&lt;br /&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;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&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==&lt;br /&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===&lt;br /&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 in weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&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 multiple 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;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered (e.g. &amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;&lt;br /&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;
[[File:tailoring8.jpg]]&lt;br /&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;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports===&lt;br /&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;span&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&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;
[[File:tailoring12.jpg]]&lt;br /&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;
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==&lt;br /&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;
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;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 and later 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;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions==&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;SGQA&#039;&#039;&#039;:  This is how variables are named in LimeSurvey &amp;lt;= 1.91+&lt;br /&gt;
**Stands for Survey-Group-Question-Answer&lt;br /&gt;
**SGQA variable names look like 123X5X382X971, and may have sub-question suffixes.&lt;br /&gt;
**These variable names are specific to the underlying S/Q/G/A database codes, so often need to be changed&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;
**Although not required to be unique in &amp;lt;= 1.91+, it must be unique if you want to use EM&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?==&lt;br /&gt;
&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&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;
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;
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?==&lt;br /&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;
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?==&lt;br /&gt;
&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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?==&lt;br /&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 chldren&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?==&lt;br /&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;
**Eveything 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;
==How Backwards Compatible is EM with 1.91+?==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 is fully backwards-compatible with 1.91+ with one exception/caveat:  1.92 handles less-than / greater-than comparisons against empty values differently than 1.91+.&lt;br /&gt;
&lt;br /&gt;
One of the LimeSurvey demo surveys uses a set of conditions that translates to this relevance equation:  {(age &amp;lt; 16) or (age == 20) or ... or (age == 80)}. In LimeSurvey 1.91+, (age &amp;lt; 16) is FALSE when there is no answer (the value is blank).  However, in LimeSurey 1.92, (age &amp;lt; 16) is TRUE when there is no answer, since both PHP and JavaScript treat blank as 0 in mathematical comparisons.  Thus, 1.91+ would hide that question when age was unanswered, but 1.92 would show it.  We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat &amp;quot;&amp;quot; &amp;lt; 16 as FALSE.  Fortunately, there is an easy work-around for this.  If you want (age &amp;lt; 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age &amp;lt; 16)}.  You can use the new [[Show Logic File|Survey Logic File]] view to quickly identify and fix any such comparisons in your survey.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install 1.92+ 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;
**Availalbe Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolsted 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+)=&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type==&lt;br /&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?=&lt;br /&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)==&lt;br /&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===&lt;br /&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 diplayed. 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;
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;
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;
{|&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;
|}&lt;br /&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;
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 and 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===&lt;br /&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 deterimine 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===&lt;br /&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;
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===&lt;br /&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;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&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;
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;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
&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;
&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;
Expression Manager supports the following syntax:&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;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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 (=)===&lt;br /&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 sould 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;
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;
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;
&lt;br /&gt;
==Access to Variables==&lt;br /&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)&lt;br /&gt;
*INSERTANS:SGQA - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;)&lt;br /&gt;
*All {XXX} values used by templates&lt;br /&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;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security issue===&lt;br /&gt;
&lt;br /&gt;
For security issue, text entered by user are filtered. Some caracter are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming==&lt;br /&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;
QuestionCode . &#039;_&#039; . AnswerID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
{|&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},{Q20_comment}||{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|| || ||{Q22_E}||{Q22_E.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_D_comment}||{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;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables==&lt;br /&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;
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;
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;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&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.&lt;br /&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;
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;
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;
&#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;
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;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&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;
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;
==Access to Functions==&lt;br /&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===&lt;br /&gt;
&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
{|&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;
 [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 {MOUSEOVER(label=&amp;quot;v&amp;quot;)}In last 2.0 version{MOUSEOVER}||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 string||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 a string||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)&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.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 a 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;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered===&lt;br /&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;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local==&lt;br /&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==&lt;br /&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;
{|&lt;br /&gt;
|Operator||Example||a||b||Result&lt;br /&gt;
|-&lt;br /&gt;
|+ (unary)||+a||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;
|+||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;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions===&lt;br /&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;
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 &#039;&#039; 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;
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;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converage 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?==&lt;br /&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;
{|&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;
|}&lt;br /&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;
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==&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting=&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Color||Sample||Meaning||Tooltip||Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||&amp;lt;span style=&#039;color:#eee8aa,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||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;
|blue bold text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:blue,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:grey,#eee8aa&#039;&amp;gt;&#039;Sample&#039;&amp;lt;/span&amp;gt;||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|bold maroon text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:maroon,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, but after the current question||&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 but after the current question is shown in bold maroon text.  This color coding should alert authors to possible errors in question sequencing; but it is allowed since some authors may want this sequence of variables a page, especially for dynamic reports.  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 cyan text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#4C88BE,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, prior to the current question||&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 and prior to the current question is shown in bold cyan 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 green text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:green,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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 pageis 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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#FF00FF,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on a later 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 pageis shown in bold pink text.  These are erorrs since the variable is  being used before it is declareed.  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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#996600,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||a lime relacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE} are shown in bold tan text.  The tooltip shows the current value.&lt;br /&gt;
|-&lt;br /&gt;
|red text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:red,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:black,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||punctuation||none||All other punctionation 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;
|}&lt;br /&gt;
&lt;br /&gt;
=Relationship to LimeSurvey Ideas / Feature Requests=&lt;br /&gt;
&lt;br /&gt;
Expression Manager provides complete or partial solutions to each of the following:&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1 Conditions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/3/ Answercounts]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/5 Advanced reporting for assessments]&lt;br /&gt;
**partial: Equations let one store the Assessment value in the database, and micro-tailoring can generate simple formatted reports.  Authors can access those Equation values if they have more complex reporting needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/6 Assessment reports]&lt;br /&gt;
**partial:  Since Equations store the Assessment score, it should be possible to use Statistics to show distributions of those scores, and Quotas to limit the number of responses with those scores.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/7 Store assessment results for further evaluation]&lt;br /&gt;
**Equations let one store the Assessment value in the database, completely solving this problem&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/22/ More advanced condition rules]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/28 Open Answertable up so that we can alter formatting]&lt;br /&gt;
**partial:  All of the question attributes are available, so authors can create custom AnswerTable equivalents as a Question.  Once implatemented, they can also use the showTheseResponses() or showAllResponsesExecpt() functions&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/37 Export survey results with full questions to include images]&lt;br /&gt;
**since Tailoring has access to the full question text, it can include images in the export&lt;br /&gt;
**if subjects choose Print Your Answers after finishing the survey, those printouts will be fully tailored&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/63 List of question codes and SGQA identifiers]&lt;br /&gt;
**The Show Survey Logic view shows that mapping (plus much more information)&lt;br /&gt;
**In addition, you no longer have to use SGQA codes to refer to variables - you can use the Question code/title.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/69 Branch/jump to another question (earlier or later) based on current question]&lt;br /&gt;
**You can use the Navigation Index for this in most cases&lt;br /&gt;
**Once implemented, you can use the JumpTo() function.  Like the Navigation Index, if you try to jump forward, it will stop on an intervening page if there are any of the relevant mandatory questions are unanswered, or if any relevant questions fail validation tests.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/86 set quota for total responses]&lt;br /&gt;
**If the final question is an Equation that flags a survey as completed (so is NULL if a respondant does not get to that page), you can use Quotas on that question to control the number of completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/101 Review all conditions]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/105 Review all questions + Review all groups]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/107 How to visualize questions, logic &amp;amp; conditions]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/113 Offline Surveys]&lt;br /&gt;
**Running a survey with all of the questions on the same page would let you do off-line data collection  (e.g. email the html page and associated JavaScript).  However, you would still want a way to submit the results so that they did not get lost.  It may be possible to use Save As HTML to save partially completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/120 Remove INSERTANS from question text at survey results]&lt;br /&gt;
**INSERTANS is no longer needed.  You can refer to a variable by its SGQA code (without prefixing it with INSERTANS:), or by its question code.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/137 Informed Consent and Authorization Functionality]&lt;br /&gt;
**You can show show the informed consent on the welcome page, then ask any additional questions needed (to ensure they meet the study inclusion/exclusion criteria), and ask them a Yes/No question whether they give their consent.  Then, make all of the remaining questions conditional on that yesNo.  For example, if the question is named &#039;&#039;consent&#039;&#039;, you would set the relevance to the remaining questions to &#039;&#039;consent == &amp;quot;Y&amp;quot;&#039;&#039; (possibly &#039;&#039;and&#039;&#039;ing that with whatever additional conditions you needed to support your branching needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/199 Show codes instead of of answers using INSERTANS]&lt;br /&gt;
**{Qcode} returns the code instead of the response text (which you can get via {INSERTANS:SGQA}, or {Qcode.shown}&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/204 Need group mean or calculations for assessments]&lt;br /&gt;
**Say you have N variables of which N-X were answered, you could compute the mean of the answered variables as {sum(var1, var2, ..., varN) / count(var1, var2, ..., varN)}&lt;br /&gt;
**Computing the mean across a set of respondants would require extension of the Quota functionality.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/222 To insert a language dependent text]&lt;br /&gt;
**Tailoring lets you conjugate verbs and decline nouns in each language&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/225 Surveyors should approve their answers]&lt;br /&gt;
**Custom Questions with tailoring, or the showAllResponsesExcept() function will let Surveyors see all of the questions and responses before clicking Submit. If the Navigation Menu option is enabled, it is easy to go back and correct answers.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Suppliment to #answernnXnnXnnn method of targetting form elements]&lt;br /&gt;
**You can now refer to questions and answers by their Question Code, so there is no longer a need to modify SGQA values.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/262 More flexibility with hidden questions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/265 Remove specific conditions from multiple questions]&lt;br /&gt;
**You can now use Relevance, which is easier to manage than Conditions.  If  needed, they can all be exported from the database, edited in a spreadsheet, and re-imported.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/268 Cross Survey Reporting]&lt;br /&gt;
**By using question codes that are unique across your surveys and versions, you can consolidate data from multiple surveys and/or compare them&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/275 Simplifying integration with other tools]&lt;br /&gt;
**Expression Manager uses Question Codes instead of SGQA, making it easier to integrate with other tools.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Expose assessment score to 3rd party app processing]&lt;br /&gt;
**This can be done with Equation question type&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/309 Multiple thank you pages]&lt;br /&gt;
**This can be supported via conditional relevance branching and tailoring&lt;br /&gt;
&lt;br /&gt;
=Additional Reading=&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=General_FAQ&amp;diff=1339</id>
		<title>General FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=General_FAQ&amp;diff=1339"/>
		<updated>2013-02-05T22:22:26Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Getting started=&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to read half the manual to get a feeling what can be done with Limesurvey we recommend to watch some videos (see below).&lt;br /&gt;
&lt;br /&gt;
After that the [[Creating surveys - Introduction]] manual page might be a good start.&lt;br /&gt;
&lt;br /&gt;
==I need a quick introduction for LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
For a first start have a look at our very basic [[LimeSurvey Video-Tutorial]].&lt;br /&gt;
&lt;br /&gt;
There is [http://vimeo.com/4951738 another tutorial] which shows you how to get started with using Lime Survey to conduct online surveys. In [http://vimeo.com/4951738 this video] we&#039;ll create our first survey, deliver it to a user and then view the submitted results.&lt;br /&gt;
&lt;br /&gt;
There are some &#039;&#039;&#039;more videos on YouTube&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Limesurvey:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*[http://www.youtube.com/watch?v=96WdtqDmRVw Planning a survey]&lt;br /&gt;
*[http://www.youtube.com/watch?v=6GH-S3YAHRg Creating a survey]&lt;br /&gt;
*[http://www.youtube.com/watch?v=61p1Yre4GFM Entering questions]&lt;br /&gt;
*[http://www.youtube.com/watch?v=5eiZHw9mjDg Using label sets]&lt;br /&gt;
*[http://www.youtube.com/watch?v=5fI9Fyk5UCk Exporting data from LimeSurvey]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Old PHP-surveyor videos:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*[http://www.youtube.com/watch?v=c8OiA0bv8Rk Getting to the phpsurveyors Admin Pages]&lt;br /&gt;
*[http://www.youtube.com/watch?v=KOq45Val3v8 Creating a new group in a survey]&lt;br /&gt;
*[http://www.youtube.com/watch?v=bXGQeP8f7kQ Creating a new question for phpsurveyor]&lt;br /&gt;
*[http://www.youtube.com/watch?v=1mzZ3KCaGAc Testing a newly created/modified Survey]&lt;br /&gt;
*[http://www.youtube.com/watch?v=6Y2L23y6bps Add respondent]&lt;br /&gt;
*[http://www.youtube.com/watch?v=NcnK5YsfB8g Emailing to the respondents]&lt;br /&gt;
&lt;br /&gt;
=Survey design and layout=&lt;br /&gt;
&lt;br /&gt;
==How do I get rid of the &amp;lt;span style=&#039;color:red&#039;&amp;gt;*&amp;lt;/span&amp;gt; (red asterisk) of mandatory questions?==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;LimeSurvey Version 1.80 and above&#039;&#039;&#039; the red asterisk of mandatory questions is set within the template.css file (&amp;quot;asterisk&amp;quot; class). To hide it:&lt;br /&gt;
*Open the template editor&lt;br /&gt;
*Create a copy of the template you wish to modify&lt;br /&gt;
*Select the &amp;quot;template.css&amp;quot; file and search for the asterix class&lt;br /&gt;
*Add the following line at the end of the asterix class&amp;quot;.asterisk {display: none;}&amp;quot;.&lt;br /&gt;
*Save template.css&lt;br /&gt;
*Clear your browser cache so that the edited template.css is reloaded and not taken from cache.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;LimeSurvey Version 1.53&#039;&#039;&#039; the red asterisk of mandatory questions is set within the css &amp;quot;asterisk&amp;quot; class. To hide it:&lt;br /&gt;
*Open the template editor&lt;br /&gt;
*Select the template you wish to modify so that the asterisk doesn&#039;t show&lt;br /&gt;
*Select the &amp;quot;startpage.pstpl&amp;quot; file&lt;br /&gt;
*Add the css &amp;quot;.asterisk {display: none;}&amp;quot; into the css stylesheet area.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Earlier Versions&#039;&#039;&#039;&lt;br /&gt;
*Open qanda.php in your text editor&lt;br /&gt;
*Search for the string &amp;quot;asterisk&amp;quot;&lt;br /&gt;
*Comment out this line with two slashes &amp;quot;//&amp;quot; at the beginning of the line&lt;br /&gt;
*Example:&lt;br /&gt;
**original: $qtitle = &#039;&amp;lt;span class=\&#039;asterisk\&#039;&amp;gt;&#039;.$clang-&amp;gt;gT(&#039;*&#039;).&#039;&amp;lt;/span&amp;gt;&#039;.$qtitle;&lt;br /&gt;
**modified: // $qtitle = &#039;&amp;lt;span class=\&#039;asterisk\&#039;&amp;gt;&#039;.$clang-&amp;gt;gT(&#039;*&#039;).&#039;&amp;lt;/span&amp;gt;&#039;.$qtitle;&lt;br /&gt;
&lt;br /&gt;
==How can I embed a flash file?==&lt;br /&gt;
&lt;br /&gt;
First go to [[Global settings]] and deactivate the XSS-filter. Please also read up in the implications deactivating that filter. The following steps won&#039;t work if the filter is active.&lt;br /&gt;
#Navigate to the place in your survey where you want insert your Flash file. This can be anywhere where you can use the integrated HTML editor, for example in questions, subquestions, answers, survey welcome/end text and many more.&lt;br /&gt;
#Open the [http://docs.limesurvey.org/tiki-index.php?page=First+Login+%2F+You+user+preferences&amp;amp;structure;=English+Instructions+for+LimeSurvey#Popup:_The_normal_text_editor_is_used_but_the_HTML_editor_is_available_as_a_pop_up_option. full-screen editor mode] by clicking the &#039;LimeFitWin&#039; button on the editor tool-bar.&lt;br /&gt;
#On the full-screen editor tool-bar you will find a little button with a Flash symbol. Click on it. A dialog will open.&lt;br /&gt;
#In this dialog you can give either the path to an existing Flash file somewhere OR you click the &#039;Browse server&#039; button.&lt;br /&gt;
#If you clicked the &#039;Browse server&#039; button you will be presented with a file browser and on the bottom an file upload field. Choose now an existing file or upload a file first.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! If you find this description incomplete please update it accordingly.&lt;br /&gt;
&lt;br /&gt;
==How to remove one of these texts from my survey==&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;There are X questions&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;A note on privacy...&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
===question code===&lt;br /&gt;
&lt;br /&gt;
All these texts are inserted at the template you are using by [http://docs.limesurvey.org/tiki-index.php?page=Template+editor&amp;amp;structure;=English+Instructions+for+LimeSurvey#Replacements_Field_Strings placeholders]. You can easily remove them. Go to the [http://docs.limesurvey.org/tiki-index.php?page=Template+editor&amp;amp;structure;=English+Instructions+for+LimeSurvey Template Editor] and remove the {THEREAREXQUESTIONS} / {PRIVACYMESSAGE} / {QUESTION_CODE} placeholder(s).&lt;br /&gt;
&lt;br /&gt;
=Survey configuration=&lt;br /&gt;
&lt;br /&gt;
==How do I create a survey which is open to everyone?==&lt;br /&gt;
&lt;br /&gt;
To make a survey public to everyone you should:&lt;br /&gt;
* not [http://docs.limesurvey.org/tiki-index.php?page=Tokens&amp;amp;structure;=English+Instructions+for+LimeSurvey#How_to_activate_tokens_ create a token table] (if there is one, drop it)&lt;br /&gt;
* at survey settings set &amp;quot;[http://docs.limesurvey.org/tiki-index.php?page=Creating+a+new+survey&amp;amp;structure;=English+Instructions+for+LimeSurvey#Publication_amp_Access_control Only users with tokens may enter the survey]&amp;quot; = no (old setting)&lt;br /&gt;
* at survey settings set &amp;quot;[http://docs.limesurvey.org/tiki-index.php?page=Creating+a+new+survey&amp;amp;structure;=English+Instructions+for+LimeSurvey#Publication_amp_Access_control allow public registration]&amp;quot; = no&lt;br /&gt;
* at survey settings set &amp;quot;[http://docs.limesurvey.org/tiki-index.php?page=Creating+a+new+survey&amp;amp;structure;=English+Instructions+for+LimeSurvey#Presentation_amp_Navigation list this survey publicly]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Your survey should then be listed at the root page of your limesurvey installation. You can publish the link to the survey on your website/blog and everyone can take the survey without restrictions.&lt;br /&gt;
&lt;br /&gt;
==How can I stop the system from sending confirmation emails==&lt;br /&gt;
&lt;br /&gt;
If you are [http://docs.limesurvey.org/tiki-index.php?page=Tokens&amp;amp;structure;=English+Instructions+for+LimeSurvey#Email_settings using tokens] and a participant fills out the survey, a confirmation email is sent to his/her email address. If you don&#039;t want this message to be sent just delete the whole &#039;&#039;confirmation email&#039;&#039; subject and message. You have to [http://docs.limesurvey.org/tiki-index.php?page=First+Login+%2F+You+user+preferences&amp;amp;structure;=English+Instructions+for+LimeSurvey#X._Source_code_mode: switch to source code mode] to be able to delete all the text. Save the empty message and no confirmation emails should be sent anymore.&lt;br /&gt;
&lt;br /&gt;
=Help, I accidentally...=&lt;br /&gt;
&lt;br /&gt;
==I forgot my admin password. How do I reset it?==&lt;br /&gt;
# For version 1.47 to 1.53 only: Download [[Media:resetadminpw.php|this file]] and copy it to /&amp;lt;your limesurveydir&amp;gt;/admin/install/ .&lt;br /&gt;
# For version 1.7 or later: Restore your /&amp;lt;your limesurveydir&amp;gt;/admin/install/ directory from the download package&lt;br /&gt;
# Execute resetadminpw.php using your browser by pointing it to &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;http://www.your_domain.com/your_limesurvey_dir/admin/install/resetadminpw.php&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# After removing the /install directory again you should be able to login with $defaultuser (Default: admin) and $defaultpass (Default: password) set in config.php.&lt;br /&gt;
&lt;br /&gt;
==How can I restore data from a deactivated survey?==&lt;br /&gt;
&lt;br /&gt;
We recommend to always use the time-out option instead of deactivating a survey. If you closed your survey accidentally it is important that you don&#039;t change anything in the survey.&lt;br /&gt;
&lt;br /&gt;
Then, and only then the following steps will work:&lt;br /&gt;
#Activate your survey again&lt;br /&gt;
#Go to the &amp;quot;Browse responses for this survey&amp;quot; menu.&lt;br /&gt;
#Click at the &amp;quot;Import answers from a deactivated survey table&amp;quot; button.&lt;br /&gt;
#Choose your source table.&lt;br /&gt;
#Click at the &amp;quot;Import responses&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
==I deleted a question/question group/survey!==&lt;br /&gt;
&lt;br /&gt;
This is bad luck. If you delete it, it is really gone. In that case only a backup will help you (which of course you did regularly, didn&#039;t you?).&lt;br /&gt;
&lt;br /&gt;
=Hard- and Software requirements=&lt;br /&gt;
&lt;br /&gt;
For general requirements please refer to our [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Make_sure_you_can_use_LimeSurvey_on_your_website installation instructions].&lt;br /&gt;
&lt;br /&gt;
==What limitations does LimeSurvey have...==&lt;br /&gt;
&lt;br /&gt;
=== ...regarding speed===&lt;br /&gt;
&lt;br /&gt;
There is no existing speed limit on LimeSurvey. It all depends on how fast your server and your connection is. If you expect a large number of users within a short time and you are not sure if your server can handle this check our forum for according topics about other users&#039; experience.&lt;br /&gt;
&lt;br /&gt;
=== ...regarding survey size===&lt;br /&gt;
&lt;br /&gt;
Note: &#039;Survey size&#039; refers to the maximmum number of questions (and answers) in your survey - &#039;&#039;&#039;don&#039;t confuse this with the number of replies on your survey (there is no limitation on that)&#039;&#039;&#039;. Theoretically there would also be no limit on the maximum number of questions/answers in LimeSurvey. But the database engine you are using has several limits. The most important one is the limit on the number of fields(columns) in the result table.&lt;br /&gt;
*MySQL ISAM: The sum of the lengths of the VARCHAR and CHAR columns in a table may be up to 64KB.&lt;br /&gt;
*MySQL InnoDB: Maximum number of 1000 columns&lt;br /&gt;
*MS SQL Server 2000: Maximum number of 1024 columns&lt;br /&gt;
*Postgres: Maximum number of 250-1600 columns depending on column types. The maximum number of columns can be quadrupled by increasing the default block size to 32k. See [[Installation FAQ]] and [http://www.postgresql.org/docs/faqs.FAQ.html#item4.4 PostgreSQL FAQ].&lt;br /&gt;
&lt;br /&gt;
The mySQL ISAM engine is the most tricky one (see [http://dev.mysql.com/doc/refman/5.0/en/column-count-limit.html mysql documentation for more information]). As it allows only up to 65,535 bytes per row and utf8 characters can require up to three bytes per character the maximum may be only 21,844 characters (but this depends on your DB encoding).&lt;br /&gt;
&lt;br /&gt;
You can roughly calculate the size of your survey like this:&lt;br /&gt;
*Every multiple numerical question: 20 chars &#039;&#039;&#039;for each answer&#039;&#039;&#039;&lt;br /&gt;
*Every multiple choice &amp;amp; array question answers: 5 chars &#039;&#039;&#039;for each answer&#039;&#039;&#039;&lt;br /&gt;
*Every other question type: 5 chars&lt;br /&gt;
*Add 10% for the usual overhead&lt;br /&gt;
&lt;br /&gt;
==How to increase the maximum number of columns in PostgreSQL==&lt;br /&gt;
&lt;br /&gt;
In case your survey contains too many questions you can define a different block size in PostgreSQL so it is possible to create more columns. This might be tricky because you have to recompile PostgreSQL and set BLCKSZ to a higher value, like 16kiB or 32kiB. Watch for the configuration option &amp;quot;--with-blocksize=BLOCKSIZE&amp;quot;. For details see the archives of the PostgreSQL mailing list or ask there (pgsql-patches(at)postgresql(dot)org).&lt;br /&gt;
&lt;br /&gt;
Instructions for Debian (thanks to Martin Pitt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt; sudo apt-get build-dep postgresql-8.3&lt;br /&gt;
&lt;br /&gt;
apt-get source postgresql-8.3&lt;br /&gt;
&lt;br /&gt;
cd postgresql-8.3-*&lt;br /&gt;
&lt;br /&gt;
debian/rules patch&lt;br /&gt;
&lt;br /&gt;
sensible-editor build-tree/postgresql-8.3.5/src/include/pg_config_manual.h&lt;br /&gt;
&lt;br /&gt;
dpkg-buildpackage -us -uc -b -nc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Survey participants get kicked out to the Surveys List page part way through. What can I do?==&lt;br /&gt;
&lt;br /&gt;
If you have a particularly long survey, and you find that your users can access a survey, and get part way through completing it, but then seem to get kicked out to the Surveys List page check your PHP settings. If your host is using the &#039;&#039;&#039;Suhosin extension for Apache&#039;&#039;&#039; it may be set to be too limiting on a couple of settings.&lt;br /&gt;
&lt;br /&gt;
For example the two settings &amp;quot;suhosin.post.max_vars&amp;quot; and &amp;quot;suhosin.request.max_vars&amp;quot; are both set to a value of 200 by default. Increase those settings both to 400 or higher so users can complete and submit long surveys.&lt;br /&gt;
&lt;br /&gt;
If you still have problems, try switching the module to simulation_mode (and so basically deactivate it), as the maximum value always depends on your particular survey.&lt;br /&gt;
&lt;br /&gt;
==Fatal error: Allowed memory size==&lt;br /&gt;
&lt;br /&gt;
Depending on your server configuration you might run into memory problems being reported by an error like &#039;&#039;&amp;quot;Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 233472 bytes) in /path/to/htdocs/limesurvey/filename.php on line 7296&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You can try to raise the limit by [http://docs.limesurvey.org/Optional+settings&amp;amp;structure;=English+Instructions+for+LimeSurvey#Resources adding an optional setting to Limesurvey&#039;s config file].&lt;br /&gt;
&lt;br /&gt;
Please mind that such local settings by an application can always be overruled by global server settings. To increase the memory limit to 128M directly on your server you could try adding:&lt;br /&gt;
*memory_limit = 128M to your server&#039;s main php.ini file (recommended, if you have access)&lt;br /&gt;
*memory_limit = 128M to a php.ini file in the LimeSurvey root&lt;br /&gt;
*php_value memory_limit 32M in a .htaccess file in the LimeSurvey root&lt;br /&gt;
*ini_set(&#039;memory_limit&#039;, &#039;128M&#039;); in your config.php&lt;br /&gt;
&lt;br /&gt;
=Email problems=&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_security_hints&amp;diff=1705</id>
		<title>Installation security hints</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_security_hints&amp;diff=1705"/>
		<updated>2013-02-01T14:35:02Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey relies on its own security system which is activated by default. The authors of this software takes no responsibility and makes no claims in relation to the appropriateness or secureness of this software. However we take security issues very serious and react quickly - if you know of any security problems with LimeSurvey please let us know: info@limesurvey.org or open a bug report at our [http://bugs.limesurvey.org bug tracker] (please mark it as private).&lt;br /&gt;
&lt;br /&gt;
==Linux file permissions==&lt;br /&gt;
&lt;br /&gt;
If you are using a Linux server, setting according file permissions is required to secure your LimeSurey installation.&lt;br /&gt;
&lt;br /&gt;
===Basic facts about Linux/*nix file permissions===&lt;br /&gt;
&lt;br /&gt;
A Linux/*nix operating system is multi-user. This means that, apart from your personal account, other user accounts may exist on the system and you should take care of what permissions you give to other users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039; Setting file permissions is especially important in order to secure configuration files holding critical data such as passwords.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note however that the &#039;root&#039; account will always be granted permission to access your files (no matter what file permissions you set) as it is the super-admin user.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The webserver (which runs LimeSurvey), is also running under a given identity (user). On Linux, this is usually the &#039;www&#039;,&#039;www-data&#039; (on Debian/Ubuntu), &#039;apache&#039; or &#039;nobody&#039; user. However, some hosting companies use systems (such as suexec) which make it possible to run LimeSurvey scripts with your personal user. Of course the webserver user must have the right to read LimeSurvey files. However, only a small subset of LimeSurvey subdirectories must be writeable by the webserver user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint&#039;&#039;&#039;: It is very valuable to revoke write permission for the webserver user to these LimeSurvey subdirectories that do not require it. Indeed, even if a LimeSurvey vulnerability might be discovered, the main files will still be protected from an illicit modification thanks to the file system permissions.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting file permissions on a self-managed Linux system===&lt;br /&gt;
&lt;br /&gt;
If you&#039;re managing your webserver and operating system configuration (you are the owner of the physical server or are renting a virtual server on which you have root access), you can follow these recommendations.&lt;br /&gt;
&lt;br /&gt;
You can first set the owner and group of your LimeSurvey files so that it will ease the file permissions setup.&lt;br /&gt;
&lt;br /&gt;
A possible strategy is to set the owner of the LimeSurvey files to your personal username, and the group of the LimeSurvey files to the webserver group. Usually this webserver group only contains the webserver account (and possibly another webmaster account).&lt;br /&gt;
&lt;br /&gt;
For instance if your username is &#039;myaccount&#039; and the webserver user is &#039;apache&#039; in the &#039;apache&#039; group, then, from a shell access, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
$ chown -R myaccount:apache limesurvey/&lt;br /&gt;
&lt;br /&gt;
Then set the file and subdirectories permissions.&lt;br /&gt;
&lt;br /&gt;
For the script to work properly it needs write access to some directories:&lt;br /&gt;
*The &amp;quot;/limesurvey/tmp&amp;quot; directory and its subdirectories are used for imports/uploads and should be set to &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver.&lt;br /&gt;
*The upload/ directory and all its subdirectories must also have &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver in order to enable picture and media files upload.&lt;br /&gt;
* All other directories and files can be set to &#039;&#039;Read Only&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039; Supposing you&#039;ve followed the above recommendations on owner/group, these settings can be applied by the following commands:&lt;br /&gt;
&lt;br /&gt;
$ chmod -R o-r-w-x limesurvey/&lt;br /&gt;
&lt;br /&gt;
$ chmod -R -w limesurvey/&lt;br /&gt;
&lt;br /&gt;
$ chmod -R 770 limesurvey/tmp&lt;br /&gt;
&lt;br /&gt;
$ chmod -R 770 limesurvey/upload&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting file permissions on a hosted webserver===&lt;br /&gt;
&lt;br /&gt;
Giving a standard procedure to secure a web application on a hosted environment is rather difficult because hosted environments differ in so many ways.&lt;br /&gt;
&lt;br /&gt;
As in the managed server case, for the script to work properly it needs write access to some directories:&lt;br /&gt;
*The &amp;quot;/limesurvey/tmp&amp;quot; directory is used for imports/uploads and should be set to &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver.&lt;br /&gt;
*The upload/ directory and all its sub directories must also have &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver in order to enable picture and media files upload.&lt;br /&gt;
* The other directories and files should be set to &#039;&#039;Read Only&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039;&lt;br /&gt;
* Depending on your webserver configuration you will have to chmod the rights on the writable folders to 755 or 777 to make it writable for the webserver. Try 755 first - if it does not work &#039;upgrade&#039; to 777.&lt;br /&gt;
* You can also try to remove read access to config.php to others by setting this file&#039;s permissions to 750 - if it does not work &#039;upgrade&#039; to 755.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows file permissions==&lt;br /&gt;
&lt;br /&gt;
If you are using a windows server your should ensure that the admin folder allows the owner of the webserver process to write files to this directory, however all other files can be set to read-only and execute.&lt;br /&gt;
&lt;br /&gt;
==Other security issues==&lt;br /&gt;
&lt;br /&gt;
The /application/config/config.php file contains a user name and password for your database server. This poses certain security issues, particularly if you are using a login that has high level administrative access to your database. In the event of some error returning the content of this php file to a user&#039;s browser, your database password and other details could be compromised. One way to minimize risk (a little) is set up a specific login that only has specific rights to your limesurvey database.&lt;br /&gt;
&lt;br /&gt;
Another way to secure this information is to put the certain information from the /application/config/config.php file in a non-web directory, i.e. for Apache users this is the directory above the htdocs (aka public_html or www) folder. So you will use config.php, but have one line in it - a line that includes the file with ACTUAL configuration information (ex: &amp;lt;?php return include(&amp;quot;/home/hostfolder/safedata/configreal.php&amp;quot;); ?&amp;gt;). Remove all actual configuration information from /application/config/config.php, and paste it into the other file (configreal.php) that is included by /application/config/config.php. This other file should be located in a non-Web directory. Then /application/config/config.php will not contain database passwords, etc. - just the name of the file that DOES contain the database info. This avoids having to change all the other files that include /application/config/config.php, since they can still include it, and it will include the real config information. However you will need to edit configreal.php and change the follow parameters&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;basePath&#039; =&amp;gt; dirname(dirname(&#039;&#039;&#039;FILE&#039;&#039;&#039;)),&lt;br /&gt;
&lt;br /&gt;
&#039;runtimePath&#039; =&amp;gt; dirname(dirname(dirname(&#039;&#039;&#039;FILE&#039;&#039;&#039;))).DIRECTORY_SEPARATOR.&#039;tmp&#039;.DIRECTORY_SEPARATOR.&#039;runtime&#039;,&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
&#039;urlManager&#039; =&amp;gt; array(&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
&lt;br /&gt;
   &#039;rules&#039; =&amp;gt; require(&#039;routes.php&#039;),&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;
to use absolute directory paths to work properly. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;basePath&#039; =&amp;gt; &#039;/var/www/htdocs/limesurvey&#039;,&lt;br /&gt;
&lt;br /&gt;
&#039;runtimePath&#039; =&amp;gt; &#039;/var/www/htdocs/limesurvey/tmp/runtime&#039;,&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
&#039;urlManager&#039; =&amp;gt; array(&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
&lt;br /&gt;
   &#039;rules&#039; =&amp;gt; require(&#039;/var/www/htdocs/limesurvey/config/routes.php&#039;),&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;
Also don&#039;t use &amp;quot;admin&amp;quot; as the default user. Go to your MySQL database (or other one if you installed LimeSurvey on different database) and change default user name &amp;quot;admin&amp;quot; to whatever you prefer (e.g. &amp;quot;admin_xyz&amp;quot;). It will be now much harder to guess administrator&#039;s new user name. Remember, this is one of the two variables intruders can use to gain access. The admin password is the other variable. So choose it with extreme care.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=4465</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=4465"/>
		<updated>2013-02-01T11:57:23Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&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=&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&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;
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;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)==&lt;br /&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 if you have to re-order questions.  EM uses an 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 asked, 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;
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, weight_kg 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;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance===&lt;br /&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;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&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===&lt;br /&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;
[[File:tutorial4.jpg]]&lt;br /&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;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&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==&lt;br /&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===&lt;br /&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 in weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&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 multiple 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;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered (e.g. &amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;&lt;br /&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;
[[File:tailoring8.jpg]]&lt;br /&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;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports===&lt;br /&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;span&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&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;
[[File:tailoring12.jpg]]&lt;br /&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;
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==&lt;br /&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;
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;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 and later 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;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions==&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;SGQA&#039;&#039;&#039;:  This is how variables are named in LimeSurvey &amp;lt;= 1.91+&lt;br /&gt;
**Stands for Survey-Group-Question-Answer&lt;br /&gt;
**SGQA variable names look like 123X5X382X971, and may have sub-question suffixes.&lt;br /&gt;
**These variable names are specific to the underlying S/Q/G/A database codes, so often need to be changed&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;
**Although not required to be unique in &amp;lt;= 1.91+, it must be unique if you want to use EM&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?==&lt;br /&gt;
&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&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;
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;
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?==&lt;br /&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;
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?==&lt;br /&gt;
&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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?==&lt;br /&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 chldren&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?==&lt;br /&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;
**Eveything 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;
==How Backwards Compatible is EM with 1.91+?==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 is fully backwards-compatible with 1.91+ with one exception/caveat:  1.92 handles less-than / greater-than comparisons against empty values differently than 1.91+.&lt;br /&gt;
&lt;br /&gt;
One of the LimeSurvey demo surveys uses a set of conditions that translates to this relevance equation:  {(age &amp;lt; 16) or (age == 20) or ... or (age == 80)}. In LimeSurvey 1.91+, (age &amp;lt; 16) is FALSE when there is no answer (the value is blank).  However, in LimeSurey 1.92, (age &amp;lt; 16) is TRUE when there is no answer, since both PHP and JavaScript treat blank as 0 in mathematical comparisons.  Thus, 1.91+ would hide that question when age was unanswered, but 1.92 would show it.  We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat &amp;quot;&amp;quot; &amp;lt; 16 as FALSE.  Fortunately, there is an easy work-around for this.  If you want (age &amp;lt; 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age &amp;lt; 16)}.  You can use the new [[Show Logic File|Survey Logic File]] view to quickly identify and fix any such comparisons in your survey.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install 1.92+ 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;
**Availalbe Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolsted 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+)=&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type==&lt;br /&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?=&lt;br /&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)==&lt;br /&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===&lt;br /&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 diplayed. 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;
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;
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;
{|&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;
|}&lt;br /&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;
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 and 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===&lt;br /&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 deterimine 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===&lt;br /&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;
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===&lt;br /&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;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&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;
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;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
&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;
&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;
Expression Manager supports the following syntax:&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;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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 (=)===&lt;br /&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 sould 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;
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;
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;
&lt;br /&gt;
==Access to Variables==&lt;br /&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)&lt;br /&gt;
*INSERTANS:SGQA - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;)&lt;br /&gt;
*All {XXX} values used by templates&lt;br /&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;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security issue===&lt;br /&gt;
&lt;br /&gt;
For security issue, text entered by user are filtered. Some caracter are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming==&lt;br /&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;
QuestionCode . &#039;_&#039; . AnswerID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
{|&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},{Q20_comment}||{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|| || ||{Q22_E}||{Q22_E.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_D_comment}||{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;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables==&lt;br /&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;
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;
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;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&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.&lt;br /&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;
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;
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;
&#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;
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;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&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;
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;
==Access to Functions==&lt;br /&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===&lt;br /&gt;
&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
{|&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;
 [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 {MOUSEOVER(label=&amp;quot;v&amp;quot;)}In last 2.0 version{MOUSEOVER}||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]||Natural logarithm||number log(number)&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 string||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 a string||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)&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.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 a 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;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered===&lt;br /&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;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local==&lt;br /&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==&lt;br /&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;
{|&lt;br /&gt;
|Operator||Example||a||b||Result&lt;br /&gt;
|-&lt;br /&gt;
|+ (unary)||+a||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;
|+||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;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions===&lt;br /&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;
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 &#039;&#039; 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;
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;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converage 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?==&lt;br /&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;
{|&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;
|}&lt;br /&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;
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==&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting=&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Color||Sample||Meaning||Tooltip||Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||&amp;lt;span style=&#039;color:#eee8aa,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||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;
|blue bold text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:blue,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:grey,#eee8aa&#039;&amp;gt;&#039;Sample&#039;&amp;lt;/span&amp;gt;||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|bold maroon text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:maroon,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, but after the current question||&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 but after the current question is shown in bold maroon text.  This color coding should alert authors to possible errors in question sequencing; but it is allowed since some authors may want this sequence of variables a page, especially for dynamic reports.  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 cyan text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#4C88BE,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, prior to the current question||&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 and prior to the current question is shown in bold cyan 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 green text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:green,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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 pageis 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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#FF00FF,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on a later 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 pageis shown in bold pink text.  These are erorrs since the variable is  being used before it is declareed.  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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#996600,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||a lime relacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE} are shown in bold tan text.  The tooltip shows the current value.&lt;br /&gt;
|-&lt;br /&gt;
|red text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:red,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:black,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||punctuation||none||All other punctionation 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;
|}&lt;br /&gt;
&lt;br /&gt;
=Relationship to LimeSurvey Ideas / Feature Requests=&lt;br /&gt;
&lt;br /&gt;
Expression Manager provides complete or partial solutions to each of the following:&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1 Conditions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/3/ Answercounts]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/5 Advanced reporting for assessments]&lt;br /&gt;
**partial: Equations let one store the Assessment value in the database, and micro-tailoring can generate simple formatted reports.  Authors can access those Equation values if they have more complex reporting needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/6 Assessment reports]&lt;br /&gt;
**partial:  Since Equations store the Assessment score, it should be possible to use Statistics to show distributions of those scores, and Quotas to limit the number of responses with those scores.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/7 Store assessment results for further evaluation]&lt;br /&gt;
**Equations let one store the Assessment value in the database, completely solving this problem&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/22/ More advanced condition rules]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/28 Open Answertable up so that we can alter formatting]&lt;br /&gt;
**partial:  All of the question attributes are available, so authors can create custom AnswerTable equivalents as a Question.  Once implatemented, they can also use the showTheseResponses() or showAllResponsesExecpt() functions&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/37 Export survey results with full questions to include images]&lt;br /&gt;
**since Tailoring has access to the full question text, it can include images in the export&lt;br /&gt;
**if subjects choose Print Your Answers after finishing the survey, those printouts will be fully tailored&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/63 List of question codes and SGQA identifiers]&lt;br /&gt;
**The Show Survey Logic view shows that mapping (plus much more information)&lt;br /&gt;
**In addition, you no longer have to use SGQA codes to refer to variables - you can use the Question code/title.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/69 Branch/jump to another question (earlier or later) based on current question]&lt;br /&gt;
**You can use the Navigation Index for this in most cases&lt;br /&gt;
**Once implemented, you can use the JumpTo() function.  Like the Navigation Index, if you try to jump forward, it will stop on an intervening page if there are any of the relevant mandatory questions are unanswered, or if any relevant questions fail validation tests.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/86 set quota for total responses]&lt;br /&gt;
**If the final question is an Equation that flags a survey as completed (so is NULL if a respondant does not get to that page), you can use Quotas on that question to control the number of completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/101 Review all conditions]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/105 Review all questions + Review all groups]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/107 How to visualize questions, logic &amp;amp; conditions]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/113 Offline Surveys]&lt;br /&gt;
**Running a survey with all of the questions on the same page would let you do off-line data collection  (e.g. email the html page and associated JavaScript).  However, you would still want a way to submit the results so that they did not get lost.  It may be possible to use Save As HTML to save partially completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/120 Remove INSERTANS from question text at survey results]&lt;br /&gt;
**INSERTANS is no longer needed.  You can refer to a variable by its SGQA code (without prefixing it with INSERTANS:), or by its question code.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/137 Informed Consent and Authorization Functionality]&lt;br /&gt;
**You can show show the informed consent on the welcome page, then ask any additional questions needed (to ensure they meet the study inclusion/exclusion criteria), and ask them a Yes/No question whether they give their consent.  Then, make all of the remaining questions conditional on that yesNo.  For example, if the question is named &#039;&#039;consent&#039;&#039;, you would set the relevance to the remaining questions to &#039;&#039;consent == &amp;quot;Y&amp;quot;&#039;&#039; (possibly &#039;&#039;and&#039;&#039;ing that with whatever additional conditions you needed to support your branching needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/199 Show codes instead of of answers using INSERTANS]&lt;br /&gt;
**{Qcode} returns the code instead of the response text (which you can get via {INSERTANS:SGQA}, or {Qcode.shown}&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/204 Need group mean or calculations for assessments]&lt;br /&gt;
**Say you have N variables of which N-X were answered, you could compute the mean of the answered variables as {sum(var1, var2, ..., varN) / count(var1, var2, ..., varN)}&lt;br /&gt;
**Computing the mean across a set of respondants would require extension of the Quota functionality.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/222 To insert a language dependent text]&lt;br /&gt;
**Tailoring lets you conjugate verbs and decline nouns in each language&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/225 Surveyors should approve their answers]&lt;br /&gt;
**Custom Questions with tailoring, or the showAllResponsesExcept() function will let Surveyors see all of the questions and responses before clicking Submit. If the Navigation Menu option is enabled, it is easy to go back and correct answers.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Suppliment to #answernnXnnXnnn method of targetting form elements]&lt;br /&gt;
**You can now refer to questions and answers by their Question Code, so there is no longer a need to modify SGQA values.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/262 More flexibility with hidden questions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/265 Remove specific conditions from multiple questions]&lt;br /&gt;
**You can now use Relevance, which is easier to manage than Conditions.  If  needed, they can all be exported from the database, edited in a spreadsheet, and re-imported.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/268 Cross Survey Reporting]&lt;br /&gt;
**By using question codes that are unique across your surveys and versions, you can consolidate data from multiple surveys and/or compare them&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/275 Simplifying integration with other tools]&lt;br /&gt;
**Expression Manager uses Question Codes instead of SGQA, making it easier to integrate with other tools.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Expose assessment score to 3rd party app processing]&lt;br /&gt;
**This can be done with Equation question type&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/309 Multiple thank you pages]&lt;br /&gt;
**This can be supported via conditional relevance branching and tailoring&lt;br /&gt;
&lt;br /&gt;
=Additional Reading=&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=4466</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=4466"/>
		<updated>2013-02-01T11:56:14Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&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=&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&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;
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;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)==&lt;br /&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 if you have to re-order questions.  EM uses an 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 asked, 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;
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, weight_kg 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;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance===&lt;br /&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;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&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===&lt;br /&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;
[[File:tutorial4.jpg]]&lt;br /&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;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&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==&lt;br /&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===&lt;br /&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 in weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&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 multiple 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;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered (e.g. &amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;&lt;br /&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;
[[File:tailoring8.jpg]]&lt;br /&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;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports===&lt;br /&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;span&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&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;
[[File:tailoring12.jpg]]&lt;br /&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;
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==&lt;br /&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;
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;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 and later 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;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions==&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;SGQA&#039;&#039;&#039;:  This is how variables are named in LimeSurvey &amp;lt;= 1.91+&lt;br /&gt;
**Stands for Survey-Group-Question-Answer&lt;br /&gt;
**SGQA variable names look like 123X5X382X971, and may have sub-question suffixes.&lt;br /&gt;
**These variable names are specific to the underlying S/Q/G/A database codes, so often need to be changed&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;
**Although not required to be unique in &amp;lt;= 1.91+, it must be unique if you want to use EM&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?==&lt;br /&gt;
&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&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;
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;
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?==&lt;br /&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;
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?==&lt;br /&gt;
&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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?==&lt;br /&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 chldren&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?==&lt;br /&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;
**Eveything 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;
==How Backwards Compatible is EM with 1.91+?==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 is fully backwards-compatible with 1.91+ with one exception/caveat:  1.92 handles less-than / greater-than comparisons against empty values differently than 1.91+.&lt;br /&gt;
&lt;br /&gt;
One of the LimeSurvey demo surveys uses a set of conditions that translates to this relevance equation:  {(age &amp;lt; 16) or (age == 20) or ... or (age == 80)}. In LimeSurvey 1.91+, (age &amp;lt; 16) is FALSE when there is no answer (the value is blank).  However, in LimeSurey 1.92, (age &amp;lt; 16) is TRUE when there is no answer, since both PHP and JavaScript treat blank as 0 in mathematical comparisons.  Thus, 1.91+ would hide that question when age was unanswered, but 1.92 would show it.  We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat &amp;quot;&amp;quot; &amp;lt; 16 as FALSE.  Fortunately, there is an easy work-around for this.  If you want (age &amp;lt; 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age &amp;lt; 16)}.  You can use the new [[Show Logic File|Survey Logic File]] view to quickly identify and fix any such comparisons in your survey.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install 1.92+ 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;
**Availalbe Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolsted 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+)=&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type==&lt;br /&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?=&lt;br /&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)==&lt;br /&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===&lt;br /&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 diplayed. 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;
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;
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;
{|&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;
|}&lt;br /&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;
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 and 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===&lt;br /&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 deterimine 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===&lt;br /&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;
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===&lt;br /&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;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&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;
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;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
&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;
&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;
Expression Manager supports the following syntax:&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;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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 (=)===&lt;br /&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 sould 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;
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;
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;
&lt;br /&gt;
==Access to Variables==&lt;br /&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)&lt;br /&gt;
*INSERTANS:SGQA - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;)&lt;br /&gt;
*All {XXX} values used by templates&lt;br /&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;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Syntax||Meaning||Example||Example Result&lt;br /&gt;
|-&lt;br /&gt;
|Qcode||an alias for Qcode.code||{join(&#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||{join(&#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||{join(&#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;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security issue===&lt;br /&gt;
&lt;br /&gt;
For security issue, text entered by user are filtered. Some caracter are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming==&lt;br /&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;
QuestionCode . &#039;_&#039; . AnswerID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
{|&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},{Q20_comment}||{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|| || ||{Q22_E}||{Q22_E.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_D_comment}||{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;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables==&lt;br /&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;
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;
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;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&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.&lt;br /&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;
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;
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;
&#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;
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;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&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;
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;
==Access to Functions==&lt;br /&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===&lt;br /&gt;
&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
{|&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;
 [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 {MOUSEOVER(label=&amp;quot;v&amp;quot;)}In last 2.0 version{MOUSEOVER}||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]||Natural logarithm||number log(number)&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 string||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 a string||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)&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.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 a 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;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered===&lt;br /&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;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local==&lt;br /&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==&lt;br /&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;
{|&lt;br /&gt;
|Operator||Example||a||b||Result&lt;br /&gt;
|-&lt;br /&gt;
|+ (unary)||+a||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;
|+||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;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions===&lt;br /&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;
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 &#039;&#039; 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;
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;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converage 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?==&lt;br /&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;
{|&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;
|}&lt;br /&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;
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==&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting=&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Color||Sample||Meaning||Tooltip||Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||&amp;lt;span style=&#039;color:#eee8aa,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||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;
|blue bold text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:blue,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:grey,#eee8aa&#039;&amp;gt;&#039;Sample&#039;&amp;lt;/span&amp;gt;||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|bold maroon text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:maroon,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, but after the current question||&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 but after the current question is shown in bold maroon text.  This color coding should alert authors to possible errors in question sequencing; but it is allowed since some authors may want this sequence of variables a page, especially for dynamic reports.  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 cyan text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#4C88BE,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, prior to the current question||&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 and prior to the current question is shown in bold cyan 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 green text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:green,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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 pageis 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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#FF00FF,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on a later 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 pageis shown in bold pink text.  These are erorrs since the variable is  being used before it is declareed.  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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#996600,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||a lime relacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE} are shown in bold tan text.  The tooltip shows the current value.&lt;br /&gt;
|-&lt;br /&gt;
|red text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:red,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:black,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||punctuation||none||All other punctionation 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;
|}&lt;br /&gt;
&lt;br /&gt;
=Relationship to LimeSurvey Ideas / Feature Requests=&lt;br /&gt;
&lt;br /&gt;
Expression Manager provides complete or partial solutions to each of the following:&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1 Conditions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/3/ Answercounts]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/5 Advanced reporting for assessments]&lt;br /&gt;
**partial: Equations let one store the Assessment value in the database, and micro-tailoring can generate simple formatted reports.  Authors can access those Equation values if they have more complex reporting needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/6 Assessment reports]&lt;br /&gt;
**partial:  Since Equations store the Assessment score, it should be possible to use Statistics to show distributions of those scores, and Quotas to limit the number of responses with those scores.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/7 Store assessment results for further evaluation]&lt;br /&gt;
**Equations let one store the Assessment value in the database, completely solving this problem&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/22/ More advanced condition rules]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/28 Open Answertable up so that we can alter formatting]&lt;br /&gt;
**partial:  All of the question attributes are available, so authors can create custom AnswerTable equivalents as a Question.  Once implatemented, they can also use the showTheseResponses() or showAllResponsesExecpt() functions&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/37 Export survey results with full questions to include images]&lt;br /&gt;
**since Tailoring has access to the full question text, it can include images in the export&lt;br /&gt;
**if subjects choose Print Your Answers after finishing the survey, those printouts will be fully tailored&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/63 List of question codes and SGQA identifiers]&lt;br /&gt;
**The Show Survey Logic view shows that mapping (plus much more information)&lt;br /&gt;
**In addition, you no longer have to use SGQA codes to refer to variables - you can use the Question code/title.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/69 Branch/jump to another question (earlier or later) based on current question]&lt;br /&gt;
**You can use the Navigation Index for this in most cases&lt;br /&gt;
**Once implemented, you can use the JumpTo() function.  Like the Navigation Index, if you try to jump forward, it will stop on an intervening page if there are any of the relevant mandatory questions are unanswered, or if any relevant questions fail validation tests.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/86 set quota for total responses]&lt;br /&gt;
**If the final question is an Equation that flags a survey as completed (so is NULL if a respondant does not get to that page), you can use Quotas on that question to control the number of completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/101 Review all conditions]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/105 Review all questions + Review all groups]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/107 How to visualize questions, logic &amp;amp; conditions]&lt;br /&gt;
**The [[Show Logic File|Show Logic File]] view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/113 Offline Surveys]&lt;br /&gt;
**Running a survey with all of the questions on the same page would let you do off-line data collection  (e.g. email the html page and associated JavaScript).  However, you would still want a way to submit the results so that they did not get lost.  It may be possible to use Save As HTML to save partially completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/120 Remove INSERTANS from question text at survey results]&lt;br /&gt;
**INSERTANS is no longer needed.  You can refer to a variable by its SGQA code (without prefixing it with INSERTANS:), or by its question code.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/137 Informed Consent and Authorization Functionality]&lt;br /&gt;
**You can show show the informed consent on the welcome page, then ask any additional questions needed (to ensure they meet the study inclusion/exclusion criteria), and ask them a Yes/No question whether they give their consent.  Then, make all of the remaining questions conditional on that yesNo.  For example, if the question is named &#039;&#039;consent&#039;&#039;, you would set the relevance to the remaining questions to &#039;&#039;consent == &amp;quot;Y&amp;quot;&#039;&#039; (possibly &#039;&#039;and&#039;&#039;ing that with whatever additional conditions you needed to support your branching needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/199 Show codes instead of of answers using INSERTANS]&lt;br /&gt;
**{Qcode} returns the code instead of the response text (which you can get via {INSERTANS:SGQA}, or {Qcode.shown}&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/204 Need group mean or calculations for assessments]&lt;br /&gt;
**Say you have N variables of which N-X were answered, you could compute the mean of the answered variables as {sum(var1, var2, ..., varN) / count(var1, var2, ..., varN)}&lt;br /&gt;
**Computing the mean across a set of respondants would require extension of the Quota functionality.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/222 To insert a language dependent text]&lt;br /&gt;
**Tailoring lets you conjugate verbs and decline nouns in each language&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/225 Surveyors should approve their answers]&lt;br /&gt;
**Custom Questions with tailoring, or the showAllResponsesExcept() function will let Surveyors see all of the questions and responses before clicking Submit. If the Navigation Menu option is enabled, it is easy to go back and correct answers.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Suppliment to #answernnXnnXnnn method of targetting form elements]&lt;br /&gt;
**You can now refer to questions and answers by their Question Code, so there is no longer a need to modify SGQA values.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/262 More flexibility with hidden questions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/265 Remove specific conditions from multiple questions]&lt;br /&gt;
**You can now use Relevance, which is easier to manage than Conditions.  If  needed, they can all be exported from the database, edited in a spreadsheet, and re-imported.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/268 Cross Survey Reporting]&lt;br /&gt;
**By using question codes that are unique across your surveys and versions, you can consolidate data from multiple surveys and/or compare them&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/275 Simplifying integration with other tools]&lt;br /&gt;
**Expression Manager uses Question Codes instead of SGQA, making it easier to integrate with other tools.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Expose assessment score to 3rd party app processing]&lt;br /&gt;
**This can be done with Equation question type&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/309 Multiple thank you pages]&lt;br /&gt;
**This can be supported via conditional relevance branching and tailoring&lt;br /&gt;
&lt;br /&gt;
=Additional Reading=&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_security_hints&amp;diff=1706</id>
		<title>Installation security hints</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_security_hints&amp;diff=1706"/>
		<updated>2013-02-01T10:07:54Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey relies on its own security system which is activated by default. The authors of this software takes no responsibility and makes no claims in relation to the appropriateness or secureness of this software. However we take security issues very serious and react quickly - if you know of any security problems with LimeSurvey please let us know: info@limesurvey.org or open a bug report at our [http://bugs.limesurvey.org bug tracker] (please mark it as private).&lt;br /&gt;
&lt;br /&gt;
==Linux file permissions==&lt;br /&gt;
&lt;br /&gt;
If you are using a Linux server, setting according file permissions is required to secure your LimeSurey installation.&lt;br /&gt;
&lt;br /&gt;
===Basic facts about Linux/*nix file permissions===&lt;br /&gt;
&lt;br /&gt;
A Linux/*nix operating system is multi-user. This means that, apart from your personal account, other user accounts may exist on the system and you should take care of what permissions you give to other users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039; Setting file permissions is especially important in order to secure configuration files holding critical data such as passwords.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note however that the &#039;root&#039; account will always be granted permission to access your files (no matter what file permissions you set) as it is the super-admin user.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The webserver (which runs LimeSurvey), is also running under a given identity (user). On Linux, this is usually the &#039;www&#039;,&#039;www-data&#039; (on Debian/Ubuntu), &#039;apache&#039; or &#039;nobody&#039; user. However, some hosting companies use systems (such as suexec) which make it possible to run LimeSurvey scripts with your personal user. Of course the webserver user must have the right to read LimeSurvey files. However, only a small subset of LimeSurvey subdirectories must be writeable by the webserver user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint&#039;&#039;&#039;: It is very valuable to revoke write permission for the webserver user to these LimeSurvey subdirectories that do not require it. Indeed, even if a LimeSurvey vulnerability might be discovered, the main files will still be protected from an illicit modification thanks to the file system permissions.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting file permissions on a self-managed Linux system===&lt;br /&gt;
&lt;br /&gt;
If you&#039;re managing your webserver and operating system configuration (you are the owner of the physical server or are renting a virtual server on which you have root access), you can follow these recommendations.&lt;br /&gt;
&lt;br /&gt;
You can first set the owner and group of your LimeSurvey files so that it will ease the file permissions setup.&lt;br /&gt;
&lt;br /&gt;
A possible strategy is to set the owner of the LimeSurvey files to your personal username, and the group of the LimeSurvey files to the webserver group. Usually this webserver group only contains the webserver account (and possibly another webmaster account).&lt;br /&gt;
&lt;br /&gt;
For instance if your username is &#039;myaccount&#039; and the webserver user is &#039;apache&#039; in the &#039;apache&#039; group, then, from a shell access, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
$ chown -R myaccount:apache limesurvey/&lt;br /&gt;
&lt;br /&gt;
Then set the file and subdirectories permissions.&lt;br /&gt;
&lt;br /&gt;
For the script to work properly it needs write access to some directories:&lt;br /&gt;
*The &amp;quot;/limesurvey/tmp&amp;quot; directory and its subdirectories are used for imports/uploads and should be set to &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver.&lt;br /&gt;
*The upload/ directory and all its subdirectories must also have &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver in order to enable picture and media files upload.&lt;br /&gt;
* All other directories and files can be set to &#039;&#039;Read Only&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039; Supposing you&#039;ve followed the above recommendations on owner/group, these settings can be applied by the following commands:&lt;br /&gt;
&lt;br /&gt;
$ chmod -R o-r-w-x limesurvey/&lt;br /&gt;
&lt;br /&gt;
$ chmod -R -w limesurvey/&lt;br /&gt;
&lt;br /&gt;
$ chmod -R 770 limesurvey/tmp&lt;br /&gt;
&lt;br /&gt;
$ chmod -R 770 limesurvey/upload&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting file permissions on a hosted webserver===&lt;br /&gt;
&lt;br /&gt;
Giving a standard procedure to secure a web application on a hosted environment is rather difficult because hosted environments differ in so many ways.&lt;br /&gt;
&lt;br /&gt;
As in the managed server case, for the script to work properly it needs write access to some directories:&lt;br /&gt;
*The &amp;quot;/limesurvey/tmp&amp;quot; directory is used for imports/uploads and should be set to &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver.&lt;br /&gt;
*The upload/ directory and all its sub directories must also have &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver in order to enable picture and media files upload.&lt;br /&gt;
* The other directories and files should be set to &#039;&#039;Read Only&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039;&lt;br /&gt;
* Depending on your webserver configuration you will have to chmod the rights on the writable folders to 755 or 777 to make it writable for the webserver. Try 755 first - if it does not work &#039;upgrade&#039; to 777.&lt;br /&gt;
* You can also try to remove read access to config.php to others by setting this file&#039;s permissions to 750 - if it does not work &#039;upgrade&#039; to 755.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Windows file permissions==&lt;br /&gt;
&lt;br /&gt;
If you are using a windows server your should ensure that the admin folder allows the owner of the webserver process to write files to this directory, however all other files can be set to read-only and execute.&lt;br /&gt;
&lt;br /&gt;
==Other security issues==&lt;br /&gt;
&lt;br /&gt;
The /application/config/config.php file contains a user name and password for your database server. This poses certain security issues, particularly if you are using a login that has high level administrative access to your database. In the event of some error returning the content of this php file to a user&#039;s browser, your database password and other details could be compromised. One way to minimize risk (a little) is set up a specific login that only has specific rights to your limesurvey database.&lt;br /&gt;
&lt;br /&gt;
Another way to secure this information is to put the certain information from the /application/config/config.php file in a non-web directory, i.e. for Apache users this is the directory above the htdocs (aka public_html or www) folder. So you will use config.php, but have one line in it - a line that includes the file with ACTUAL configuration information (ex: &amp;lt;?php return include(&amp;quot;/home/hostfolder/safedata/configreal.php&amp;quot;); ?&amp;gt;). Remove all actual configuration information from /application/config/config.php, and paste it into the other file (configreal.php) that is included by /application/config/config.php. This other file should be located in a non-Web directory. Then /application/config/config.php will not contain database passwords, etc. - just the name of the file that DOES contain the database info. This avoids having to change all the other files that include /application/config/config.php, since they can still include it, and it will include the real config information. However you will need to edit configreal.php and change the follow parameters&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;basePath&#039; =&amp;gt; dirname(dirname(&#039;&#039;&#039;FILE&#039;&#039;&#039;)),&lt;br /&gt;
&lt;br /&gt;
&#039;runtimePath&#039; =&amp;gt; dirname(dirname(dirname(&#039;&#039;&#039;FILE&#039;&#039;&#039;))).DIRECTORY_SEPARATOR.&#039;tmp&#039;.DIRECTORY_SEPARATOR.&#039;runtime&#039;,&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
&#039;urlManager&#039; =&amp;gt; array(&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
&lt;br /&gt;
   &#039;rules&#039; =&amp;gt; require(&#039;routes.php&#039;),&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;
to use absolute directory paths to work properly. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;basePath&#039; =&amp;gt; &#039;/var/www/htdocs/limesurvey&#039;,&lt;br /&gt;
&lt;br /&gt;
&#039;runtimePath&#039; =&amp;gt; &#039;/var/www/htdocs/limesurvey/tmp/runtime&#039;,&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
&#039;urlManager&#039; =&amp;gt; array(&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
&lt;br /&gt;
   &#039;rules&#039; =&amp;gt; require(&#039;/var/www/htdocs/limesurvey/routes.php&#039;),&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;
Also don&#039;t use &amp;quot;admin&amp;quot; as the default user. Go to your MySQL database (or other one if you installed LimeSurvey on different database) and change default user name &amp;quot;admin&amp;quot; to whatever you prefer (e.g. &amp;quot;admin_xyz&amp;quot;). It will be now much harder to guess administrator&#039;s new user name. Remember, this is one of the two variables intruders can use to gain access. The admin password is the other variable. So choose it with extreme care.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=1019</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=1019"/>
		<updated>2013-01-15T08:54:01Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&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=&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&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;
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;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)==&lt;br /&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 if you have to re-order questions.  EM uses an 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 asked, 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;
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, weight_kg 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;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance===&lt;br /&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;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&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===&lt;br /&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;
[[File:tutorial4.jpg]]&lt;br /&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;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&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==&lt;br /&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===&lt;br /&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 in weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&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 multiple 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;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered (e.g. &amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;&lt;br /&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;
[[File:tailoring8.jpg]]&lt;br /&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;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports===&lt;br /&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;span&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&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;
[[File:tailoring12.jpg]]&lt;br /&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;
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==&lt;br /&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;
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;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 and later 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;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions==&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;SGQA&#039;&#039;&#039;:  This is how variables are named in LimeSurvey &amp;lt;= 1.91+&lt;br /&gt;
**Stands for Survey-Group-Question-Answer&lt;br /&gt;
**SGQA variable names look like 123X5X382X971, and may have sub-question suffixes.&lt;br /&gt;
**These variable names are specific to the underlying S/Q/G/A database codes, so often need to be changed&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;
**Although not required to be unique in &amp;lt;= 1.91+, it must be unique if you want to use EM&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?==&lt;br /&gt;
&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&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;
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;
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?==&lt;br /&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;
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?==&lt;br /&gt;
&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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?==&lt;br /&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 chldren&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?==&lt;br /&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;
**Eveything 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;
==How Backwards Compatible is EM with 1.91+?==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 is fully backwards-compatible with 1.91+ with one exception/caveat:  1.92 handles less-than / greater-than comparisons against empty values differently than 1.91+.&lt;br /&gt;
&lt;br /&gt;
One of the LimeSurvey demo surveys uses a set of conditions that translates to this relevance equation:  {(age &amp;lt; 16) or (age == 20) or ... or (age == 80)}. In LimeSurvey 1.91+, (age &amp;lt; 16) is FALSE when there is no answer (the value is blank).  However, in LimeSurey 1.92, (age &amp;lt; 16) is TRUE when there is no answer, since both PHP and JavaScript treat blank as 0 in mathematical comparisons.  Thus, 1.91+ would hide that question when age was unanswered, but 1.92 would show it.  We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat &amp;quot;&amp;quot; &amp;lt; 16 as FALSE.  Fortunately, there is an easy work-around for this.  If you want (age &amp;lt; 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age &amp;lt; 16)}.  You can use the new Survey Logic File view to quickly identify and fix any such comparisons in your survey.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install 1.92+ 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;
**Availalbe Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolsted 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+)=&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type==&lt;br /&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?=&lt;br /&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)==&lt;br /&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===&lt;br /&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 diplayed. 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;
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;
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;
{|&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;
|}&lt;br /&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;
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 and 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===&lt;br /&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 deterimine 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===&lt;br /&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;
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===&lt;br /&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;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&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;
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;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
&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;
&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;
Expression Manager supports the following syntax:&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;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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 (=)===&lt;br /&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 sould 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;
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;
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;
&lt;br /&gt;
==Access to Variables==&lt;br /&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)&lt;br /&gt;
*INSERTANS:SGQA - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;)&lt;br /&gt;
*All {XXX} values used by templates&lt;br /&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;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Syntax||Meaning||Example||Example Result&lt;br /&gt;
|-&lt;br /&gt;
|Qcode||an alias for Qcode.code||{join(&#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||{join(&#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||{join(&#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;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security issue===&lt;br /&gt;
&lt;br /&gt;
For security issue, text entered by user are filtered. Some caracter are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming==&lt;br /&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;
QuestionCode . &#039;_&#039; . AnswerID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
{|&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},{Q20_comment}||{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|| || ||{Q22_E}||{Q22_E.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_D_comment}||{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;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables==&lt;br /&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;
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;
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;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&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.&lt;br /&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;
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;
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;
&#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;
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;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&gt;
&lt;br /&gt;
The one caveat is that when you use the 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;
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;
==Access to Functions==&lt;br /&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===&lt;br /&gt;
&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
{|&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;
 [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;
|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]||Natural logarithm||number log(number)&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||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 string||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 a string||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)&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.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 a 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;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered===&lt;br /&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;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local==&lt;br /&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==&lt;br /&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;
{|&lt;br /&gt;
|Operator||Example||a||b||Result&lt;br /&gt;
|-&lt;br /&gt;
|+ (unary)||+a||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;
|+||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;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions===&lt;br /&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;
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 &#039;&#039; 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;
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;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converage 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?==&lt;br /&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;
{|&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;
|}&lt;br /&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;
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==&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting=&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Color||Sample||Meaning||Tooltip||Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||&amp;lt;span style=&#039;color:#eee8aa,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||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;
|blue bold text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:blue,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:grey,#eee8aa&#039;&amp;gt;&#039;Sample&#039;&amp;lt;/span&amp;gt;||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|bold maroon text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:maroon,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, but after the current question||&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 but after the current question is shown in bold maroon text.  This color coding should alert authors to possible errors in question sequencing; but it is allowed since some authors may want this sequence of variables a page, especially for dynamic reports.  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 cyan text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#4C88BE,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, prior to the current question||&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 and prior to the current question is shown in bold cyan 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 green text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:green,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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 pageis 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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#FF00FF,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on a later 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 pageis shown in bold pink text.  These are erorrs since the variable is  being used before it is declareed.  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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#996600,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||a lime relacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE} are shown in bold tan text.  The tooltip shows the current value.&lt;br /&gt;
|-&lt;br /&gt;
|red text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:red,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:black,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||punctuation||none||All other punctionation 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;
|}&lt;br /&gt;
&lt;br /&gt;
=Relationship to LimeSurvey Ideas / Feature Requests=&lt;br /&gt;
&lt;br /&gt;
Expression Manager provides complete or partial solutions to each of the following:&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1 Conditions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/3/ Answercounts]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/5 Advanced reporting for assessments]&lt;br /&gt;
**partial: Equations let one store the Assessment value in the database, and micro-tailoring can generate simple formatted reports.  Authors can access those Equation values if they have more complex reporting needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/6 Assessment reports]&lt;br /&gt;
**partial:  Since Equations store the Assessment score, it should be possible to use Statistics to show distributions of those scores, and Quotas to limit the number of responses with those scores.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/7 Store assessment results for further evaluation]&lt;br /&gt;
**Equations let one store the Assessment value in the database, completely solving this problem&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/22/ More advanced condition rules]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/28 Open Answertable up so that we can alter formatting]&lt;br /&gt;
**partial:  All of the question attributes are available, so authors can create custom AnswerTable equivalents as a Question.  Once implatemented, they can also use the showTheseResponses() or showAllResponsesExecpt() functions&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/37 Export survey results with full questions to include images]&lt;br /&gt;
**since Tailoring has access to the full question text, it can include images in the export&lt;br /&gt;
**if subjects choose Print Your Answers after finishing the survey, those printouts will be fully tailored&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/63 List of question codes and SGQA identifiers]&lt;br /&gt;
**The Show Survey Logic view shows that mapping (plus much more information)&lt;br /&gt;
**In addition, you no longer have to use SGQA codes to refer to variables - you can use the Question code/title.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/69 Branch/jump to another question (earlier or later) based on current question]&lt;br /&gt;
**You can use the Navigation Index for this in most cases&lt;br /&gt;
**Once implemented, you can use the JumpTo() function.  Like the Navigation Index, if you try to jump forward, it will stop on an intervening page if there are any of the relevant mandatory questions are unanswered, or if any relevant questions fail validation tests.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/86 set quota for total responses]&lt;br /&gt;
**If the final question is an Equation that flags a survey as completed (so is NULL if a respondant does not get to that page), you can use Quotas on that question to control the number of completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/101 Review all conditions]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/105 Review all questions + Review all groups]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/107 How to visualize questions, logic &amp;amp; conditions]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/113 Offline Surveys]&lt;br /&gt;
**Running a survey with all of the questions on the same page would let you do off-line data collection  (e.g. email the html page and associated JavaScript).  However, you would still want a way to submit the results so that they did not get lost.  It may be possible to use Save As HTML to save partially completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/120 Remove INSERTANS from question text at survey results]&lt;br /&gt;
**INSERTANS is no longer needed.  You can refer to a variable by its SGQA code (without prefixing it with INSERTANS:), or by its question code.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/137 Informed Consent and Authorization Functionality]&lt;br /&gt;
**You can show show the informed consent on the welcome page, then ask any additional questions needed (to ensure they meet the study inclusion/exclusion criteria), and ask them a Yes/No question whether they give their consent.  Then, make all of the remaining questions conditional on that yesNo.  For example, if the question is named &#039;&#039;consent&#039;&#039;, you would set the relevance to the remaining questions to &#039;&#039;consent == &amp;quot;Y&amp;quot;&#039;&#039; (possibly &#039;&#039;and&#039;&#039;ing that with whatever additional conditions you needed to support your branching needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/199 Show codes instead of of answers using INSERTANS]&lt;br /&gt;
**{Qcode} returns the code instead of the response text (which you can get via {INSERTANS:SGQA}, or {Qcode.shown}&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/204 Need group mean or calculations for assessments]&lt;br /&gt;
**Say you have N variables of which N-X were answered, you could compute the mean of the answered variables as {sum(var1, var2, ..., varN) / count(var1, var2, ..., varN)}&lt;br /&gt;
**Computing the mean across a set of respondants would require extension of the Quota functionality.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/222 To insert a language dependent text]&lt;br /&gt;
**Tailoring lets you conjugate verbs and decline nouns in each language&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/225 Surveyors should approve their answers]&lt;br /&gt;
**Custom Questions with tailoring, or the showAllResponsesExcept() function will let Surveyors see all of the questions and responses before clicking Submit. If the Navigation Menu option is enabled, it is easy to go back and correct answers.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Suppliment to #answernnXnnXnnn method of targetting form elements]&lt;br /&gt;
**You can now refer to questions and answers by their Question Code, so there is no longer a need to modify SGQA values.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/262 More flexibility with hidden questions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/265 Remove specific conditions from multiple questions]&lt;br /&gt;
**You can now use Relevance, which is easier to manage than Conditions.  If  needed, they can all be exported from the database, edited in a spreadsheet, and re-imported.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/268 Cross Survey Reporting]&lt;br /&gt;
**By using question codes that are unique across your surveys and versions, you can consolidate data from multiple surveys and/or compare them&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/275 Simplifying integration with other tools]&lt;br /&gt;
**Expression Manager uses Question Codes instead of SGQA, making it easier to integrate with other tools.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Expose assessment score to 3rd party app processing]&lt;br /&gt;
**This can be done with Equation question type&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/309 Multiple thank you pages]&lt;br /&gt;
**This can be supported via conditional relevance branching and tailoring&lt;br /&gt;
&lt;br /&gt;
=Additional Reading=&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=1020</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=1020"/>
		<updated>2012-12-20T08:36:50Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&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=&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&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;
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;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)==&lt;br /&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 if you have to re-order questions.  EM uses an 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 asked, 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;
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, weight_kg 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;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance===&lt;br /&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;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&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===&lt;br /&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;
[[File:tutorial4.jpg]]&lt;br /&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;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&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==&lt;br /&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===&lt;br /&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 in weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&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 multiple 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;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered (e.g. &amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;&lt;br /&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;
[[File:tailoring8.jpg]]&lt;br /&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;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports===&lt;br /&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;span&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&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;
[[File:tailoring12.jpg]]&lt;br /&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;
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==&lt;br /&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;
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;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 and later 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;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions==&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;SGQA&#039;&#039;&#039;:  This is how variables are named in LimeSurvey &amp;lt;= 1.91+&lt;br /&gt;
**Stands for Survey-Group-Question-Answer&lt;br /&gt;
**SGQA variable names look like 123X5X382X971, and may have sub-question suffixes.&lt;br /&gt;
**These variable names are specific to the underlying S/Q/G/A database codes, so often need to be changed&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;
**Although not required to be unique in &amp;lt;= 1.91+, it must be unique if you want to use EM&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?==&lt;br /&gt;
&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&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;
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;
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?==&lt;br /&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;
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?==&lt;br /&gt;
&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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?==&lt;br /&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 chldren&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?==&lt;br /&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;
**Eveything 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;
==How Backwards Compatible is EM with 1.91+?==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 is fully backwards-compatible with 1.91+ with one exception/caveat:  1.92 handles less-than / greater-than comparisons against empty values differently than 1.91+.&lt;br /&gt;
&lt;br /&gt;
One of the LimeSurvey demo surveys uses a set of conditions that translates to this relevance equation:  {(age &amp;lt; 16) or (age == 20) or ... or (age == 80)}. In LimeSurvey 1.91+, (age &amp;lt; 16) is FALSE when there is no answer (the value is blank).  However, in LimeSurey 1.92, (age &amp;lt; 16) is TRUE when there is no answer, since both PHP and JavaScript treat blank as 0 in mathematical comparisons.  Thus, 1.91+ would hide that question when age was unanswered, but 1.92 would show it.  We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat &amp;quot;&amp;quot; &amp;lt; 16 as FALSE.  Fortunately, there is an easy work-around for this.  If you want (age &amp;lt; 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age &amp;lt; 16)}.  You can use the new Survey Logic File view to quickly identify and fix any such comparisons in your survey.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install 1.92+ 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;
**Availalbe Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolsted 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+)=&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type==&lt;br /&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?=&lt;br /&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)==&lt;br /&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===&lt;br /&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 diplayed. 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;
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;
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;
{|&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;
|}&lt;br /&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;
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 and 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===&lt;br /&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 deterimine 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===&lt;br /&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;
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===&lt;br /&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;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&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;
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;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
&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;
&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;
Expression Manager supports the following syntax:&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;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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 (=)===&lt;br /&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 sould 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;
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;
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;
&lt;br /&gt;
==Access to Variables==&lt;br /&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)&lt;br /&gt;
*INSERTANS:SGQA - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;)&lt;br /&gt;
*All {XXX} values used by templates&lt;br /&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;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Syntax||Meaning||Example||Example Result&lt;br /&gt;
|-&lt;br /&gt;
|Qcode||an alias for Qcode.code||{join(&#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||{join(&#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||{join(&#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;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security issue===&lt;br /&gt;
&lt;br /&gt;
For security issue, text entered by user are filtered. Some caracter are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;gt;&lt;br /&gt;
* \n by &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
* &amp;quot; by &amp;amp;quot;&lt;br /&gt;
* &#039; by &amp;amp;amp;#39;&lt;br /&gt;
* % by &amp;amp;amp;#37;&lt;br /&gt;
* ( by &amp;amp;amp;#40;&lt;br /&gt;
* ) by &amp;amp;amp;#41;&lt;br /&gt;
* + by &amp;amp;amp;#43;&lt;br /&gt;
* - by &amp;amp;amp;#45;&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming==&lt;br /&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;
QuestionCode . &#039;_&#039; . AnswerID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
{|&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},{Q20_comment}||{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|| || ||{Q22_E}||{Q22_E.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_D_comment}||{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;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables==&lt;br /&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;
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;
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;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&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.&lt;br /&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;
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;
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;
&#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;
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;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&gt;
&lt;br /&gt;
The one caveat is that when you use the 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;
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;
==Access to Functions==&lt;br /&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===&lt;br /&gt;
&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
{|&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;
 [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;
|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]||Natural logarithm||number log(number)&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||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 string||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 a string||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)&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.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 a 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;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered===&lt;br /&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;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local==&lt;br /&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==&lt;br /&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;
{|&lt;br /&gt;
|Operator||Example||a||b||Result&lt;br /&gt;
|-&lt;br /&gt;
|+ (unary)||+a||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;
|+||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;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions===&lt;br /&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;
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 &#039;&#039; 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;
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;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converage 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?==&lt;br /&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;
{|&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;
|}&lt;br /&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;
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==&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting=&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Color||Sample||Meaning||Tooltip||Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||&amp;lt;span style=&#039;color:#eee8aa,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||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;
|blue bold text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:blue,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:grey,#eee8aa&#039;&amp;gt;&#039;Sample&#039;&amp;lt;/span&amp;gt;||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|bold maroon text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:maroon,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, but after the current question||&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 but after the current question is shown in bold maroon text.  This color coding should alert authors to possible errors in question sequencing; but it is allowed since some authors may want this sequence of variables a page, especially for dynamic reports.  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 cyan text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#4C88BE,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, prior to the current question||&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 and prior to the current question is shown in bold cyan 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 green text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:green,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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 pageis 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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#FF00FF,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on a later 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 pageis shown in bold pink text.  These are erorrs since the variable is  being used before it is declareed.  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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#996600,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||a lime relacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE} are shown in bold tan text.  The tooltip shows the current value.&lt;br /&gt;
|-&lt;br /&gt;
|red text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:red,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:black,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||punctuation||none||All other punctionation 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;
|}&lt;br /&gt;
&lt;br /&gt;
=Relationship to LimeSurvey Ideas / Feature Requests=&lt;br /&gt;
&lt;br /&gt;
Expression Manager provides complete or partial solutions to each of the following:&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1 Conditions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/3/ Answercounts]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/5 Advanced reporting for assessments]&lt;br /&gt;
**partial: Equations let one store the Assessment value in the database, and micro-tailoring can generate simple formatted reports.  Authors can access those Equation values if they have more complex reporting needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/6 Assessment reports]&lt;br /&gt;
**partial:  Since Equations store the Assessment score, it should be possible to use Statistics to show distributions of those scores, and Quotas to limit the number of responses with those scores.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/7 Store assessment results for further evaluation]&lt;br /&gt;
**Equations let one store the Assessment value in the database, completely solving this problem&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/22/ More advanced condition rules]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/28 Open Answertable up so that we can alter formatting]&lt;br /&gt;
**partial:  All of the question attributes are available, so authors can create custom AnswerTable equivalents as a Question.  Once implatemented, they can also use the showTheseResponses() or showAllResponsesExecpt() functions&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/37 Export survey results with full questions to include images]&lt;br /&gt;
**since Tailoring has access to the full question text, it can include images in the export&lt;br /&gt;
**if subjects choose Print Your Answers after finishing the survey, those printouts will be fully tailored&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/63 List of question codes and SGQA identifiers]&lt;br /&gt;
**The Show Survey Logic view shows that mapping (plus much more information)&lt;br /&gt;
**In addition, you no longer have to use SGQA codes to refer to variables - you can use the Question code/title.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/69 Branch/jump to another question (earlier or later) based on current question]&lt;br /&gt;
**You can use the Navigation Index for this in most cases&lt;br /&gt;
**Once implemented, you can use the JumpTo() function.  Like the Navigation Index, if you try to jump forward, it will stop on an intervening page if there are any of the relevant mandatory questions are unanswered, or if any relevant questions fail validation tests.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/86 set quota for total responses]&lt;br /&gt;
**If the final question is an Equation that flags a survey as completed (so is NULL if a respondant does not get to that page), you can use Quotas on that question to control the number of completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/101 Review all conditions]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/105 Review all questions + Review all groups]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/107 How to visualize questions, logic &amp;amp; conditions]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/113 Offline Surveys]&lt;br /&gt;
**Running a survey with all of the questions on the same page would let you do off-line data collection  (e.g. email the html page and associated JavaScript).  However, you would still want a way to submit the results so that they did not get lost.  It may be possible to use Save As HTML to save partially completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/120 Remove INSERTANS from question text at survey results]&lt;br /&gt;
**INSERTANS is no longer needed.  You can refer to a variable by its SGQA code (without prefixing it with INSERTANS:), or by its question code.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/137 Informed Consent and Authorization Functionality]&lt;br /&gt;
**You can show show the informed consent on the welcome page, then ask any additional questions needed (to ensure they meet the study inclusion/exclusion criteria), and ask them a Yes/No question whether they give their consent.  Then, make all of the remaining questions conditional on that yesNo.  For example, if the question is named &#039;&#039;consent&#039;&#039;, you would set the relevance to the remaining questions to &#039;&#039;consent == &amp;quot;Y&amp;quot;&#039;&#039; (possibly &#039;&#039;and&#039;&#039;ing that with whatever additional conditions you needed to support your branching needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/199 Show codes instead of of answers using INSERTANS]&lt;br /&gt;
**{Qcode} returns the code instead of the response text (which you can get via {INSERTANS:SGQA}, or {Qcode.shown}&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/204 Need group mean or calculations for assessments]&lt;br /&gt;
**Say you have N variables of which N-X were answered, you could compute the mean of the answered variables as {sum(var1, var2, ..., varN) / count(var1, var2, ..., varN)}&lt;br /&gt;
**Computing the mean across a set of respondants would require extension of the Quota functionality.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/222 To insert a language dependent text]&lt;br /&gt;
**Tailoring lets you conjugate verbs and decline nouns in each language&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/225 Surveyors should approve their answers]&lt;br /&gt;
**Custom Questions with tailoring, or the showAllResponsesExcept() function will let Surveyors see all of the questions and responses before clicking Submit. If the Navigation Menu option is enabled, it is easy to go back and correct answers.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Suppliment to #answernnXnnXnnn method of targetting form elements]&lt;br /&gt;
**You can now refer to questions and answers by their Question Code, so there is no longer a need to modify SGQA values.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/262 More flexibility with hidden questions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/265 Remove specific conditions from multiple questions]&lt;br /&gt;
**You can now use Relevance, which is easier to manage than Conditions.  If  needed, they can all be exported from the database, edited in a spreadsheet, and re-imported.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/268 Cross Survey Reporting]&lt;br /&gt;
**By using question codes that are unique across your surveys and versions, you can consolidate data from multiple surveys and/or compare them&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/275 Simplifying integration with other tools]&lt;br /&gt;
**Expression Manager uses Question Codes instead of SGQA, making it easier to integrate with other tools.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Expose assessment score to 3rd party app processing]&lt;br /&gt;
**This can be done with Equation question type&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/309 Multiple thank you pages]&lt;br /&gt;
**This can be supported via conditional relevance branching and tailoring&lt;br /&gt;
&lt;br /&gt;
=Additional Reading=&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=1021</id>
		<title>Expression Manager</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Expression_Manager&amp;diff=1021"/>
		<updated>2012-12-20T08:35:36Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&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=&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&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;
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;
The following sections show the main places where Expression Manager is used&lt;br /&gt;
&lt;br /&gt;
==Relevance (Controlling Navigation/Branching)==&lt;br /&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 if you have to re-order questions.  EM uses an 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 asked, 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;
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, weight_kg 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;
[[File:tutorial1.jpg]]&lt;br /&gt;
&lt;br /&gt;
Relevance is shown and editable in the following places:&lt;br /&gt;
&lt;br /&gt;
===Viewing / Editing Question-Level Relevance===&lt;br /&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;
[[File:tutorial2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is the edit screen for the BMI question.&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial3.jpg]]&lt;br /&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===&lt;br /&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;
[[File:tutorial4.jpg]]&lt;br /&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;
Here is the screen for editing the group-level relevance for that question:&lt;br /&gt;
&lt;br /&gt;
[[File:tutorial5.jpg]]&lt;br /&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==&lt;br /&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===&lt;br /&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 in weight in metric or non-metric units.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring7.jpg]]&lt;br /&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 multiple 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;
BMI computes the weight formula as {weight_kg / (height_m * height_m)}.&lt;br /&gt;
&lt;br /&gt;
Lastly, the report conditionally tailors the message for the subject, telling him what he entered (e.g. &amp;quot;You said you are 2 meters tall and weight 70 kg.&amp;quot;&lt;br /&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;
[[File:tailoring8.jpg]]&lt;br /&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;
[[File:tailoring9.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tailored Questions, Answers, and Reports===&lt;br /&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;span&amp;gt; tag which is not valid inside select options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows the BMI report.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring10.jpg]]&lt;br /&gt;
&lt;br /&gt;
Here is the edit window for the same question.&lt;br /&gt;
&lt;br /&gt;
[[File:tailoring11.jpg]]&lt;br /&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;
[[File:tailoring12.jpg]]&lt;br /&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;
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==&lt;br /&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;
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;
The [[Expression Manager Sample Surveys|Sample Surveys]] pages shows many working examples of using expressions for validations.&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 and later 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;
This wiki page is the definitive reference for Expression Manager syntax and functionality.&lt;br /&gt;
&lt;br /&gt;
==Key Definitions==&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;SGQA&#039;&#039;&#039;:  This is how variables are named in LimeSurvey &amp;lt;= 1.91+&lt;br /&gt;
**Stands for Survey-Group-Question-Answer&lt;br /&gt;
**SGQA variable names look like 123X5X382X971, and may have sub-question suffixes.&lt;br /&gt;
**These variable names are specific to the underlying S/Q/G/A database codes, so often need to be changed&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;
**Although not required to be unique in &amp;lt;= 1.91+, it must be unique if you want to use EM&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?==&lt;br /&gt;
&lt;br /&gt;
The short answer is No (but also yes).&lt;br /&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;
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;
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?==&lt;br /&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;
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?==&lt;br /&gt;
&lt;br /&gt;
Here is a list of pros and cons of each style:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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?==&lt;br /&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 chldren&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?==&lt;br /&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;
**Eveything 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;
==How Backwards Compatible is EM with 1.91+?==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 1.92 is fully backwards-compatible with 1.91+ with one exception/caveat:  1.92 handles less-than / greater-than comparisons against empty values differently than 1.91+.&lt;br /&gt;
&lt;br /&gt;
One of the LimeSurvey demo surveys uses a set of conditions that translates to this relevance equation:  {(age &amp;lt; 16) or (age == 20) or ... or (age == 80)}. In LimeSurvey 1.91+, (age &amp;lt; 16) is FALSE when there is no answer (the value is blank).  However, in LimeSurey 1.92, (age &amp;lt; 16) is TRUE when there is no answer, since both PHP and JavaScript treat blank as 0 in mathematical comparisons.  Thus, 1.91+ would hide that question when age was unanswered, but 1.92 would show it.  We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat &amp;quot;&amp;quot; &amp;lt; 16 as FALSE.  Fortunately, there is an easy work-around for this.  If you want (age &amp;lt; 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age &amp;lt; 16)}.  You can use the new Survey Logic File view to quickly identify and fix any such comparisons in your survey.&lt;br /&gt;
&lt;br /&gt;
=Getting Started=&lt;br /&gt;
&lt;br /&gt;
The best way to get started with EM is to:&lt;br /&gt;
*Install 1.92+ 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;
**Availalbe Functions lists the 70+ functions and syntax&lt;br /&gt;
**Unit Tests of Isolsted 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+)=&lt;br /&gt;
&lt;br /&gt;
==Conditions =&amp;gt; Relevance==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
Equations were not supported without fancy JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Equation Question Type==&lt;br /&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?=&lt;br /&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)==&lt;br /&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===&lt;br /&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 diplayed. 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;
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;
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;
{|&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;
|}&lt;br /&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;
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 and 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===&lt;br /&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 deterimine 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===&lt;br /&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;
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===&lt;br /&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;
This solves a common request for storing Assessment scores within the database&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&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;
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;syntaxhighlight lang=&amp;quot;java&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{if(is_empty(PFTotals),&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
 if(PFTotals &amp;gt;= -5 &amp;amp;&amp;amp; PFTotals &amp;lt;= -4,&lt;br /&gt;
&lt;br /&gt;
   &#039;Very Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
   if(PFTotals &amp;gt;= -3 &amp;amp;&amp;amp; PFTotals &amp;lt;= -2,&lt;br /&gt;
&lt;br /&gt;
     &#039;Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
     if(PFTotals == -1,&lt;br /&gt;
&lt;br /&gt;
       &#039;Somewhat Soft&#039;,&lt;br /&gt;
&lt;br /&gt;
       if(PFTotals == 0,&lt;br /&gt;
&lt;br /&gt;
         &#039;Moderate&#039;,&lt;br /&gt;
&lt;br /&gt;
         if(PFTotals == 1,&lt;br /&gt;
&lt;br /&gt;
           &#039;Somewhat Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
           if(PFTotals &amp;gt;= 2 &amp;amp;&amp;amp; PFTotals &amp;lt;= 3,&lt;br /&gt;
&lt;br /&gt;
             &#039;Hard&#039;,&lt;br /&gt;
&lt;br /&gt;
             if(PFTotals &amp;gt;= 4 &amp;amp;&amp;amp; PFTotals &amp;lt;= 5,&lt;br /&gt;
&lt;br /&gt;
               &#039;Very Hard&#039;,&lt;br /&gt;
&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;
&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;
Expression Manager supports the following syntax:&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;
EM syntax follows normal operator precedence:&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&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 (=)===&lt;br /&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 sould 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;
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;
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;
&lt;br /&gt;
==Access to Variables==&lt;br /&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)&lt;br /&gt;
*INSERTANS:SGQA - the display value of an answer (e.g. &amp;quot;Yes&amp;quot;)&lt;br /&gt;
*All {XXX} values used by templates&lt;br /&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;
Furthermore, Expression Manager lets you access many properties of the Question:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Syntax||Meaning||Example||Example Result&lt;br /&gt;
|-&lt;br /&gt;
|Qcode||an alias for Qcode.code||{join(&#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||{join(&#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||{join(&#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;
|}&lt;br /&gt;
&lt;br /&gt;
For security issue, text entered by user are filtered. Some caracter are replaced by HTML entities.&lt;br /&gt;
* &amp;amp; by &amp;amp;amp;&lt;br /&gt;
* &amp;lt; by &amp;amp;lt;&lt;br /&gt;
* &amp;gt; by &amp;amp;gt;&lt;br /&gt;
* \n by &amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
* &amp;quot; by &amp;amp;quot;&lt;br /&gt;
* &#039; by &amp;amp;amp;#39;&lt;br /&gt;
* % by &amp;amp;amp;#37;&lt;br /&gt;
* ( by &amp;amp;amp;#40;&lt;br /&gt;
* ) by &amp;amp;amp;#41;&lt;br /&gt;
* + by &amp;amp;amp;#43;&lt;br /&gt;
* - by &amp;amp;amp;#45;&lt;br /&gt;
&lt;br /&gt;
==Qcode Variable Naming==&lt;br /&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;
QuestionCode . &#039;_&#039; . AnswerID . &#039;_&#039; . ScaleId&lt;br /&gt;
&lt;br /&gt;
{|&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},{Q20_comment}||{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|| || ||{Q22_E}||{Q22_E.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_D_comment}||{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;
|}&lt;br /&gt;
&lt;br /&gt;
==The reserved &#039;this&#039;, &#039;self&#039;, and &#039;that&#039; variables==&lt;br /&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;
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;
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;
&#039;&#039;suffix&#039;&#039; is any of the normal qcode suffixes (e.g. NAOK, value, shown)&lt;br /&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.&lt;br /&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;
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;
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;
&#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;
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;
The &#039;self&#039; and &#039;that&#039; variables can be used in any relevance,  validation, or tailoring.&lt;br /&gt;
&lt;br /&gt;
The one caveat is that when you use the 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;
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;
==Access to Functions==&lt;br /&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===&lt;br /&gt;
&lt;br /&gt;
The following functions are currently available:&lt;br /&gt;
&lt;br /&gt;
{|&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;
 [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;
|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]||Natural logarithm||number log(number)&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||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 string||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 a string||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)&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.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 a 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;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions that are Planned or Being Considered===&lt;br /&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;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
==Expression Manager Knows Which Variables are Local==&lt;br /&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==&lt;br /&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;
{|&lt;br /&gt;
|Operator||Example||a||b||Result&lt;br /&gt;
|-&lt;br /&gt;
|+ (unary)||+a||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;
|+||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;
|}&lt;br /&gt;
&lt;br /&gt;
===Overriding Cascading Conditions===&lt;br /&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;
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 &#039;&#039; 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;
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;
The use of the .NAOK suffix also lets authors design surveys that have several possible paths but then converage 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?==&lt;br /&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;
{|&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;
|}&lt;br /&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;
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==&lt;br /&gt;
&lt;br /&gt;
{|&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;
|}&lt;br /&gt;
&lt;br /&gt;
=Syntax Highlighting=&lt;br /&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==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Color||Sample||Meaning||Tooltip||Comments&lt;br /&gt;
|-&lt;br /&gt;
|tan background||&amp;lt;span style=&#039;color:#eee8aa,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||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;
|blue bold text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:blue,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:grey,#eee8aa&#039;&amp;gt;&#039;Sample&#039;&amp;lt;/span&amp;gt;||string||none||single and double-quoted strings are shown in grey text&lt;br /&gt;
|-&lt;br /&gt;
|bold maroon text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:maroon,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, but after the current question||&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 but after the current question is shown in bold maroon text.  This color coding should alert authors to possible errors in question sequencing; but it is allowed since some authors may want this sequence of variables a page, especially for dynamic reports.  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 cyan text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#4C88BE,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on the same page, prior to the current question||&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 and prior to the current question is shown in bold cyan 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 green text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:green,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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 pageis 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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#FF00FF,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||variable set on a later 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 pageis shown in bold pink text.  These are erorrs since the variable is  being used before it is declareed.  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||&#039;&#039;&#039;&amp;lt;span style=&#039;color:#996600,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||a lime relacement value||the value||Lime Replacement Strings (like {TOKEN:xxx}, {PRIVACY_MESSAGE} are shown in bold tan text.  The tooltip shows the current value.&lt;br /&gt;
|-&lt;br /&gt;
|red text||&#039;&#039;&#039;&amp;lt;span style=&#039;color:red,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;&#039;&#039;&#039;||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||&amp;lt;span style=&#039;color:black,#eee8aa&#039;&amp;gt;Sample&amp;lt;/span&amp;gt;||punctuation||none||All other punctionation 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;
|}&lt;br /&gt;
&lt;br /&gt;
=Relationship to LimeSurvey Ideas / Feature Requests=&lt;br /&gt;
&lt;br /&gt;
Expression Manager provides complete or partial solutions to each of the following:&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1 Conditions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/3/ Answercounts]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/5 Advanced reporting for assessments]&lt;br /&gt;
**partial: Equations let one store the Assessment value in the database, and micro-tailoring can generate simple formatted reports.  Authors can access those Equation values if they have more complex reporting needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/6 Assessment reports]&lt;br /&gt;
**partial:  Since Equations store the Assessment score, it should be possible to use Statistics to show distributions of those scores, and Quotas to limit the number of responses with those scores.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/7 Store assessment results for further evaluation]&lt;br /&gt;
**Equations let one store the Assessment value in the database, completely solving this problem&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/22/ More advanced condition rules]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/28 Open Answertable up so that we can alter formatting]&lt;br /&gt;
**partial:  All of the question attributes are available, so authors can create custom AnswerTable equivalents as a Question.  Once implatemented, they can also use the showTheseResponses() or showAllResponsesExecpt() functions&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/37 Export survey results with full questions to include images]&lt;br /&gt;
**since Tailoring has access to the full question text, it can include images in the export&lt;br /&gt;
**if subjects choose Print Your Answers after finishing the survey, those printouts will be fully tailored&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/63 List of question codes and SGQA identifiers]&lt;br /&gt;
**The Show Survey Logic view shows that mapping (plus much more information)&lt;br /&gt;
**In addition, you no longer have to use SGQA codes to refer to variables - you can use the Question code/title.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/69 Branch/jump to another question (earlier or later) based on current question]&lt;br /&gt;
**You can use the Navigation Index for this in most cases&lt;br /&gt;
**Once implemented, you can use the JumpTo() function.  Like the Navigation Index, if you try to jump forward, it will stop on an intervening page if there are any of the relevant mandatory questions are unanswered, or if any relevant questions fail validation tests.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/86 set quota for total responses]&lt;br /&gt;
**If the final question is an Equation that flags a survey as completed (so is NULL if a respondant does not get to that page), you can use Quotas on that question to control the number of completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/101 Review all conditions]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/105 Review all questions + Review all groups]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/107 How to visualize questions, logic &amp;amp; conditions]&lt;br /&gt;
**The Show Logic File view shows this (and much more)&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/113 Offline Surveys]&lt;br /&gt;
**Running a survey with all of the questions on the same page would let you do off-line data collection  (e.g. email the html page and associated JavaScript).  However, you would still want a way to submit the results so that they did not get lost.  It may be possible to use Save As HTML to save partially completed responses.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/120 Remove INSERTANS from question text at survey results]&lt;br /&gt;
**INSERTANS is no longer needed.  You can refer to a variable by its SGQA code (without prefixing it with INSERTANS:), or by its question code.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/137 Informed Consent and Authorization Functionality]&lt;br /&gt;
**You can show show the informed consent on the welcome page, then ask any additional questions needed (to ensure they meet the study inclusion/exclusion criteria), and ask them a Yes/No question whether they give their consent.  Then, make all of the remaining questions conditional on that yesNo.  For example, if the question is named &#039;&#039;consent&#039;&#039;, you would set the relevance to the remaining questions to &#039;&#039;consent == &amp;quot;Y&amp;quot;&#039;&#039; (possibly &#039;&#039;and&#039;&#039;ing that with whatever additional conditions you needed to support your branching needs.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/199 Show codes instead of of answers using INSERTANS]&lt;br /&gt;
**{Qcode} returns the code instead of the response text (which you can get via {INSERTANS:SGQA}, or {Qcode.shown}&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/204 Need group mean or calculations for assessments]&lt;br /&gt;
**Say you have N variables of which N-X were answered, you could compute the mean of the answered variables as {sum(var1, var2, ..., varN) / count(var1, var2, ..., varN)}&lt;br /&gt;
**Computing the mean across a set of respondants would require extension of the Quota functionality.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/222 To insert a language dependent text]&lt;br /&gt;
**Tailoring lets you conjugate verbs and decline nouns in each language&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/225 Surveyors should approve their answers]&lt;br /&gt;
**Custom Questions with tailoring, or the showAllResponsesExcept() function will let Surveyors see all of the questions and responses before clicking Submit. If the Navigation Menu option is enabled, it is easy to go back and correct answers.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Suppliment to #answernnXnnXnnn method of targetting form elements]&lt;br /&gt;
**You can now refer to questions and answers by their Question Code, so there is no longer a need to modify SGQA values.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/262 More flexibility with hidden questions]&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/265 Remove specific conditions from multiple questions]&lt;br /&gt;
**You can now use Relevance, which is easier to manage than Conditions.  If  needed, they can all be exported from the database, edited in a spreadsheet, and re-imported.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/268 Cross Survey Reporting]&lt;br /&gt;
**By using question codes that are unique across your surveys and versions, you can consolidate data from multiple surveys and/or compare them&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/275 Simplifying integration with other tools]&lt;br /&gt;
**Expression Manager uses Question Codes instead of SGQA, making it easier to integrate with other tools.&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/1.92 Expose assessment score to 3rd party app processing]&lt;br /&gt;
**This can be done with Equation question type&lt;br /&gt;
*[http://ideas.limesurvey.org/ideatorrent/idea/309 Multiple thank you pages]&lt;br /&gt;
**This can be supported via conditional relevance branching and tailoring&lt;br /&gt;
&lt;br /&gt;
=Additional Reading=&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Sample Surveys|Expression Manager Sample Surveys]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager HowTos|Use Cases and HowTos]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Examples|Step-by-Step Examples]].==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager for developers|Reference for Developers]]==&lt;br /&gt;
&lt;br /&gt;
==[[Expression Manager Roadmap|RoadMap/Status/ToDo List]]==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1596</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1596"/>
		<updated>2012-12-08T08:55:23Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/fr/telechargez page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Cette partie n&#039;existe plus=&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/application/config/&amp;quot;&#039;&#039;&#039; &amp;amp;agrave; besoin d&#039;&amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour l&#039;activation de la configuration lors de l&#039;installation automatique.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, suivez les instructions. Vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1597</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1597"/>
		<updated>2012-12-08T08:54:01Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/fr/telechargez page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Cette partie n&#039;existe plus=&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/application/config/&amp;quot;&#039;&#039;&#039; &amp;amp;agrave; besoin d&#039;&amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour l&#039;activation de la configuration lors de l&#039;installation automatique.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, suivez les instructions. Vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutoriels vid&amp;amp;eacute;o=&lt;br /&gt;
&lt;br /&gt;
Ces tutoriels vid&amp;amp;eacute;o n&#039;ont pas &amp;amp;eacute;t&amp;amp;eacute; cr&amp;amp;eacute;&amp;amp;eacute;s et ne sont pas maintenus par notre &amp;amp;eacute;quipe et doivent &amp;amp;ecirc;tre utilis&amp;amp;eacute;s comme &amp;quot;pense-b&amp;amp;ecirc;te&amp;quot;. Ils ne remplacent en rien la lecture des instructions ci-dessus !&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu How to install and configure &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; v1.01 in Ubuntu Feisty].&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu Upgrading from &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.01 to &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.52+ build 3304 2007-09-20 in Ubuntu Feisty].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1598</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1598"/>
		<updated>2012-12-08T08:53:02Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/fr/telechargez page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Cette partie n&#039;existe plus=&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/application/config/&amp;quot;&#039;&#039;&#039; &amp;amp;agrave; besoin d&#039;&amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour l&#039;activation de la configuration lors de l&#039;installation automatique.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/install&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutoriels vid&amp;amp;eacute;o=&lt;br /&gt;
&lt;br /&gt;
Ces tutoriels vid&amp;amp;eacute;o n&#039;ont pas &amp;amp;eacute;t&amp;amp;eacute; cr&amp;amp;eacute;&amp;amp;eacute;s et ne sont pas maintenus par notre &amp;amp;eacute;quipe et doivent &amp;amp;ecirc;tre utilis&amp;amp;eacute;s comme &amp;quot;pense-b&amp;amp;ecirc;te&amp;quot;. Ils ne remplacent en rien la lecture des instructions ci-dessus !&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu How to install and configure &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; v1.01 in Ubuntu Feisty].&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu Upgrading from &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.01 to &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.52+ build 3304 2007-09-20 in Ubuntu Feisty].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1599</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1599"/>
		<updated>2012-12-08T08:51:11Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/fr/telechargez page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Cette partie n&#039;existe plus=&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/install&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutoriels vid&amp;amp;eacute;o=&lt;br /&gt;
&lt;br /&gt;
Ces tutoriels vid&amp;amp;eacute;o n&#039;ont pas &amp;amp;eacute;t&amp;amp;eacute; cr&amp;amp;eacute;&amp;amp;eacute;s et ne sont pas maintenus par notre &amp;amp;eacute;quipe et doivent &amp;amp;ecirc;tre utilis&amp;amp;eacute;s comme &amp;quot;pense-b&amp;amp;ecirc;te&amp;quot;. Ils ne remplacent en rien la lecture des instructions ci-dessus !&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu How to install and configure &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; v1.01 in Ubuntu Feisty].&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu Upgrading from &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.01 to &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.52+ build 3304 2007-09-20 in Ubuntu Feisty].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1600</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1600"/>
		<updated>2012-12-08T08:48:43Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/fr/telechargez page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Configurer LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier config.php situ&amp;amp;eacute; dans le dossier /limesurvey/ gr&amp;amp;acirc;ce &amp;amp;agrave; votre &amp;amp;eacute;diteur de texte pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;.&lt;br /&gt;
&lt;br /&gt;
==5.1 R&amp;amp;eacute;glages obligatoires==&lt;br /&gt;
*&#039;&#039;&#039;$databasetype&#039;&#039;&#039; : d&amp;amp;eacute;finit le type de base de donn&amp;amp;eacute;es utilis&amp;amp;eacute;e. A ce jour, vous pouvez utiliser &amp;quot;mysql&amp;quot; pour une base de donn&amp;amp;eacute;es de type MySQL ou &amp;quot;odbc_mssql&amp;quot; pour une base de type Microsoft SQL server et &amp;quot;postgres&amp;quot; pour une base de type Postgres SQL Server. Seuls ces types ont &amp;amp;eacute;t&amp;amp;eacute; test&amp;amp;eacute;s. (:biggrin:)&lt;br /&gt;
*&#039;&#039;&#039;$databaselocation&#039;&#039;&#039; : d&amp;amp;eacute;finit l&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur de base de donn&amp;amp;eacute;es. Dans la plupart des cas, &amp;quot;localhost&amp;quot; doit convenir.&lt;br /&gt;
*&#039;&#039;&#039;$databasename&#039;&#039;&#039; : d&amp;amp;eacute;finit le nom de la base utilis&amp;amp;eacute;e par LimeSurvey sur votre serveur de base de donn&amp;amp;eacute;es. Si vous avez les permissions suffisantes sur ce serveur, vous pourrez cr&amp;amp;eacute;er une base depuis LimeSurvey. Dans ce cas, indiquez le nom voulu pour cette base ici. Vous pouvez aussi indiquer le nom d&#039;une base cr&amp;amp;eacute;&amp;amp;eacute;e pr&amp;amp;eacute;c&amp;amp;eacute;demment et dans ce cas, assurez-vous que la base ne contient pas d&#039;anciennes tables de LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Important :&#039;&#039;&#039; Si vous utilisez un serveur Microsoft SQL, assurez que votre base utilise une collation non sensible &amp;amp;agrave; la casse (devrait &amp;amp;ecirc;tre la valeur par d&amp;amp;eacute;faut).&amp;lt;/div&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;$databaseuser&#039;&#039;&#039; : votre nom d&#039;utilisateur pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; la base de donn&amp;amp;eacute;es.&lt;br /&gt;
*&#039;&#039;&#039;$databasepass&#039;&#039;&#039; : votre mot de passe pour l&#039;acc&amp;amp;egrave;s au serveur de base de donn&amp;amp;eacute;es.&lt;br /&gt;
*&#039;&#039;&#039;$dbprefix&#039;&#039;&#039; : vous pouvez laisser ce r&amp;amp;eacute;glage &amp;amp;agrave; blanc (c&amp;amp;agrave;d : $dbprefix=&amp;quot;&amp;quot;;) si vous utilisez une base d&amp;amp;eacute;di&amp;amp;eacute;e &amp;amp;agrave; LimeSurvey. Si vous voulez ou devez partager votre base entre LimeSurvey et d&#039;autres programmes utilisant la m&amp;amp;ecirc;me base de donn&amp;amp;eacute;es, ajoutez un pr&amp;amp;eacute;fixe pour le nom des tables avec ce r&amp;amp;eacute;glage. Le param&amp;amp;egrave;tre recommand&amp;amp;eacute; est &amp;quot;lime_&amp;quot; mais vous pouvez mettre ce que vous voulez.&lt;br /&gt;
&lt;br /&gt;
+&#039;&#039;Note : La cr&amp;amp;eacute;ation d&#039;une base de donn&amp;amp;eacute;es MySQL est d&amp;amp;eacute;crite dans la [[FAQ de l&#039;installation]].&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;$rooturl&#039;&#039;&#039; : indique l&#039;adresse URL pour acc&amp;amp;eacute;der &amp;amp;agrave; votre questionnaire. Si vous avez copi&amp;amp;eacute; les fichiers de LimeSurvey dans un dossier &#039;&#039;repertoireLS&#039;&#039; vous devrez renommer &#039;&#039;.../limesurvey&#039;&#039; avec le nom que vous avez choisi (&#039;&#039;repertoireLS&#039;&#039;). Le r&amp;amp;eacute;glage par d&amp;amp;eacute;faut essaie de trouver &amp;amp;ccedil;a automatiquement pour vous et, la plupart du temps, ce r&amp;amp;eacute;glage ne devra pas &amp;amp;ecirc;tre modifi&amp;amp;eacute; (le code {$_SERVER&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;&#039;SERVER_NAME&#039;]} devrait fonctionner dans la majorit&amp;amp;eacute; des cas). Si cela ne fonctionne pas, vous devrez entrer manuellement l&#039;adresse ici, par exemple &amp;quot;http://www.mydomain.com/limesurvey&amp;quot;). Si vous souhaitez que LimeSurvey utilise SSL, changez http en https (en consid&amp;amp;eacute;rant que les certificats SSL sont correctement install&amp;amp;eacute;s et configur&amp;amp;eacute;s sur votre serveur)&lt;br /&gt;
*&#039;&#039;&#039;$rootdir&#039;&#039;&#039; : doit contenir le chemin physique vers les fichiers du programme. Le r&amp;amp;eacute;glage par d&amp;amp;eacute;faut essaie de trouver cette valeur pour vous et, la plupart du temps, ce r&amp;amp;eacute;glage ne devra pas &amp;amp;ecirc;tre modifi&amp;amp;eacute; (le code &amp;quot;dirname(!!!FILE!!!);&amp;quot; essaie de trouver automatiquement). Si cela ne fonctionne pas, vous devrez entrer manuellement l&#039;emplacement physique des fichiers, par exemple &amp;quot;/home/public_html/limesurvey&amp;quot;.)&lt;br /&gt;
*&#039;&#039;&#039;$defaultuser&#039;&#039;&#039; : quand le programme utilise le contr&amp;amp;ocirc;le d&#039;acc&amp;amp;egrave;s, ceci est l&#039;utilisateur par d&amp;amp;eacute;faut cr&amp;amp;eacute;&amp;amp;eacute; quand LimeSurvey initialise la s&amp;amp;eacute;curit&amp;amp;eacute; pour la premi&amp;amp;egrave;re fois.&lt;br /&gt;
*&#039;&#039;&#039;$defaultpass&#039;&#039;&#039; : quand le programme utilise le contr&amp;amp;ocirc;le d&#039;acc&amp;amp;egrave;s, ceci est le mot de passe par d&amp;amp;eacute;faut utilis&amp;amp;eacute; quand LimeSurvey initialise la s&amp;amp;eacute;curit&amp;amp;eacute; pour la premi&amp;amp;egrave;re fois.&lt;br /&gt;
&lt;br /&gt;
+&#039;&#039;&#039;Note&#039;&#039;&#039; : ce param&amp;amp;egrave;tre est utilis&amp;amp;eacute; &#039;&#039;&#039;seulement&#039;&#039;&#039; pour la configuration initiale. Quand l&#039;utilisateur par d&amp;amp;eacute;faut &#039;&#039;$defaultuser&#039;&#039; est d&amp;amp;eacute;j&amp;amp;agrave; cr&amp;amp;eacute;&amp;amp;eacute;, cette option n&#039;est plus utilis&amp;amp;eacute;e. Vous devrez changer votre mot de passe dans la gestion des utilisateurs.&lt;br /&gt;
&lt;br /&gt;
==5.2 R&amp;amp;eacute;glages optionnels==&lt;br /&gt;
&lt;br /&gt;
Il existe plusieurs autres r&amp;amp;eacute;glages optionnels que vous pouvez d&amp;amp;eacute;finir dans config.php. Veuillez consultez la page des [[r&amp;amp;eacute;glages optionnels]]. Cependant, pour une configuration de base, poursuivez &amp;amp;agrave; l&#039;&amp;amp;eacute;tape suivante.&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/install&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutoriels vid&amp;amp;eacute;o=&lt;br /&gt;
&lt;br /&gt;
Ces tutoriels vid&amp;amp;eacute;o n&#039;ont pas &amp;amp;eacute;t&amp;amp;eacute; cr&amp;amp;eacute;&amp;amp;eacute;s et ne sont pas maintenus par notre &amp;amp;eacute;quipe et doivent &amp;amp;ecirc;tre utilis&amp;amp;eacute;s comme &amp;quot;pense-b&amp;amp;ecirc;te&amp;quot;. Ils ne remplacent en rien la lecture des instructions ci-dessus !&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu How to install and configure &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; v1.01 in Ubuntu Feisty].&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu Upgrading from &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.01 to &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.52+ build 3304 2007-09-20 in Ubuntu Feisty].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1635</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1635"/>
		<updated>2012-12-08T08:47:51Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/fr/telechargez T&amp;amp;eacute;l&amp;amp;eacute;charger page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Configurer LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier config.php situ&amp;amp;eacute; dans le dossier /limesurvey/ gr&amp;amp;acirc;ce &amp;amp;agrave; votre &amp;amp;eacute;diteur de texte pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;.&lt;br /&gt;
&lt;br /&gt;
==5.1 R&amp;amp;eacute;glages obligatoires==&lt;br /&gt;
*&#039;&#039;&#039;$databasetype&#039;&#039;&#039; : d&amp;amp;eacute;finit le type de base de donn&amp;amp;eacute;es utilis&amp;amp;eacute;e. A ce jour, vous pouvez utiliser &amp;quot;mysql&amp;quot; pour une base de donn&amp;amp;eacute;es de type MySQL ou &amp;quot;odbc_mssql&amp;quot; pour une base de type Microsoft SQL server et &amp;quot;postgres&amp;quot; pour une base de type Postgres SQL Server. Seuls ces types ont &amp;amp;eacute;t&amp;amp;eacute; test&amp;amp;eacute;s. (:biggrin:)&lt;br /&gt;
*&#039;&#039;&#039;$databaselocation&#039;&#039;&#039; : d&amp;amp;eacute;finit l&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur de base de donn&amp;amp;eacute;es. Dans la plupart des cas, &amp;quot;localhost&amp;quot; doit convenir.&lt;br /&gt;
*&#039;&#039;&#039;$databasename&#039;&#039;&#039; : d&amp;amp;eacute;finit le nom de la base utilis&amp;amp;eacute;e par LimeSurvey sur votre serveur de base de donn&amp;amp;eacute;es. Si vous avez les permissions suffisantes sur ce serveur, vous pourrez cr&amp;amp;eacute;er une base depuis LimeSurvey. Dans ce cas, indiquez le nom voulu pour cette base ici. Vous pouvez aussi indiquer le nom d&#039;une base cr&amp;amp;eacute;&amp;amp;eacute;e pr&amp;amp;eacute;c&amp;amp;eacute;demment et dans ce cas, assurez-vous que la base ne contient pas d&#039;anciennes tables de LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Important :&#039;&#039;&#039; Si vous utilisez un serveur Microsoft SQL, assurez que votre base utilise une collation non sensible &amp;amp;agrave; la casse (devrait &amp;amp;ecirc;tre la valeur par d&amp;amp;eacute;faut).&amp;lt;/div&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;$databaseuser&#039;&#039;&#039; : votre nom d&#039;utilisateur pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; la base de donn&amp;amp;eacute;es.&lt;br /&gt;
*&#039;&#039;&#039;$databasepass&#039;&#039;&#039; : votre mot de passe pour l&#039;acc&amp;amp;egrave;s au serveur de base de donn&amp;amp;eacute;es.&lt;br /&gt;
*&#039;&#039;&#039;$dbprefix&#039;&#039;&#039; : vous pouvez laisser ce r&amp;amp;eacute;glage &amp;amp;agrave; blanc (c&amp;amp;agrave;d : $dbprefix=&amp;quot;&amp;quot;;) si vous utilisez une base d&amp;amp;eacute;di&amp;amp;eacute;e &amp;amp;agrave; LimeSurvey. Si vous voulez ou devez partager votre base entre LimeSurvey et d&#039;autres programmes utilisant la m&amp;amp;ecirc;me base de donn&amp;amp;eacute;es, ajoutez un pr&amp;amp;eacute;fixe pour le nom des tables avec ce r&amp;amp;eacute;glage. Le param&amp;amp;egrave;tre recommand&amp;amp;eacute; est &amp;quot;lime_&amp;quot; mais vous pouvez mettre ce que vous voulez.&lt;br /&gt;
&lt;br /&gt;
+&#039;&#039;Note : La cr&amp;amp;eacute;ation d&#039;une base de donn&amp;amp;eacute;es MySQL est d&amp;amp;eacute;crite dans la [[FAQ de l&#039;installation]].&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;$rooturl&#039;&#039;&#039; : indique l&#039;adresse URL pour acc&amp;amp;eacute;der &amp;amp;agrave; votre questionnaire. Si vous avez copi&amp;amp;eacute; les fichiers de LimeSurvey dans un dossier &#039;&#039;repertoireLS&#039;&#039; vous devrez renommer &#039;&#039;.../limesurvey&#039;&#039; avec le nom que vous avez choisi (&#039;&#039;repertoireLS&#039;&#039;). Le r&amp;amp;eacute;glage par d&amp;amp;eacute;faut essaie de trouver &amp;amp;ccedil;a automatiquement pour vous et, la plupart du temps, ce r&amp;amp;eacute;glage ne devra pas &amp;amp;ecirc;tre modifi&amp;amp;eacute; (le code {$_SERVER&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;&#039;SERVER_NAME&#039;]} devrait fonctionner dans la majorit&amp;amp;eacute; des cas). Si cela ne fonctionne pas, vous devrez entrer manuellement l&#039;adresse ici, par exemple &amp;quot;http://www.mydomain.com/limesurvey&amp;quot;). Si vous souhaitez que LimeSurvey utilise SSL, changez http en https (en consid&amp;amp;eacute;rant que les certificats SSL sont correctement install&amp;amp;eacute;s et configur&amp;amp;eacute;s sur votre serveur)&lt;br /&gt;
*&#039;&#039;&#039;$rootdir&#039;&#039;&#039; : doit contenir le chemin physique vers les fichiers du programme. Le r&amp;amp;eacute;glage par d&amp;amp;eacute;faut essaie de trouver cette valeur pour vous et, la plupart du temps, ce r&amp;amp;eacute;glage ne devra pas &amp;amp;ecirc;tre modifi&amp;amp;eacute; (le code &amp;quot;dirname(!!!FILE!!!);&amp;quot; essaie de trouver automatiquement). Si cela ne fonctionne pas, vous devrez entrer manuellement l&#039;emplacement physique des fichiers, par exemple &amp;quot;/home/public_html/limesurvey&amp;quot;.)&lt;br /&gt;
*&#039;&#039;&#039;$defaultuser&#039;&#039;&#039; : quand le programme utilise le contr&amp;amp;ocirc;le d&#039;acc&amp;amp;egrave;s, ceci est l&#039;utilisateur par d&amp;amp;eacute;faut cr&amp;amp;eacute;&amp;amp;eacute; quand LimeSurvey initialise la s&amp;amp;eacute;curit&amp;amp;eacute; pour la premi&amp;amp;egrave;re fois.&lt;br /&gt;
*&#039;&#039;&#039;$defaultpass&#039;&#039;&#039; : quand le programme utilise le contr&amp;amp;ocirc;le d&#039;acc&amp;amp;egrave;s, ceci est le mot de passe par d&amp;amp;eacute;faut utilis&amp;amp;eacute; quand LimeSurvey initialise la s&amp;amp;eacute;curit&amp;amp;eacute; pour la premi&amp;amp;egrave;re fois.&lt;br /&gt;
&lt;br /&gt;
+&#039;&#039;&#039;Note&#039;&#039;&#039; : ce param&amp;amp;egrave;tre est utilis&amp;amp;eacute; &#039;&#039;&#039;seulement&#039;&#039;&#039; pour la configuration initiale. Quand l&#039;utilisateur par d&amp;amp;eacute;faut &#039;&#039;$defaultuser&#039;&#039; est d&amp;amp;eacute;j&amp;amp;agrave; cr&amp;amp;eacute;&amp;amp;eacute;, cette option n&#039;est plus utilis&amp;amp;eacute;e. Vous devrez changer votre mot de passe dans la gestion des utilisateurs.&lt;br /&gt;
&lt;br /&gt;
==5.2 R&amp;amp;eacute;glages optionnels==&lt;br /&gt;
&lt;br /&gt;
Il existe plusieurs autres r&amp;amp;eacute;glages optionnels que vous pouvez d&amp;amp;eacute;finir dans config.php. Veuillez consultez la page des [[r&amp;amp;eacute;glages optionnels]]. Cependant, pour une configuration de base, poursuivez &amp;amp;agrave; l&#039;&amp;amp;eacute;tape suivante.&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/install&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutoriels vid&amp;amp;eacute;o=&lt;br /&gt;
&lt;br /&gt;
Ces tutoriels vid&amp;amp;eacute;o n&#039;ont pas &amp;amp;eacute;t&amp;amp;eacute; cr&amp;amp;eacute;&amp;amp;eacute;s et ne sont pas maintenus par notre &amp;amp;eacute;quipe et doivent &amp;amp;ecirc;tre utilis&amp;amp;eacute;s comme &amp;quot;pense-b&amp;amp;ecirc;te&amp;quot;. Ils ne remplacent en rien la lecture des instructions ci-dessus !&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu How to install and configure &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; v1.01 in Ubuntu Feisty].&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu Upgrading from &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.01 to &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.52+ build 3304 2007-09-20 in Ubuntu Feisty].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1636</id>
		<title>Installation en Francais</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_en_Francais&amp;diff=1636"/>
		<updated>2012-12-08T08:46:13Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Translation in progress.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Pages suppl&amp;amp;eacute;mentaires:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
=1. Pr&amp;amp;eacute;requis pour utiliser LimeSurvey sur votre site web=&lt;br /&gt;
&lt;br /&gt;
Assurez-vous que votre serveur r&amp;amp;eacute;ponde aux exigences suivantes. La plus part de celle-ci seront v&amp;amp;eacute;rifi&amp;amp;eacute;es durant la phase d&#039;installation :&lt;br /&gt;
* 80 Mo d&#039;espace libre pour la plateforme proprement dite.&lt;br /&gt;
* MySQL 4.1.0 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Microsoft SQL Server 2005 et versions suivantes &#039;&#039;&#039;OU&#039;&#039;&#039; Postgres 8.1 et versions suivantes&lt;br /&gt;
* PHP 5.1.2 et versions suivantes plus ces extensions :&lt;br /&gt;
**mbstring (Multibyte String Functions) pour que le syst&amp;amp;egrave;me de traduction fonctionne. Voir aussi ([http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ de l&#039;installation])&lt;br /&gt;
**Pilote de base de donn&amp;amp;eacute;es PDO pour MySQL (pdo_mysql ou pdo_mysqli), Postgres (pdo_pgsql) ou MSSQL (pdo_sqlsrv) (cela devra &amp;amp;ecirc;tre le cas avec la plupart des h&amp;amp;eacute;bergeurs. Si vous avez vous-m&amp;amp;ecirc;me configur&amp;amp;eacute; votre serveur web, assurez-vous qu&#039;elles sont install&amp;amp;eacute;es et actives)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Attention : LimeSurvey 2.x utilise des pilotes de bases de donn&amp;amp;eacute;es diff&amp;amp;eacute;rents de LimeSurvey 1.x. Si vous voyez apparaitre le message &amp;quot;No DBO driver was found during the installation&amp;quot;, veuillez demander &amp;amp;agrave; votre h&amp;amp;eacute;bergeur d&#039;activer la/les extensions appropri&amp;amp;eacute;es mentionn&amp;amp;eacute; ci-avant. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extensions PHP facultatives :&lt;br /&gt;
* &#039;&#039;&#039;GD&#039;&#039;&#039; install&amp;amp;eacute;e avec le &#039;&#039;&#039;support FreeType&#039;&#039;&#039; est n&amp;amp;eacute;cessaire pour la protection par CAPTCHA et les jolis graphiques (voir la documentation de l&#039;[http://fr.php.net/manual/fr/image.setup.php extension GD])&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; pour [[Email bounce tracking system]] (voir la documentation de l&#039;[http://www.php.net/manual/en/imap.setup.php extension IMAP])&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; pour la cr&amp;amp;eacute;ation d&#039;invitations depuis un annuaire LDAP (voir la documentation de l&#039;[http://fr.php.net/manual/fr/book.ldap.php extension LDAP])&lt;br /&gt;
* &#039;&#039;&#039;ZLIB&#039;&#039;&#039; pour la mise &amp;amp;agrave; jour en 3 clics, le t&amp;amp;eacute;l&amp;amp;eacute;chargement de mod&amp;amp;egrave;les, l&#039;importation de ressources ZIP, etc. (voir la documentation de l&#039;[http://www.php.net/manual/en/zlib.setup.php extension Zlib])&lt;br /&gt;
&lt;br /&gt;
Dans la plupart des cas, votre h&amp;amp;eacute;bergeur ou votre administrateur syst&amp;amp;egrave;me pourra vous assister sur ces points.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez tester LimeSurvey sur votre propre machine, notamment sous Windows, nous vous conseillons l&#039;utilisation de [http://www.apachefriends.org/fr/index.html XAMPP] qui vous installera Apache, MySQL et perl. LimeSurvey fonctionne sur une installation de XAMPP sans configuration particuli&amp;amp;egrave;re.&lt;br /&gt;
&lt;br /&gt;
Si vous souhaitez utiliser le serveur Microsoft IIS veuillez regarder &amp;quot;[[Installation de LimeSurvey sur une machine sous Windows XP]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==1.1 H&amp;amp;eacute;bergement pour LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey devrait fonctionner chez la plupart des h&amp;amp;eacute;bergeurs proposant PHP et MySQL. Si vous souhaitez une installation de LimeSurvey toute pr&amp;amp;ecirc;te, vous pouvez utiliser LimeService, vous pouvez aussi consulter la [[LimeSurvey-compatible hosting companies|liste des h&amp;amp;eacute;bergeurs compatibles avec LimeSurvey]].&lt;br /&gt;
*Cas particulier de free.fr: Il serait possible d&#039;installer limesurvey sur les serveurs de pages perso de free.fr selon ce [LimeSurvey sur pages perso free.fr|commentaire sur framasoft]. Cette information n&#039;a pas &amp;amp;eacute;t&amp;amp;eacute; v&amp;amp;eacute;rifi&amp;amp;eacute;e.&lt;br /&gt;
&lt;br /&gt;
=2. T&amp;amp;eacute;l&amp;amp;eacute;chargement du programme LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
La derni&amp;amp;egrave;re version stable de Limesurvey se trouve sur la [http://www.limesurvey.org/en/download Download page de t&amp;amp;eacute;l&amp;amp;eacute;chargement de LimeSurvey sur sourceforge (en anglais)] vous pourrez la t&amp;amp;eacute;l&amp;amp;eacute;chargez sous forme d&#039;un fichier d&#039;installation ZIP. Vous trouverez aussi des fichiers compress&amp;amp;eacute;s en gzip, bz2 ou 7zip.&lt;br /&gt;
&lt;br /&gt;
=3. D&amp;amp;eacute;compression du fichier d&#039;installation de LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
D&amp;amp;eacute;compressez le fichier ZIP dans un dossier/r&amp;amp;eacute;pertoire d&amp;amp;eacute;di&amp;amp;eacute; avec votre outil de d&amp;amp;eacute;compression pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;. Assurez-vous que votre logiciel de d&amp;amp;eacute;compression recr&amp;amp;eacute;e bien la structure des dossiers avec les fichiers (c&#039;est normalement le comportement de ce genre de programmes). Le nom du chemin d&#039;installation ne doit pas contenir les caract&amp;amp;egrave;res &#039;&#039;&#039;(&#039;&#039;&#039; ou &#039;&#039;&#039;)&#039;&#039;&#039; mais peut contenir des &#039;&#039;&#039;espaces&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=4. Collecte d&#039;informations au sujet de votre serveur=&lt;br /&gt;
&lt;br /&gt;
Vous devez vous renseigner sur les points suivants pour pouvoir installer correctement LimeSurvey sur votre serveur web :&lt;br /&gt;
*L&#039;URL pr&amp;amp;eacute;vue pour se connecter au programme (exemple : &#039;http://mon.domaine.com/limesurvey&#039;).&lt;br /&gt;
*L&#039;emplacement physique des fichiers sur le serveur (exemple : &#039;/var/www/htdocs/limesurvey&#039;).&lt;br /&gt;
*L&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur MySQL (exemple : &#039;localhost&#039;)&lt;br /&gt;
*Si votre base de donn&amp;amp;eacute;es n&#039;utilise pas le port par d&amp;amp;eacute;faut, vous devrez conna&amp;amp;icirc;tre sur quel port il &amp;amp;eacute;coute.&lt;br /&gt;
*Vos nom d&#039;utilisateur et mot de passe pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; votre base de donn&amp;amp;eacute;es.&lt;br /&gt;
*La plupart des h&amp;amp;eacute;bergeurs n&#039;autorisent pas les scripts &amp;amp;agrave; cr&amp;amp;eacute;er des bases de donn&amp;amp;eacute;es mais c&#039;est &amp;amp;agrave; vous de le faire manuellement. Si vous &amp;amp;ecirc;tes dans ce cas, n&#039;oubliez pas de cr&amp;amp;eacute;er vous-m&amp;amp;ecirc;me une base de donn&amp;amp;eacute;es (par exemple, &#039;limesurvey&#039;)&lt;br /&gt;
&lt;br /&gt;
=5. Configurer LimeSurvey=&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier config.php situ&amp;amp;eacute; dans le dossier /limesurvey/ gr&amp;amp;acirc;ce &amp;amp;agrave; votre &amp;amp;eacute;diteur de texte pr&amp;amp;eacute;f&amp;amp;eacute;r&amp;amp;eacute;.&lt;br /&gt;
&lt;br /&gt;
==5.1 R&amp;amp;eacute;glages obligatoires==&lt;br /&gt;
*&#039;&#039;&#039;$databasetype&#039;&#039;&#039; : d&amp;amp;eacute;finit le type de base de donn&amp;amp;eacute;es utilis&amp;amp;eacute;e. A ce jour, vous pouvez utiliser &amp;quot;mysql&amp;quot; pour une base de donn&amp;amp;eacute;es de type MySQL ou &amp;quot;odbc_mssql&amp;quot; pour une base de type Microsoft SQL server et &amp;quot;postgres&amp;quot; pour une base de type Postgres SQL Server. Seuls ces types ont &amp;amp;eacute;t&amp;amp;eacute; test&amp;amp;eacute;s. (:biggrin:)&lt;br /&gt;
*&#039;&#039;&#039;$databaselocation&#039;&#039;&#039; : d&amp;amp;eacute;finit l&#039;adresse IP ou le nom d&#039;h&amp;amp;ocirc;te de votre serveur de base de donn&amp;amp;eacute;es. Dans la plupart des cas, &amp;quot;localhost&amp;quot; doit convenir.&lt;br /&gt;
*&#039;&#039;&#039;$databasename&#039;&#039;&#039; : d&amp;amp;eacute;finit le nom de la base utilis&amp;amp;eacute;e par LimeSurvey sur votre serveur de base de donn&amp;amp;eacute;es. Si vous avez les permissions suffisantes sur ce serveur, vous pourrez cr&amp;amp;eacute;er une base depuis LimeSurvey. Dans ce cas, indiquez le nom voulu pour cette base ici. Vous pouvez aussi indiquer le nom d&#039;une base cr&amp;amp;eacute;&amp;amp;eacute;e pr&amp;amp;eacute;c&amp;amp;eacute;demment et dans ce cas, assurez-vous que la base ne contient pas d&#039;anciennes tables de LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Important :&#039;&#039;&#039; Si vous utilisez un serveur Microsoft SQL, assurez que votre base utilise une collation non sensible &amp;amp;agrave; la casse (devrait &amp;amp;ecirc;tre la valeur par d&amp;amp;eacute;faut).&amp;lt;/div&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;$databaseuser&#039;&#039;&#039; : votre nom d&#039;utilisateur pour l&#039;acc&amp;amp;egrave;s &amp;amp;agrave; la base de donn&amp;amp;eacute;es.&lt;br /&gt;
*&#039;&#039;&#039;$databasepass&#039;&#039;&#039; : votre mot de passe pour l&#039;acc&amp;amp;egrave;s au serveur de base de donn&amp;amp;eacute;es.&lt;br /&gt;
*&#039;&#039;&#039;$dbprefix&#039;&#039;&#039; : vous pouvez laisser ce r&amp;amp;eacute;glage &amp;amp;agrave; blanc (c&amp;amp;agrave;d : $dbprefix=&amp;quot;&amp;quot;;) si vous utilisez une base d&amp;amp;eacute;di&amp;amp;eacute;e &amp;amp;agrave; LimeSurvey. Si vous voulez ou devez partager votre base entre LimeSurvey et d&#039;autres programmes utilisant la m&amp;amp;ecirc;me base de donn&amp;amp;eacute;es, ajoutez un pr&amp;amp;eacute;fixe pour le nom des tables avec ce r&amp;amp;eacute;glage. Le param&amp;amp;egrave;tre recommand&amp;amp;eacute; est &amp;quot;lime_&amp;quot; mais vous pouvez mettre ce que vous voulez.&lt;br /&gt;
&lt;br /&gt;
+&#039;&#039;Note : La cr&amp;amp;eacute;ation d&#039;une base de donn&amp;amp;eacute;es MySQL est d&amp;amp;eacute;crite dans la [[FAQ de l&#039;installation]].&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;$rooturl&#039;&#039;&#039; : indique l&#039;adresse URL pour acc&amp;amp;eacute;der &amp;amp;agrave; votre questionnaire. Si vous avez copi&amp;amp;eacute; les fichiers de LimeSurvey dans un dossier &#039;&#039;repertoireLS&#039;&#039; vous devrez renommer &#039;&#039;.../limesurvey&#039;&#039; avec le nom que vous avez choisi (&#039;&#039;repertoireLS&#039;&#039;). Le r&amp;amp;eacute;glage par d&amp;amp;eacute;faut essaie de trouver &amp;amp;ccedil;a automatiquement pour vous et, la plupart du temps, ce r&amp;amp;eacute;glage ne devra pas &amp;amp;ecirc;tre modifi&amp;amp;eacute; (le code {$_SERVER&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;&#039;SERVER_NAME&#039;]} devrait fonctionner dans la majorit&amp;amp;eacute; des cas). Si cela ne fonctionne pas, vous devrez entrer manuellement l&#039;adresse ici, par exemple &amp;quot;http://www.mydomain.com/limesurvey&amp;quot;). Si vous souhaitez que LimeSurvey utilise SSL, changez http en https (en consid&amp;amp;eacute;rant que les certificats SSL sont correctement install&amp;amp;eacute;s et configur&amp;amp;eacute;s sur votre serveur)&lt;br /&gt;
*&#039;&#039;&#039;$rootdir&#039;&#039;&#039; : doit contenir le chemin physique vers les fichiers du programme. Le r&amp;amp;eacute;glage par d&amp;amp;eacute;faut essaie de trouver cette valeur pour vous et, la plupart du temps, ce r&amp;amp;eacute;glage ne devra pas &amp;amp;ecirc;tre modifi&amp;amp;eacute; (le code &amp;quot;dirname(!!!FILE!!!);&amp;quot; essaie de trouver automatiquement). Si cela ne fonctionne pas, vous devrez entrer manuellement l&#039;emplacement physique des fichiers, par exemple &amp;quot;/home/public_html/limesurvey&amp;quot;.)&lt;br /&gt;
*&#039;&#039;&#039;$defaultuser&#039;&#039;&#039; : quand le programme utilise le contr&amp;amp;ocirc;le d&#039;acc&amp;amp;egrave;s, ceci est l&#039;utilisateur par d&amp;amp;eacute;faut cr&amp;amp;eacute;&amp;amp;eacute; quand LimeSurvey initialise la s&amp;amp;eacute;curit&amp;amp;eacute; pour la premi&amp;amp;egrave;re fois.&lt;br /&gt;
*&#039;&#039;&#039;$defaultpass&#039;&#039;&#039; : quand le programme utilise le contr&amp;amp;ocirc;le d&#039;acc&amp;amp;egrave;s, ceci est le mot de passe par d&amp;amp;eacute;faut utilis&amp;amp;eacute; quand LimeSurvey initialise la s&amp;amp;eacute;curit&amp;amp;eacute; pour la premi&amp;amp;egrave;re fois.&lt;br /&gt;
&lt;br /&gt;
+&#039;&#039;&#039;Note&#039;&#039;&#039; : ce param&amp;amp;egrave;tre est utilis&amp;amp;eacute; &#039;&#039;&#039;seulement&#039;&#039;&#039; pour la configuration initiale. Quand l&#039;utilisateur par d&amp;amp;eacute;faut &#039;&#039;$defaultuser&#039;&#039; est d&amp;amp;eacute;j&amp;amp;agrave; cr&amp;amp;eacute;&amp;amp;eacute;, cette option n&#039;est plus utilis&amp;amp;eacute;e. Vous devrez changer votre mot de passe dans la gestion des utilisateurs.&lt;br /&gt;
&lt;br /&gt;
==5.2 R&amp;amp;eacute;glages optionnels==&lt;br /&gt;
&lt;br /&gt;
Il existe plusieurs autres r&amp;amp;eacute;glages optionnels que vous pouvez d&amp;amp;eacute;finir dans config.php. Veuillez consultez la page des [[r&amp;amp;eacute;glages optionnels]]. Cependant, pour une configuration de base, poursuivez &amp;amp;agrave; l&#039;&amp;amp;eacute;tape suivante.&lt;br /&gt;
&lt;br /&gt;
=6. Envoi des fichiers sur votre serveur web=&lt;br /&gt;
&lt;br /&gt;
En utilisant votre client FTP favori, connectez-vous &amp;amp;agrave; votre serveur web et cr&amp;amp;eacute;ez un dossier pour y stocker les fichiers de LimeSurvey. Envoyez dans ce dossier l&#039;ensemble des fichiers de LimeSurvey en respectant la structure des dossiers. Nous vous recommandons d&#039;envoyer les fichiers en mode binaire (r&amp;amp;eacute;glage du programme de FTP). En utilisant le mode ASCII, parfois les images sont mal transf&amp;amp;eacute;r&amp;amp;eacute;es.&lt;br /&gt;
&lt;br /&gt;
=7. D&amp;amp;eacute;finition des permissions des dossiers=&lt;br /&gt;
&lt;br /&gt;
Pour que le programme fonctionne correctement, il a besoin d&#039;acc&amp;amp;egrave;s &amp;amp;agrave; certains dossiers. Cela s&#039;applique sp&amp;amp;eacute;cialement aux syst&amp;amp;egrave;mes Linux/*nix.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; est utilis&amp;amp;eacute; pour les importations et les exportations et doit &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour le serveur web.&lt;br /&gt;
* le dossier &#039;&#039;&#039;&amp;quot;/limesurvey/upload&amp;quot;&#039;&#039;&#039; et ses sous-dossiers doivent aussi &amp;amp;ecirc;tre en &#039;&#039;lecture et &amp;amp;eacute;criture&#039;&#039; pour votre serveur web pour activer l&#039;envoi d&#039;images et de fichiers multim&amp;amp;eacute;dias.&lt;br /&gt;
* les autres dossiers peuvent &amp;amp;ecirc;tre en &#039;&#039;lecture seule&#039;&#039;. Vous pouvez aussi d&amp;amp;eacute;finir des permissions de &#039;&#039;lecture seule&#039;&#039; pour chaque fichier dans le dossier &#039;&#039;/limesurvey/admin&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Conseil :&#039;&#039;&#039; Si vous utilisez Linux alors en fonction de la configuration de votre serveur web vous devrez chmod&amp;amp;eacute; les droits sur les r&amp;amp;eacute;pertoires en &amp;amp;eacute;critures &amp;amp;agrave; 755 ou 777. Essayez 755 en premier et si cela ne marche pas, &amp;quot;passez&amp;quot; &amp;amp;agrave; 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Ex&amp;amp;eacute;cution du script d&#039;installation=&lt;br /&gt;
&lt;br /&gt;
Rendez-vous &amp;amp;agrave; &#039;&#039;&#039;&amp;quot;http://votre.domaine.com/limesurvey/admin/install&amp;quot;&#039;&#039;&#039;. Si vous avez tout configur&amp;amp;eacute; correctement, vous serez invit&amp;amp;eacute; &amp;amp;agrave; cr&amp;amp;eacute;er la base de donn&amp;amp;eacute;es et/ou les tables dans la base.&lt;br /&gt;
&lt;br /&gt;
=9. Premi&amp;amp;egrave;re connexion &amp;amp;agrave; l&#039;interface d&#039;administration=&lt;br /&gt;
&lt;br /&gt;
Vous &amp;amp;ecirc;tes pr&amp;amp;ecirc;t ! Ouvrez votre navigateur et saisissez l&#039;adresse vers le script admin.php. En supposant que vous avez utilis&amp;amp;eacute; limesurvey pour le nom du dossier o&amp;amp;ugrave; vous avez stock&amp;amp;eacute; les fichiers, cela ressemblera &amp;amp;agrave; quelque chose comme-&amp;amp;ccedil;a &amp;quot;http://votre.domaine.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Normalement, vous devriez tomber sur un &amp;amp;eacute;cran d&#039;identification. Les valeurs par d&amp;amp;eacute;faut pour pouvoir se connecter sont :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Utilisateur : admin&lt;br /&gt;
&lt;br /&gt;
Mot de passe : password&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il vous sera demand&amp;amp;eacute; de changer ce mot de passe apr&amp;amp;egrave;s la premi&amp;amp;egrave;re connexion. Amusez-vous bien !&lt;br /&gt;
&lt;br /&gt;
=10. En cas de probl&amp;amp;egrave;me...=&lt;br /&gt;
&lt;br /&gt;
Comme tout programme informatique, les choses se d&amp;amp;eacute;rouleront telles que d&amp;amp;eacute;crites dans les instructions mais, en g&amp;amp;eacute;n&amp;amp;eacute;ral, ce ne sera pas le cas. Il existe de nombreuses de raisons possibles pour que les choses ne se passent pas comme d&amp;amp;eacute;crites ici. Si vous avez des soucis, veuillez d&#039;abord consulter la [[FAQ de l&#039;installation]]. Si vous ne trouvez pas de r&amp;amp;eacute;ponses alors veuillez d&amp;amp;eacute;crire votre probl&amp;amp;egrave;me dans le [http://www.limesurvey.org/component/option,com_fireboard/Itemid,86/lang,fr/ forum de LimeSurvey] sur limesurvey.org.ou essayer de contacter quelqu&#039;un dans le [irc://irc.freenode.net/limesurvey|salon IRC de LimeSurvey] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;[http://www.limesurvey.org/index.php/Live-Chat.html Lien direct vers le canal IRC officiel de LimeSurvey]&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tutoriels vid&amp;amp;eacute;o=&lt;br /&gt;
&lt;br /&gt;
Ces tutoriels vid&amp;amp;eacute;o n&#039;ont pas &amp;amp;eacute;t&amp;amp;eacute; cr&amp;amp;eacute;&amp;amp;eacute;s et ne sont pas maintenus par notre &amp;amp;eacute;quipe et doivent &amp;amp;ecirc;tre utilis&amp;amp;eacute;s comme &amp;quot;pense-b&amp;amp;ecirc;te&amp;quot;. Ils ne remplacent en rien la lecture des instructions ci-dessus !&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu How to install and configure &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; v1.01 in Ubuntu Feisty].&lt;br /&gt;
* OSS Watch [http://wiki.oss-watch.ac.uk/LimeSurveyInUbuntu Upgrading from &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.01 to &#039;&#039;&#039;LimeSurvey&#039;&#039;&#039; 1.52+ build 3304 2007-09-20 in Ubuntu Feisty].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3561</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3561"/>
		<updated>2012-11-16T16:21:26Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use these instructions if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be automatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed). The upgrade process tries to replace the template.js inclusion by the placeholder {TEMPLATEJS}. If you have javascript issue with your custom template, verify if your template have the placeholder {TEMPLATEJS} in startpage.pstpl.&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3562</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3562"/>
		<updated>2012-11-16T16:19:56Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use this instruction if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be automatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed). The upgrade process tries to replace the template.js inclusion by the placeholder {TEMPLATEJS}. If you have javascript issue with your custom template, verify if your template have the placeholder {TEMPLATEJS} in startpage.pstpl.&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3563</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3563"/>
		<updated>2012-11-16T16:19:41Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use this instruction if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be automatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed). The upgrade process tries to replace the template.js inclusion by the placeholder {TEMPLATEJS}. If you have javascript issue with your custom template, verify if your template have the placeholder {TEMPLATEJS} in startpage.pstpl.&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3564</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3564"/>
		<updated>2012-11-16T16:18:31Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use this instruction if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be automatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed). The upgrade process tries to replace the template.js inclusion by the placeholder {TEMPLATEJS}. If you have javascript issue with your custom template, verify if your template have the placeholder {TEMPLATEJS} in startpage.pstpl.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3130</id>
		<title>Coding guidelines</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3130"/>
		<updated>2012-11-16T14:51:02Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:__TOC__&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a free development, everything you do can be useful for others. If the feature is very personal there is a way to turn it into a universal solution. This is the challenge!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;quot;The difficulty within a solution is to solve it in a simple way&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Lance Burton, magician)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some general rules:&lt;br /&gt;
*Be efficient and save resources (memory and runtime). Things might work for a small survey but also try out your new feature with a survey that has 400 question, 5 languages and 20,000 responses (Yes, there are surveys like this out there).&lt;br /&gt;
*Keep a fluid dialog with the others coders, they have their own thoughts about what you are doing.&lt;br /&gt;
*Ask if you are in doubt.&lt;br /&gt;
&lt;br /&gt;
=Naming convention=&lt;br /&gt;
*Use the Hungarian Rule for variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[t]NameOfVariable&lt;br /&gt;
&lt;br /&gt;
 | &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;+&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
 |        +--&amp;gt; Descriptive name&lt;br /&gt;
&lt;br /&gt;
 +--&amp;gt; Datatype stored (for example start with &amp;quot;a&amp;quot; if it is an array)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
aQuestionAttributes: Array to store the questions attributes, Mixed values&lt;br /&gt;
&lt;br /&gt;
dSurveyEnds: Date when the survey ends&lt;br /&gt;
&lt;br /&gt;
sContditionsOutput: String used to create the JS for conditions&lt;br /&gt;
*In case a function is declared &#039;&#039;&#039;do not&#039;&#039;&#039; use the Hungarian rule for the function name, instead use &amp;quot;Lower CamelCase&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
function questionsRetrieve( $iQID, $iSurvey)&lt;br /&gt;
*What about files? Unless Yii requires it in some way always name your files in lowercase - this prevents problems on systems using case-aware filesystems&lt;br /&gt;
&lt;br /&gt;
=Documentation=&lt;br /&gt;
&lt;br /&gt;
Please refer to this introduction: [[How to document your source code]].&lt;br /&gt;
&lt;br /&gt;
=Structures=&lt;br /&gt;
*Indent using spaces instead of TAB, or be gentle to announce how many spaces are your TABs long. There is wide ranging debate about tabs vs. spaces, many people prefer using tabs, others prefer spaces, others are happy with a mix of tabs and spaces. Because LimeSurvey is developed collaboratively, we ask that you leave your preference and follow this standard.&lt;br /&gt;
*The opening curly brace must be below the structure opening:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if (condition)&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;
*Using one line for a simple condition is very &amp;quot;fashionable&amp;quot;, a taste of &amp;quot;hacker&amp;quot;, but it is not clear at all:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true} else {do false}&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true}&lt;br /&gt;
&lt;br /&gt;
        else {do false}&lt;br /&gt;
&lt;br /&gt;
 RIGHT: if (condition)&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do true&lt;br /&gt;
&lt;br /&gt;
        } else&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do false&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
 RIGHT: swith $sSelector&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
              case X:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case Y:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
              default:&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: It&amp;amp;acute;s true that sometimes the &amp;quot;WRONG&amp;quot; way can be useful, but if it makes the straight reading difficult, please use the &amp;quot;RIGHT&amp;quot; way instead. Be gentle with your fellow developers.&lt;br /&gt;
*SQL sentences must respect the same rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $sSQL = &amp;quot;SELECT field1, field2, field3 &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;WHERE condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;AND condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;OR condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;ORDER BY field1, field2&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The same for HTML in views tags:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td colspan=&#039;2&#039;&lt;br /&gt;
&lt;br /&gt;
     height=&#039;4&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Some Text&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML=&lt;br /&gt;
*As you will notice, a very customized HTML element can take a lot of lines (very expensive if you paid each one (:wink:) ) to avoid that, use &#039;CSS classes&#039;. In general, use classes to aesthetic related stuff: color, borders, backgrounds, font faces, sizes, etc.&lt;br /&gt;
*Respect W3C standards, and try to use the HTML understandable for all browsers. If one of them has a special feature, think if this feature is so special to break down the HTML in other browsers.&lt;br /&gt;
*Do not use PHP short tags &amp;lt;? ?&amp;gt;. Always use full PHP tags &amp;lt;?php ?&amp;gt;&lt;br /&gt;
*Any rules of the mentioned before: about CSS, well closed HTML tags and JS respect XHTML standards. Give it a try!.&lt;br /&gt;
&lt;br /&gt;
=Localization=&lt;br /&gt;
&lt;br /&gt;
Currently we are using the gT(),eT(),ngT() and neT() functions of the limesurvey_lang object for translations.&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey is available in 60 languages it is very important that your original English string (which will be picked up automatically for translation by our translators) is done right from the start. Imagine if we have to correct only one string at a later time - then 60 strings become invalid across the project and need to be re-translated by the poor translator souls.&lt;br /&gt;
* gT() is the original translation function. It will return a translated version of the string in the currently selected language. ie: echo &#039;&#039;$clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* ngT() returns multiple translations of a sentence or phrase for which alternate plural forms may apply. ie: &#039;&#039;echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers)&#039;&#039;;&lt;br /&gt;
* eT() echos the translation directly. (ie: instead of &#039;&#039;echo $clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039; you can use &#039;&#039;$clang-&amp;gt;eT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* neT() echos the multiple translations of the sentence or phrase for which alternate plural forms may apply directly.&lt;br /&gt;
&lt;br /&gt;
Please follow these important rules:&lt;br /&gt;
*&#039;&#039;&#039;Do not embed margin spaces&#039;&#039;&#039; in your translation. Instead use proper CSS formatting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible? &#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible?&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not capitalize words&#039;&#039;&#039; except where grammatically correct (like at the beginning of a sentence or for a brand name). LimeSurvey is not a newspaper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create A New Label Set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create a new label set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API Key&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API key&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not concatenate&#039;&#039;&#039; several translations to form a sentence or concatenate to an additional information (like a number or string). Instead use the sprint() or sprintf() function with placeholders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The sum must not be bigger than&#039;).$iMaxSum;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The sum must not be bigger than %s&#039;),$iMaxSum);&lt;br /&gt;
&lt;br /&gt;
This comes from the problem that in other languages the setting of a sentence can be much different and the information $iMaxSum from the example above might be needed in the middle of the sentence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The user&#039;).$sUsername.$clang-&amp;gt;gT(&#039;was deleted.&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The user %s was deleted.&#039;),$sUsername);&lt;br /&gt;
*&#039;&#039;&#039;Use the n*T functions where applicable&#039;&#039;&#039;. These functions show a different translation depending the number of items. Currently LimeSurvey only supports the numbers/situations 1 and &amp;gt;1.&lt;br /&gt;
&lt;br /&gt;
+Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;Please select at least %s answer(s).&#039;),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
=Bug tracker=&lt;br /&gt;
#First consider if the reported issue is really a bug. If it is a feature request please point the reporter to http://ideas.limesurvey.org and set the issue status to &#039;Closed&#039;.&lt;br /&gt;
#If you would like to work on a bug assign it to yourself.&lt;br /&gt;
#Try to reproduce the issue.&lt;br /&gt;
##If you cannot reproduce ask the user to provide a small example survey to demonstrate the issue. Then set the issue to &#039;Feedback&#039;. After the user added the necessary information it will automatically be set to &#039;Assigned&#039; again.&lt;br /&gt;
##If the user does not responds for more than a week ask once again for feedback by adding a comment. After a further week without feedback close the issue.&lt;br /&gt;
#After you resolved the issue set the status to resolved AND provide the &#039;Fixed in version&#039; information.&lt;br /&gt;
#After you committed your fix add a comment to the resolved issue &#039;Fixed in rev. &amp;lt;Subversion revision number&amp;gt;&#039;&lt;br /&gt;
#After a release the release technician will set all issues to &#039;Closed&#039; that were fixed for this release. That signals to the reporter that a fix is available in the version and it was just released.&lt;br /&gt;
&lt;br /&gt;
=Cross-DB compatibility=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey targets several database types it can run on: MySQL, Postgres and Microsoft SQL Server. This demands certain precautions when coding&lt;br /&gt;
&lt;br /&gt;
==Parameter binding==&lt;br /&gt;
&lt;br /&gt;
Yii/PDO supports parameter binding - use it. Don&#039;t inject variables directly into the query or into conditions because this might create a security issue.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;somefield&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{sometable}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you bind the same value several times do NOT use the same parameter name, instead use a different named parameter for each bind:&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;somefield&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid and parent_sid= :sid &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{sometable}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RIGHT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;somefield&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid1 and parent_sid= :sid2 &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{sometable}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid1&amp;quot;, $surveyid, PDO::PARAM_INT)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid2&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous=&lt;br /&gt;
*Do not use &amp;quot;global&amp;quot; to access to a declared variable in another process. Pass variables or arrays by reference, use the session or the configuration object.&lt;br /&gt;
*If using an auxiliary variable makes clear the code or process, just do it. If you are coding a very complex expression, calling to functions with parameters that are other functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
iAResult= fa(fb(p1,p2),fc(fd(p3),p4),p5)&lt;br /&gt;
&lt;br /&gt;
It will be more readable:&lt;br /&gt;
&lt;br /&gt;
iAuxB = fb(p1,p2)&lt;br /&gt;
&lt;br /&gt;
iAuxD = fd(p3)&lt;br /&gt;
&lt;br /&gt;
iAuxC = fc(iAuxD,p4)&lt;br /&gt;
&lt;br /&gt;
iAResult = fa(iAuxB, iAuxC, p5)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Anyway, if you are in doubt about someone missing the point or you are afraid that your expression is obscure, take the chance of writing it in a more simple way, even if that involves the use of one or more auxiliary variables.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3131</id>
		<title>Coding guidelines</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3131"/>
		<updated>2012-11-16T13:25:10Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:__TOC__&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a free development, everything you do can be useful for others. If the feature is very personal there is a way to turn it into a universal solution. This is the challenge!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;quot;The difficulty within a solution is to solve it in a simple way&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Lance Burton, magician)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some general rules:&lt;br /&gt;
*Be efficient and save resources (memory and runtime). Things might work for a small survey but also try out your new feature with a survey that has 400 question, 5 languages and 20,000 responses (Yes, there are surveys like this out there).&lt;br /&gt;
*Keep a fluid dialog with the others coders, they have their own thoughts about what you are doing.&lt;br /&gt;
*Ask if you are in doubt.&lt;br /&gt;
&lt;br /&gt;
=Naming convention=&lt;br /&gt;
*Use the Hungarian Rule for variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[t]NameOfVariable&lt;br /&gt;
&lt;br /&gt;
 | &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;+&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
 |        +--&amp;gt; Descriptive name&lt;br /&gt;
&lt;br /&gt;
 +--&amp;gt; Datatype stored (for example start with &amp;quot;a&amp;quot; if it is an array)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
aQuestionAttributes: Array to store the questions attributes, Mixed values&lt;br /&gt;
&lt;br /&gt;
dSurveyEnds: Date when the survey ends&lt;br /&gt;
&lt;br /&gt;
sContditionsOutput: String used to create the JS for conditions&lt;br /&gt;
*In case a function is declared &#039;&#039;&#039;do not&#039;&#039;&#039; use the Hungarian rule for the function name, instead use &amp;quot;Lower CamelCase&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
function questionsRetrieve( $iQID, $iSurvey)&lt;br /&gt;
*What about files? Unless Yii requires it in some way always name your files in lowercase - this prevents problems on systems using case-aware filesystems&lt;br /&gt;
&lt;br /&gt;
=Documentation=&lt;br /&gt;
&lt;br /&gt;
Please refer to this introduction: [[How to document your source code]].&lt;br /&gt;
&lt;br /&gt;
=Structures=&lt;br /&gt;
*Indent using spaces instead of TAB, or be gentle to announce how many spaces are your TABs long. There is wide ranging debate about tabs vs. spaces, many people prefer using tabs, others prefer spaces, others are happy with a mix of tabs and spaces. Because LimeSurvey is developed collaboratively, we ask that you leave your preference and follow this standard.&lt;br /&gt;
*The opening curly brace must be below the structure opening:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if (condition)&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;
*Using one line for a simple condition is very &amp;quot;fashionable&amp;quot;, a taste of &amp;quot;hacker&amp;quot;, but it is not clear at all:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true} else {do false}&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true}&lt;br /&gt;
&lt;br /&gt;
        else {do false}&lt;br /&gt;
&lt;br /&gt;
 RIGHT: if (condition)&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do true&lt;br /&gt;
&lt;br /&gt;
        } else&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do false&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
 RIGHT: swith $sSelector&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
              case X:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case Y:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
              default:&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: It&amp;amp;acute;s true that sometimes the &amp;quot;WRONG&amp;quot; way can be useful, but if it makes the straight reading difficult, please use the &amp;quot;RIGHT&amp;quot; way instead. Be gentle with your fellow developers.&lt;br /&gt;
*SQL sentences must respect the same rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $sSQL = &amp;quot;SELECT field1, field2, field3 &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;WHERE condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;AND condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;OR condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;ORDER BY field1, field2&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The same for HTML in views tags:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td colspan=&#039;2&#039;&lt;br /&gt;
&lt;br /&gt;
     height=&#039;4&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Some Text&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML=&lt;br /&gt;
*As you will notice, a very customized HTML element can take a lot of lines (very expensive if you paid each one (:wink:) ) to avoid that, use &#039;CSS classes&#039;. In general, use classes to aesthetic related stuff: color, borders, backgrounds, font faces, sizes, etc.&lt;br /&gt;
*Respect W3C standards, and try to use the HTML understandable for all browsers. If one of them has a special feature, think if this feature is so special to break down the HTML in other browsers.&lt;br /&gt;
*Do not use PHP short tags &amp;lt;? ?&amp;gt;. Always use full PHP tags &amp;lt;?php ?&amp;gt;&lt;br /&gt;
*Any rules of the mentioned before: about CSS, well closed HTML tags and JS respect XHTML standards. Give it a try!.&lt;br /&gt;
&lt;br /&gt;
=Localization=&lt;br /&gt;
&lt;br /&gt;
Currently we are using the gT(),eT(),ngT() and neT() functions of the limesurvey_lang object for translations.&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey is available in 60 languages it is very important that your original English string (which will be picked up automatically for translation by our translators) is done right from the start. Imagine if we have to correct only one string at a later time - then 60 strings become invalid across the project and need to be re-translated by the poor translator souls.&lt;br /&gt;
* gT() is the original translation function. It will return a translated version of the string in the currently selected language. ie: echo &#039;&#039;$clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* ngT() returns multiple translations of a sentence or phrase for which alternate plural forms may apply. ie: &#039;&#039;echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers)&#039;&#039;;&lt;br /&gt;
* eT() echos the translation directly. (ie: instead of &#039;&#039;echo $clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039; you can use &#039;&#039;$clang-&amp;gt;eT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* neT() echos the multiple translations of the sentence or phrase for which alternate plural forms may apply directly.&lt;br /&gt;
&lt;br /&gt;
Please follow these important rules:&lt;br /&gt;
*&#039;&#039;&#039;Do not embed margin spaces&#039;&#039;&#039; in your translation. Instead use proper CSS formatting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible? &#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible?&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not capitalize words&#039;&#039;&#039; except where grammatically correct (like at the beginning of a sentence or for a brand name). LimeSurvey is not a newspaper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create A New Label Set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create a new label set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API Key&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API key&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not concatenate&#039;&#039;&#039; several translations to form a sentence or concatenate to an additional information (like a number or string). Instead use the sprint() or sprintf() function with placeholders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The sum must not be bigger than&#039;).$iMaxSum;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The sum must not be bigger than %s&#039;),$iMaxSum);&lt;br /&gt;
&lt;br /&gt;
This comes from the problem that in other languages the setting of a sentence can be much different and the information $iMaxSum from the example above might be needed in the middle of the sentence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The user&#039;).$sUsername.$clang-&amp;gt;gT(&#039;was deleted.&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The user %s was deleted.&#039;),$sUsername);&lt;br /&gt;
*&#039;&#039;&#039;Use the n*T functions where applicable&#039;&#039;&#039;. These functions show a different translation depending the number of items. Currently LimeSurvey only supports the numbers/situations 1 and &amp;gt;1.&lt;br /&gt;
&lt;br /&gt;
+Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;Please select at least %s answer(s).&#039;),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
=Bug tracker=&lt;br /&gt;
#First consider if the reported issue is really a bug. If it is a feature request please point the reporter to http://ideas.limesurvey.org and set the issue status to &#039;Closed&#039;.&lt;br /&gt;
#If you would like to work on a bug assign it to yourself.&lt;br /&gt;
#Try to reproduce the issue.&lt;br /&gt;
##If you cannot reproduce ask the user to provide a small example survey to demonstrate the issue. Then set the issue to &#039;Feedback&#039;. After the user added the necessary information it will automatically be set to &#039;Assigned&#039; again.&lt;br /&gt;
##If the user does not responds for more than a week ask once again for feedback by adding a comment. After a further week without feedback close the issue.&lt;br /&gt;
#After you resolved the issue set the status to resolved AND provide the &#039;Fixed in version&#039; information.&lt;br /&gt;
#After you committed your fix add a comment to the resolved issue &#039;Fixed in rev. &amp;lt;Subversion revision number&amp;gt;&#039;&lt;br /&gt;
#After a release the release technician will set all issues to &#039;Closed&#039; that were fixed for this release. That signals to the reporter that a fix is available in the version and it was just released.&lt;br /&gt;
&lt;br /&gt;
=Cross-DB compatibility=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey targets several database types it can run on: MySQL, Postgres and Microsoft SQL Server. This demands certain precautions when coding&lt;br /&gt;
&lt;br /&gt;
==Parameter binding==&lt;br /&gt;
&lt;br /&gt;
Yii/PDO supports parameter binding - use it. Don&#039;t inject variables directly into the query or into conditions.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;somefield&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{sometable}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you bind the same value several times do NOT use the same parameter name, instead use a different named parameter for each bind:&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;somefield&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid and parent_sid= :sid &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{sometable}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RIGHT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;somefield&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid1 and parent_sid= :sid2 &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{sometable}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid1&amp;quot;, $surveyid, PDO::PARAM_INT)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid2&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous=&lt;br /&gt;
*Do not use &amp;quot;global&amp;quot; to access to a declared variable in another process. Pass variables or arrays by reference, use the session or the configuration object.&lt;br /&gt;
*If using an auxiliary variable makes clear the code or process, just do it. If you are coding a very complex expression, calling to functions with parameters that are other functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
iAResult= fa(fb(p1,p2),fc(fd(p3),p4),p5)&lt;br /&gt;
&lt;br /&gt;
It will be more readable:&lt;br /&gt;
&lt;br /&gt;
iAuxB = fb(p1,p2)&lt;br /&gt;
&lt;br /&gt;
iAuxD = fd(p3)&lt;br /&gt;
&lt;br /&gt;
iAuxC = fc(iAuxD,p4)&lt;br /&gt;
&lt;br /&gt;
iAResult = fa(iAuxB, iAuxC, p5)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Anyway, if you are in doubt about someone missing the point or you are afraid that your expression is obscure, take the chance of writing it in a more simple way, even if that involves the use of one or more auxiliary variables.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3132</id>
		<title>Coding guidelines</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3132"/>
		<updated>2012-11-16T13:24:25Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:__TOC__&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a free development, everything you do can be useful for others. If the feature is very personal there is a way to turn it into a universal solution. This is the challenge!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;quot;The difficulty within a solution is to solve it in a simple way&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Lance Burton, magician)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some general rules:&lt;br /&gt;
*Be efficient and save resources (memory and runtime). Things might work for a small survey but also try out your new feature with a survey that has 400 question, 5 languages and 20,000 responses (Yes, there are surveys like this out there).&lt;br /&gt;
*Keep a fluid dialog with the others coders, they have their own thoughts about what you are doing.&lt;br /&gt;
*Ask if you are in doubt.&lt;br /&gt;
&lt;br /&gt;
=Naming convention=&lt;br /&gt;
*Use the Hungarian Rule for variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[t]NameOfVariable&lt;br /&gt;
&lt;br /&gt;
 | &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;+&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
 |        +--&amp;gt; Descriptive name&lt;br /&gt;
&lt;br /&gt;
 +--&amp;gt; Datatype stored (for example start with &amp;quot;a&amp;quot; if it is an array)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
aQuestionAttributes: Array to store the questions attributes, Mixed values&lt;br /&gt;
&lt;br /&gt;
dSurveyEnds: Date when the survey ends&lt;br /&gt;
&lt;br /&gt;
sContditionsOutput: String used to create the JS for conditions&lt;br /&gt;
*In case a function is declared &#039;&#039;&#039;do not&#039;&#039;&#039; use the Hungarian rule for the function name, instead use &amp;quot;Lower CamelCase&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
function questionsRetrieve( $iQID, $iSurvey)&lt;br /&gt;
*What about files? Unless Yii requires it in some way always name your files in lowercase - this prevents problems on systems using case-aware filesystems&lt;br /&gt;
&lt;br /&gt;
=Documentation=&lt;br /&gt;
&lt;br /&gt;
Please refer to this introduction: [[How to document your source code]].&lt;br /&gt;
&lt;br /&gt;
=Structures=&lt;br /&gt;
*Indent using spaces instead of TAB, or be gentle to announce how many spaces are your TABs long. There is wide ranging debate about tabs vs. spaces, many people prefer using tabs, others prefer spaces, others are happy with a mix of tabs and spaces. Because LimeSurvey is developed collaboratively, we ask that you leave your preference and follow this standard.&lt;br /&gt;
*The opening curly brace must be below the structure opening:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if (condition)&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;
*Using one line for a simple condition is very &amp;quot;fashionable&amp;quot;, a taste of &amp;quot;hacker&amp;quot;, but it is not clear at all:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true} else {do false}&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true}&lt;br /&gt;
&lt;br /&gt;
        else {do false}&lt;br /&gt;
&lt;br /&gt;
 RIGHT: if (condition)&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do true&lt;br /&gt;
&lt;br /&gt;
        } else&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do false&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
 RIGHT: swith $sSelector&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
              case X:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case Y:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
              default:&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: It&amp;amp;acute;s true that sometimes the &amp;quot;WRONG&amp;quot; way can be useful, but if it makes the straight reading difficult, please use the &amp;quot;RIGHT&amp;quot; way instead. Be gentle with your fellow developers.&lt;br /&gt;
*SQL sentences must respect the same rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $sSQL = &amp;quot;SELECT field1, field2, field3 &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;WHERE condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;AND condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;OR condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;ORDER BY field1, field2&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The same for HTML in views tags:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td colspan=&#039;2&#039;&lt;br /&gt;
&lt;br /&gt;
     height=&#039;4&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Some Text&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML=&lt;br /&gt;
*As you will notice, a very customized HTML element can take a lot of lines (very expensive if you paid each one (:wink:) ) to avoid that, use &#039;CSS classes&#039;. In general, use classes to aesthetic related stuff: color, borders, backgrounds, font faces, sizes, etc.&lt;br /&gt;
*Respect W3C standards, and try to use the HTML understandable for all browsers. If one of them has a special feature, think if this feature is so special to break down the HTML in other browsers.&lt;br /&gt;
*Do not use PHP short tags &amp;lt;? ?&amp;gt;. Always use full PHP tags &amp;lt;?php ?&amp;gt;&lt;br /&gt;
*Any rules of the mentioned before: about CSS, well closed HTML tags and JS respect XHTML standards. Give it a try!.&lt;br /&gt;
&lt;br /&gt;
=Localization=&lt;br /&gt;
&lt;br /&gt;
Currently we are using the gT(),eT(),ngT() and neT() functions of the limesurvey_lang object for translations.&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey is available in 60 languages it is very important that your original English string (which will be picked up automatically for translation by our translators) is done right from the start. Imagine if we have to correct only one string at a later time - then 60 strings become invalid across the project and need to be re-translated by the poor translator souls.&lt;br /&gt;
* gT() is the original translation function. It will return a translated version of the string in the currently selected language. ie: echo &#039;&#039;$clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* ngT() returns multiple translations of a sentence or phrase for which alternate plural forms may apply. ie: &#039;&#039;echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers)&#039;&#039;;&lt;br /&gt;
* eT() echos the translation directly. (ie: instead of &#039;&#039;echo $clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039; you can use &#039;&#039;$clang-&amp;gt;eT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* neT() echos the multiple translations of the sentence or phrase for which alternate plural forms may apply directly.&lt;br /&gt;
&lt;br /&gt;
Please follow these important rules:&lt;br /&gt;
*&#039;&#039;&#039;Do not embed margin spaces&#039;&#039;&#039; in your translation. Instead use proper CSS formatting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible? &#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible?&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not capitalize words&#039;&#039;&#039; except where grammatically correct (like at the beginning of a sentence or for a brand name). LimeSurvey is not a newspaper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create A New Label Set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create a new label set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API Key&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API key&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not concatenate&#039;&#039;&#039; several translations to form a sentence or concatenate to an additional information (like a number or string). Instead use the sprint() or sprintf() function with placeholders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The sum must not be bigger than&#039;).$iMaxSum;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The sum must not be bigger than %s&#039;),$iMaxSum);&lt;br /&gt;
&lt;br /&gt;
This comes from the problem that in other languages the setting of a sentence can be much different and the information $iMaxSum from the example above might be needed in the middle of the sentence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The user&#039;).$sUsername.$clang-&amp;gt;gT(&#039;was deleted.&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The user %s was deleted.&#039;),$sUsername);&lt;br /&gt;
*&#039;&#039;&#039;Use the n*T functions where applicable&#039;&#039;&#039;. These functions show a different translation depending the number of items. Currently LimeSurvey only supports the numbers/situations 1 and &amp;gt;1.&lt;br /&gt;
&lt;br /&gt;
+Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;Please select at least %s answer(s).&#039;),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
=Bug tracker=&lt;br /&gt;
#First consider if the reported issue is really a bug. If it is a feature request please point the reporter to http://ideas.limesurvey.org and set the issue status to &#039;Closed&#039;.&lt;br /&gt;
#If you would like to work on a bug assign it to yourself.&lt;br /&gt;
#Try to reproduce the issue.&lt;br /&gt;
##If you cannot reproduce ask the user to provide a small example survey to demonstrate the issue. Then set the issue to &#039;Feedback&#039;. After the user added the necessary information it will automatically be set to &#039;Assigned&#039; again.&lt;br /&gt;
##If the user does not responds for more than a week ask once again for feedback by adding a comment. After a further week without feedback close the issue.&lt;br /&gt;
#After you resolved the issue set the status to resolved AND provide the &#039;Fixed in version&#039; information.&lt;br /&gt;
#After you committed your fix add a comment to the resolved issue &#039;Fixed in rev. &amp;lt;Subversion revision number&amp;gt;&#039;&lt;br /&gt;
#After a release the release technician will set all issues to &#039;Closed&#039; that were fixed for this release. That signals to the reporter that a fix is available in the version and it was just released.&lt;br /&gt;
&lt;br /&gt;
=Cross-DB compatibility=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey targets several database types it can run on: MySQL, Postgres and Microsoft SQL Server. This demands certain precautions when coding&lt;br /&gt;
&lt;br /&gt;
==Parameter binding==&lt;br /&gt;
&lt;br /&gt;
Yii/PDO supports parameter binding - use it. Don&#039;t inject variables directly into the query or into conditions.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;attributedescriptions&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you bind the same value several times do NOT use the same parameter name, instead use a different named parameter for each bind:&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;sometable&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid and parent_sid= :sid &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RIGHT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;sometable&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid1 and parent_sid= :sid2 &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid1&amp;quot;, $surveyid, PDO::PARAM_INT)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid2&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous=&lt;br /&gt;
*Do not use &amp;quot;global&amp;quot; to access to a declared variable in another process. Pass variables or arrays by reference, use the session or the configuration object.&lt;br /&gt;
*If using an auxiliary variable makes clear the code or process, just do it. If you are coding a very complex expression, calling to functions with parameters that are other functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
iAResult= fa(fb(p1,p2),fc(fd(p3),p4),p5)&lt;br /&gt;
&lt;br /&gt;
It will be more readable:&lt;br /&gt;
&lt;br /&gt;
iAuxB = fb(p1,p2)&lt;br /&gt;
&lt;br /&gt;
iAuxD = fd(p3)&lt;br /&gt;
&lt;br /&gt;
iAuxC = fc(iAuxD,p4)&lt;br /&gt;
&lt;br /&gt;
iAResult = fa(iAuxB, iAuxC, p5)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Anyway, if you are in doubt about someone missing the point or you are afraid that your expression is obscure, take the chance of writing it in a more simple way, even if that involves the use of one or more auxiliary variables.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3133</id>
		<title>Coding guidelines</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3133"/>
		<updated>2012-11-16T13:17:39Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:__TOC__&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a free development, everything you do can be useful for others. If the feature is very personal there is a way to turn it into a universal solution. This is the challenge!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;quot;The difficulty within a solution is to solve it in a simple way&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Lance Burton, magician)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some general rules:&lt;br /&gt;
*Be efficient and save resources (memory and runtime). Things might work for a small survey but also try out your new feature with a survey that has 400 question, 5 languages and 20,000 responses (Yes, there are surveys like this out there).&lt;br /&gt;
*Keep a fluid dialog with the others coders, they have their own thoughts about what you are doing.&lt;br /&gt;
*Ask if you are in doubt.&lt;br /&gt;
&lt;br /&gt;
=Naming convention=&lt;br /&gt;
*Use the Hungarian Rule for variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[t]NameOfVariable&lt;br /&gt;
&lt;br /&gt;
 | &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;+&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
 |        +--&amp;gt; Descriptive name&lt;br /&gt;
&lt;br /&gt;
 +--&amp;gt; Datatype stored (for example start with &amp;quot;a&amp;quot; if it is an array)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
aQuestionAttributes: Array to store the questions attributes, Mixed values&lt;br /&gt;
&lt;br /&gt;
dSurveyEnds: Date when the survey ends&lt;br /&gt;
&lt;br /&gt;
sContditionsOutput: String used to create the JS for conditions&lt;br /&gt;
*In case a function is declared &#039;&#039;&#039;do not&#039;&#039;&#039; use the Hungarian rule for the function name, instead use &amp;quot;Lower CamelCase&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
function questionsRetrieve( $iQID, $iSurvey)&lt;br /&gt;
*What about files? Unless Yii requires it in some way always name your files in lowercase - this prevents problems on systems using case-aware filesystems&lt;br /&gt;
&lt;br /&gt;
=Documentation=&lt;br /&gt;
&lt;br /&gt;
Please refer to this introduction: [[How to document your source code]].&lt;br /&gt;
&lt;br /&gt;
=Structures=&lt;br /&gt;
*Indent using spaces instead of TAB, or be gentle to announce how many spaces are your TABs long. There is wide ranging debate about tabs vs. spaces, many people prefer using tabs, others prefer spaces, others are happy with a mix of tabs and spaces. Because LimeSurvey is developed collaboratively, we ask that you leave your preference and follow this standard.&lt;br /&gt;
*The opening curly brace must be below the structure opening:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if (condition)&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;
*Using one line for a simple condition is very &amp;quot;fashionable&amp;quot;, a taste of &amp;quot;hacker&amp;quot;, but it is not clear at all:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true} else {do false}&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true}&lt;br /&gt;
&lt;br /&gt;
        else {do false}&lt;br /&gt;
&lt;br /&gt;
 RIGHT: if (condition)&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do true&lt;br /&gt;
&lt;br /&gt;
        } else&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do false&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
 RIGHT: swith $sSelector&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
              case X:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case Y:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
              default:&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: It&amp;amp;acute;s true that sometimes the &amp;quot;WRONG&amp;quot; way can be useful, but if it makes the straight reading difficult, please use the &amp;quot;RIGHT&amp;quot; way instead. Be gentle with your fellow developers.&lt;br /&gt;
*SQL sentences must respect the same rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $sSQL = &amp;quot;SELECT field1, field2, field3 &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;WHERE condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;AND condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;OR condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;ORDER BY field1, field2&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The same for HTML in views tags:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td colspan=&#039;2&#039;&lt;br /&gt;
&lt;br /&gt;
     height=&#039;4&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Some Text&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML=&lt;br /&gt;
*As you will notice, a very customized HTML element can take a lot of lines (very expensive if you paid each one (:wink:) ) to avoid that, use &#039;CSS classes&#039;. In general, use classes to aesthetic related stuff: color, borders, backgrounds, font faces, sizes, etc.&lt;br /&gt;
*Respect W3C standards, and try to use the HTML understandable for all browsers. If one of them has a special feature, think if this feature is so special to break down the HTML in other browsers.&lt;br /&gt;
*Do not use PHP short tags &amp;lt;? ?&amp;gt;. Always use full PHP tags &amp;lt;?php ?&amp;gt;&lt;br /&gt;
*Any rules of the mentioned before: about CSS, well closed HTML tags and JS respect XHTML standards. Give it a try!.&lt;br /&gt;
&lt;br /&gt;
=Localization=&lt;br /&gt;
&lt;br /&gt;
Currently we are using the gT(),eT(),ngT() and neT() functions of the limesurvey_lang object for translations.&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey is available in 60 languages it is very important that your original English string (which will be picked up automatically for translation by our translators) is done right from the start. Imagine if we have to correct only one string at a later time - then 60 strings become invalid across the project and need to be re-translated by the poor translator souls.&lt;br /&gt;
* gT() is the original translation function. It will return a translated version of the string in the currently selected language. ie: echo &#039;&#039;$clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* ngT() returns multiple translations of a sentence or phrase for which alternate plural forms may apply. ie: &#039;&#039;echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers)&#039;&#039;;&lt;br /&gt;
* eT() echos the translation directly. (ie: instead of &#039;&#039;echo $clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039; you can use &#039;&#039;$clang-&amp;gt;eT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* neT() echos the multiple translations of the sentence or phrase for which alternate plural forms may apply directly.&lt;br /&gt;
&lt;br /&gt;
Please follow these important rules:&lt;br /&gt;
*&#039;&#039;&#039;Do not embed margin spaces&#039;&#039;&#039; in your translation. Instead use proper CSS formatting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible? &#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible?&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not capitalize words&#039;&#039;&#039; except where grammatically correct (like at the beginning of a sentence or for a brand name). LimeSurvey is not a newspaper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create A New Label Set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create a new label set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API Key&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API key&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not concatenate&#039;&#039;&#039; several translations to form a sentence or concatenate to an additional information (like a number or string). Instead use the sprint() or sprintf() function with placeholders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The sum must not be bigger than&#039;).$iMaxSum;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The sum must not be bigger than %s&#039;),$iMaxSum);&lt;br /&gt;
&lt;br /&gt;
This comes from the problem that in other languages the setting of a sentence can be much different and the information $iMaxSum from the example above might be needed in the middle of the sentence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The user&#039;).$sUsername.$clang-&amp;gt;gT(&#039;was deleted.&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The user %s was deleted.&#039;),$sUsername);&lt;br /&gt;
*&#039;&#039;&#039;Use the n*T functions where applicable&#039;&#039;&#039;. These functions show a different translation depending the number of items. Currently LimeSurvey only supports the numbers/situations 1 and &amp;gt;1.&lt;br /&gt;
&lt;br /&gt;
+Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;Please select at least %s answer(s).&#039;),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
=Bug tracker=&lt;br /&gt;
#First consider if the reported issue is really a bug. If it is a feature request please point the reporter to http://ideas.limesurvey.org and set the issue status to &#039;Closed&#039;.&lt;br /&gt;
#If you would like to work on a bug assign it to yourself.&lt;br /&gt;
#Try to reproduce the issue.&lt;br /&gt;
##If you cannot reproduce ask the user to provide a small example survey to demonstrate the issue. Then set the issue to &#039;Feedback&#039;. After the user added the necessary information it will automatically be set to &#039;Assigned&#039; again.&lt;br /&gt;
##If the user does not responds for more than a week ask once again for feedback by adding a comment. After a further week without feedback close the issue.&lt;br /&gt;
#After you resolved the issue set the status to resolved AND provide the &#039;Fixed in version&#039; information.&lt;br /&gt;
#After you committed your fix add a comment to the resolved issue &#039;Fixed in rev. &amp;lt;Subversion revision number&amp;gt;&#039;&lt;br /&gt;
#After a release the release technician will set all issues to &#039;Closed&#039; that were fixed for this release. That signals to the reporter that a fix is available in the version and it was just released.&lt;br /&gt;
&lt;br /&gt;
=Cross-DB compatibility=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey targets several database types it can run on: MySQL, Postgres and Microsoft SQL Server. This demands certain precautions when coding&lt;br /&gt;
&lt;br /&gt;
==Parameter binding==&lt;br /&gt;
&lt;br /&gt;
Yii/PDO supports parameter binding - use it. Don&#039;t inject variables directly into the query or into conditions.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;attributedescriptions&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you bind the same value several times do NOT use the same parameter name, instead use a different named parameter for each bind:&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;sometable&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid and parent_sid= :sid &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RIGHT:&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;sometable&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid1 and parent_sid= :sid2 &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid1&amp;quot;, $surveyid, PDO::PARAM_INT)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid2&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous=&lt;br /&gt;
*Do not use &amp;quot;global&amp;quot; to access to a declared variable in another process. Pass variables or arrays by reference, use the session or the configuration object.&lt;br /&gt;
*If using an auxiliary variable makes clear the code or process, just do it. If you are coding a very complex expression, calling to functions with parameters that are other functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
iAResult= fa(fb(p1,p2),fc(fd(p3),p4),p5)&lt;br /&gt;
&lt;br /&gt;
It will be more readable:&lt;br /&gt;
&lt;br /&gt;
iAuxB = fb(p1,p2)&lt;br /&gt;
&lt;br /&gt;
iAuxD = fd(p3)&lt;br /&gt;
&lt;br /&gt;
iAuxC = fc(iAuxD,p4)&lt;br /&gt;
&lt;br /&gt;
iAResult = fa(iAuxB, iAuxC, p5)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Anyway, if you are in doubt about someone missing the point or you are afraid that your expression is obscure, take the chance of writing it in a more simple way, even if that involves the use of one or more auxiliary variables.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3134</id>
		<title>Coding guidelines</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Coding_guidelines&amp;diff=3134"/>
		<updated>2012-11-16T13:16:50Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:__TOC__&lt;br /&gt;
&lt;br /&gt;
=General=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a free development, everything you do can be useful for others. If the feature is very personal there is a way to turn it into a universal solution. This is the challenge!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;quot;The difficulty within a solution is to solve it in a simple way&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(Lance Burton, magician)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some general rules:&lt;br /&gt;
*Be efficient and save resources (memory and runtime). Things might work for a small survey but also try out your new feature with a survey that has 400 question, 5 languages and 20,000 responses (Yes, there are surveys like this out there).&lt;br /&gt;
*Keep a fluid dialog with the others coders, they have their own thoughts about what you are doing.&lt;br /&gt;
*Ask if you are in doubt.&lt;br /&gt;
&lt;br /&gt;
=Naming convention=&lt;br /&gt;
*Use the Hungarian Rule for variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[t]NameOfVariable&lt;br /&gt;
&lt;br /&gt;
 | &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;+&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
 |        +--&amp;gt; Descriptive name&lt;br /&gt;
&lt;br /&gt;
 +--&amp;gt; Datatype stored (for example start with &amp;quot;a&amp;quot; if it is an array)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
aQuestionAttributes: Array to store the questions attributes, Mixed values&lt;br /&gt;
&lt;br /&gt;
dSurveyEnds: Date when the survey ends&lt;br /&gt;
&lt;br /&gt;
sContditionsOutput: String used to create the JS for conditions&lt;br /&gt;
*In case a function is declared &#039;&#039;&#039;do not&#039;&#039;&#039; use the Hungarian rule for the function name, instead use &amp;quot;Lower CamelCase&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
function questionsRetrieve( $iQID, $iSurvey)&lt;br /&gt;
*What about files? Unless Yii requires it in some way always name your files in lowercase - this prevents problems on systems using case-aware filesystems&lt;br /&gt;
&lt;br /&gt;
=Documentation=&lt;br /&gt;
&lt;br /&gt;
Please refer to this introduction: [[How to document your source code]].&lt;br /&gt;
&lt;br /&gt;
=Structures=&lt;br /&gt;
*Indent using spaces instead of TAB, or be gentle to announce how many spaces are your TABs long. There is wide ranging debate about tabs vs. spaces, many people prefer using tabs, others prefer spaces, others are happy with a mix of tabs and spaces. Because LimeSurvey is developed collaboratively, we ask that you leave your preference and follow this standard.&lt;br /&gt;
*The opening curly brace must be below the structure opening:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if (condition)&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;
*Using one line for a simple condition is very &amp;quot;fashionable&amp;quot;, a taste of &amp;quot;hacker&amp;quot;, but it is not clear at all:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true} else {do false}&lt;br /&gt;
&lt;br /&gt;
 WRONG: if (condition) {do true}&lt;br /&gt;
&lt;br /&gt;
        else {do false}&lt;br /&gt;
&lt;br /&gt;
 RIGHT: if (condition)&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do true&lt;br /&gt;
&lt;br /&gt;
        } else&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
           do false&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
 RIGHT: swith $sSelector&lt;br /&gt;
&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
              case X:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case Y:&lt;br /&gt;
&lt;br /&gt;
                   ...&lt;br /&gt;
&lt;br /&gt;
              default:&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: It&amp;amp;acute;s true that sometimes the &amp;quot;WRONG&amp;quot; way can be useful, but if it makes the straight reading difficult, please use the &amp;quot;RIGHT&amp;quot; way instead. Be gentle with your fellow developers.&lt;br /&gt;
*SQL sentences must respect the same rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $sSQL = &amp;quot;SELECT field1, field2, field3 &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;WHERE condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;AND condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;OR condition &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        .&amp;quot;ORDER BY field1, field2&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*The same for HTML in views tags:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;td colspan=&#039;2&#039;&lt;br /&gt;
&lt;br /&gt;
     height=&#039;4&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Some Text&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=HTML=&lt;br /&gt;
*As you will notice, a very customized HTML element can take a lot of lines (very expensive if you paid each one (:wink:) ) to avoid that, use &#039;CSS classes&#039;. In general, use classes to aesthetic related stuff: color, borders, backgrounds, font faces, sizes, etc.&lt;br /&gt;
*Respect W3C standards, and try to use the HTML understandable for all browsers. If one of them has a special feature, think if this feature is so special to break down the HTML in other browsers.&lt;br /&gt;
*Do not use PHP short tags &amp;lt;? ?&amp;gt;. Always use full PHP tags &amp;lt;?php ?&amp;gt;&lt;br /&gt;
*Any rules of the mentioned before: about CSS, well closed HTML tags and JS respect XHTML standards. Give it a try!.&lt;br /&gt;
&lt;br /&gt;
=Localization=&lt;br /&gt;
&lt;br /&gt;
Currently we are using the gT(),eT(),ngT() and neT() functions of the limesurvey_lang object for translations.&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey is available in 60 languages it is very important that your original English string (which will be picked up automatically for translation by our translators) is done right from the start. Imagine if we have to correct only one string at a later time - then 60 strings become invalid across the project and need to be re-translated by the poor translator souls.&lt;br /&gt;
* gT() is the original translation function. It will return a translated version of the string in the currently selected language. ie: echo &#039;&#039;$clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* ngT() returns multiple translations of a sentence or phrase for which alternate plural forms may apply. ie: &#039;&#039;echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers)&#039;&#039;;&lt;br /&gt;
* eT() echos the translation directly. (ie: instead of &#039;&#039;echo $clang-&amp;gt;gT(&amp;quot;Hello&amp;quot;);&#039;&#039; you can use &#039;&#039;$clang-&amp;gt;eT(&amp;quot;Hello&amp;quot;);&#039;&#039;&lt;br /&gt;
* neT() echos the multiple translations of the sentence or phrase for which alternate plural forms may apply directly.&lt;br /&gt;
&lt;br /&gt;
Please follow these important rules:&lt;br /&gt;
*&#039;&#039;&#039;Do not embed margin spaces&#039;&#039;&#039; in your translation. Instead use proper CSS formatting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible? &#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Visible?&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not capitalize words&#039;&#039;&#039; except where grammatically correct (like at the beginning of a sentence or for a brand name). LimeSurvey is not a newspaper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create A New Label Set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Create a new label set&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API Key&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: $clang-&amp;gt;eT(&#039;Google Maps API key&#039;);&lt;br /&gt;
*&#039;&#039;&#039;Do not concatenate&#039;&#039;&#039; several translations to form a sentence or concatenate to an additional information (like a number or string). Instead use the sprint() or sprintf() function with placeholders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The sum must not be bigger than&#039;).$iMaxSum;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The sum must not be bigger than %s&#039;),$iMaxSum);&lt;br /&gt;
&lt;br /&gt;
This comes from the problem that in other languages the setting of a sentence can be much different and the information $iMaxSum from the example above might be needed in the middle of the sentence.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo $clang-&amp;gt;gT(&#039;The user&#039;).$sUsername.$clang-&amp;gt;gT(&#039;was deleted.&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;The user %s was deleted.&#039;),$sUsername);&lt;br /&gt;
*&#039;&#039;&#039;Use the n*T functions where applicable&#039;&#039;&#039;. These functions show a different translation depending the number of items. Currently LimeSurvey only supports the numbers/situations 1 and &amp;gt;1.&lt;br /&gt;
&lt;br /&gt;
+Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#F00&#039;&amp;gt;Wrong&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;gT(&#039;Please select at least %s answer(s).&#039;),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#060&#039;&amp;gt;Right&amp;lt;/span&amp;gt;: echo sprintf($clang-&amp;gt;ngT(&#039;Please select at least %s answer&#039;,&#039;Please select at least %s answers&#039;,iMinimumAnswers),$iMinimumAnswers);&lt;br /&gt;
&lt;br /&gt;
=Bug tracker=&lt;br /&gt;
#First consider if the reported issue is really a bug. If it is a feature request please point the reporter to http://ideas.limesurvey.org and set the issue status to &#039;Closed&#039;.&lt;br /&gt;
#If you would like to work on a bug assign it to yourself.&lt;br /&gt;
#Try to reproduce the issue.&lt;br /&gt;
##If you cannot reproduce ask the user to provide a small example survey to demonstrate the issue. Then set the issue to &#039;Feedback&#039;. After the user added the necessary information it will automatically be set to &#039;Assigned&#039; again.&lt;br /&gt;
##If the user does not responds for more than a week ask once again for feedback by adding a comment. After a further week without feedback close the issue.&lt;br /&gt;
#After you resolved the issue set the status to resolved AND provide the &#039;Fixed in version&#039; information.&lt;br /&gt;
#After you committed your fix add a comment to the resolved issue &#039;Fixed in rev. &amp;lt;Subversion revision number&amp;gt;&#039;&lt;br /&gt;
#After a release the release technician will set all issues to &#039;Closed&#039; that were fixed for this release. That signals to the reporter that a fix is available in the version and it was just released.&lt;br /&gt;
&lt;br /&gt;
=Cross-DB compatibility=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey targets several database types it can run on: MySQL, Postgres and Microsoft SQL Server. This demands certain precautions when coding&lt;br /&gt;
&lt;br /&gt;
==Parameter binding==&lt;br /&gt;
&lt;br /&gt;
Yii/PDO supports parameter binding. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;attributedescriptions&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you bind the same value several times do NOT use the same parameter name, instead use a different named parameter for each bind:&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;sometable&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid and parent_sid= :sid &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RIGHT:&lt;br /&gt;
&lt;br /&gt;
$oResult = Yii::app()-&amp;gt;db&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;createCommand()&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;select(&#039;sometable&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;where(&amp;quot;sid = :sid1 and parent_sid= :sid2 &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;from(&#039;{{surveys}}&#039;)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid1&amp;quot;, $surveyid, PDO::PARAM_INT)&lt;br /&gt;
&lt;br /&gt;
                    -&amp;gt;bindParam(&amp;quot;:sid2&amp;quot;, $surveyid, PDO::PARAM_INT);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Miscellaneous=&lt;br /&gt;
*Do not use &amp;quot;global&amp;quot; to access to a declared variable in another process. Pass variables or arrays by reference, use the session or the configuration object.&lt;br /&gt;
*If using an auxiliary variable makes clear the code or process, just do it. If you are coding a very complex expression, calling to functions with parameters that are other functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WRONG:&lt;br /&gt;
&lt;br /&gt;
iAResult= fa(fb(p1,p2),fc(fd(p3),p4),p5)&lt;br /&gt;
&lt;br /&gt;
It will be more readable:&lt;br /&gt;
&lt;br /&gt;
iAuxB = fb(p1,p2)&lt;br /&gt;
&lt;br /&gt;
iAuxD = fd(p3)&lt;br /&gt;
&lt;br /&gt;
iAuxC = fc(iAuxD,p4)&lt;br /&gt;
&lt;br /&gt;
iAResult = fa(iAuxB, iAuxC, p5)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Anyway, if you are in doubt about someone missing the point or you are afraid that your expression is obscure, take the chance of writing it in a more simple way, even if that involves the use of one or more auxiliary variables.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2164</id>
		<title>Manage users</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2164"/>
		<updated>2012-11-15T19:03:01Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= User management=&lt;br /&gt;
&lt;br /&gt;
==Create users==&lt;br /&gt;
&lt;br /&gt;
To create a new user open the user management (&#039;&#039;&#039;main menu&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Create/Edit users &#039;&#039;&#039; [[File:LimeSurveyBenuzerVerwaltung.jpg]]).&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddUser.jpg]]&lt;br /&gt;
* Enter the desired username into the textfield &#039;&#039;&#039;Username&#039;&#039;&#039;.&lt;br /&gt;
* Enter the email address into the textfield  &#039;&#039;&#039;Email&#039;&#039;&#039;. Please note&lt;br /&gt;
** If you don&#039;t want the user to recieve the confirmation email with a link to the LimeSurvey installation, username and password you can use your own email address to send the confirmation email to you. After that you can change the email address to the address of the user.&lt;br /&gt;
** LimeSurvey sends out a confirmation email to the address enterd into &#039;&#039;&#039;Email&#039;&#039;&#039;. This email address will be used as standard contact email address for surveys created by this user.&lt;br /&gt;
* Enter the users full name into the textfield &#039;&#039;&#039;Full name&#039;&#039;&#039; . Please note&lt;br /&gt;
** The full name entered here will be used as standard contact person name for surveys created by this user.&lt;br /&gt;
* Click &#039;&#039;&#039;Add user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So you created a new user. You will find out more about setting user permissions if you continue reading further.&lt;br /&gt;
&lt;br /&gt;
==Edit users==&lt;br /&gt;
&lt;br /&gt;
You can use the pen symbol [[File:LimeSurveyBleistiftSymbol.jpg]] to edit a user.&lt;br /&gt;
&lt;br /&gt;
You can set a new email address, full name and even change the password. If you have finished what you want to do click &#039;&#039;&#039;Save&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Delete users==&lt;br /&gt;
&lt;br /&gt;
To delete a user account simply click the delete button [[File:LimeSurveyBenutzerLoeschen.jpg]] in the line with the user account that should be deleted and hit &#039;&#039;&#039;OK&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=Global permissions=&lt;br /&gt;
&lt;br /&gt;
Global permissions apply to the whole LimeSurvey installation. If you want to set permissions only for a specific survey you can use the Survey permissions settings.&lt;br /&gt;
&lt;br /&gt;
==Setting global permissions for a user==&lt;br /&gt;
&lt;br /&gt;
To set global permissions for a user just click the key symbol [[File:LimeSurveySchluesselSymbol.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetGlobalPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now add or remove the following rights.&lt;br /&gt;
* &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;: This right can only be added or removed by the user called &#039;&#039;&#039;admin&#039;&#039;&#039; and grants full rights to the whole LimeSurvey installation. &#039;&#039;&#039;Please note:&#039;&#039;&#039; This right is very powerful and you should be very carfefully with granting this right.&lt;br /&gt;
* &#039;&#039;&#039;Create survey&#039;&#039;&#039;: This right lets the user create a survey as well as start, stop and it . This is the standard permission for people creating their own surveys.&lt;br /&gt;
* &#039;&#039;&#039;Configurator&#039;&#039;&#039;: With this right a user can check data integrity, save the SQL database to an sql file and view the php info in the global settings.&lt;br /&gt;
* &#039;&#039;&#039;Create user&#039;&#039;&#039;: Having this right a user can create new users and delete users created with this account. The newly created users cannot have higher permissions than the parent. If this has to be done a &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has to grant the rights.&lt;br /&gt;
* &#039;&#039;&#039;Use all/manage templates&#039;&#039;&#039;: It allows the user to use all design templates and edit all non standard templates. A person with this right should have sufficient knowledge in terms of  HTML/php, Javascript and CSS. If a user not familar with this things should use a specific design template it would be better to use the template permissions.&lt;br /&gt;
* &#039;&#039;&#039;Manage labels&#039;&#039;&#039;: This right grants all rights regarding label sets (create, edit and delete).&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
==Setting template permissions for a user==&lt;br /&gt;
&lt;br /&gt;
With template permissions you can set which design templates a user can select when creating or editing a survey. It might be a good idea to restrict the design templates a user can select in order to prevent unwanted use of design templates not suitable for a user/survey.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; If you have a specific design template for a group of users or customers you might want to restrict the access for them to use only the template created for their purpose.&lt;br /&gt;
&lt;br /&gt;
To set/edit the template permissions for a user simply click the key symbol for design templates [[File:LimeSurveySchluesselSymbolTemplates.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetDesignTemplatesLS.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now select the design templates this user can select. After you finished your selection/deselection just hit &#039;&#039;&#039;Save settings&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Setting permissions for a single survey=&lt;br /&gt;
&lt;br /&gt;
These permissions only apply for a single survey. If you want to set permissions for the whole system you can use the global permissions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; An existing user account is required to set permissions for a single survey. If the account doesn&#039;t exist you have to create it first and then change the survey permissions. You don&#039;t have to apply any global rights to the user, it is just necessary that the user account itself exists.&lt;br /&gt;
&lt;br /&gt;
==Setting user permissions for a single survey==&lt;br /&gt;
&lt;br /&gt;
To change the survey permissions you have to select &#039;&#039;&#039;Survey permissions&#039;&#039;&#039; from the &#039;&#039;&#039;Survey properties&#039;&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySurveyPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the next step you select the user you want to change the survey rights and click &#039;&#039;&#039;Add user&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddSurveyPermission.jpg]]&lt;br /&gt;
&lt;br /&gt;
After you click &#039;&#039;&#039;Set survey permissions&#039;&#039;&#039; the survey permissions matrix for the survey and user will be shown.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyUserPermissionMatrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
In this matrix you can set the rights for the different features and parts. You simply click  a checkbox if you want to add or remove this right. If you click a checkbox in the first column all rights for this line will be selected/removed.&lt;br /&gt;
&lt;br /&gt;
In the other columns you can choose whether a user can do a single actions from this feature/part.&lt;br /&gt;
&lt;br /&gt;
After you finished editing the survey permissions click &#039;&#039;&#039;Save now&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Use cases=&lt;br /&gt;
&lt;br /&gt;
In this part of the article we&#039;ll provide a few ideas which use cases may exist and how and which rights would be a good choice.&lt;br /&gt;
&lt;br /&gt;
==A new person in charge for administrating LimeSurvey will be added==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039;&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;&lt;br /&gt;
* not necessary: Setting the template permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all templates)&lt;br /&gt;
* not necessary: Setting the survey permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all surveys)&lt;br /&gt;
&lt;br /&gt;
==A new user wants to create own surveys==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;Create survey&#039;&#039;&#039;&lt;br /&gt;
* Set template permissions for user to the template/s that should be used by the user/user-group&lt;br /&gt;
* not necessary: Setting the survey permissions (The creator of a survey has all permissions for his/her surveys)&lt;br /&gt;
&lt;br /&gt;
==The creator of a survey needs another person to edit his/her survey==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set the survey permissions the way you want. It depends on what the new user should do and how much permissions he/she needs. If he/she should have all permissions for the survey you can select the first checkboxes in the first column with checkboxes (the one with the &#039;&#039;&#039;&amp;lt;&amp;lt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039; button as header).&lt;br /&gt;
&lt;br /&gt;
==A person responsible for the survey wants to see the results of the survey and export them==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set survey permissions to: &#039;&#039;&#039;Responses&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039; and &#039;&#039;&#039;export&#039;&#039;&#039; , &#039;&#039;&#039;Statistics&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyCusomerOwnStatistics.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To be moved somewhere else once better defined:&lt;br /&gt;
&lt;br /&gt;
There are several classes of possible people who access a LimeSurvey installation.  But only one set of people is actually termed a &#039;&#039;&#039;user&#039;&#039;&#039; in the code and documentation.  So lets understand what these classes of people are so we can better understand the terminology of the program.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Class||Description&lt;br /&gt;
|-&lt;br /&gt;
|Installation Administrator || Those people who create login user accounts to allow others to create, edit, activate and/or view surveys and their results.  Often can be given access to edit the templates, labelsets and other key features independent of any particular survey stored.&lt;br /&gt;
|-&lt;br /&gt;
|Survey Administrator || A person with a login account that is given some management access to a particular survey.  Each survey can have its own set of users with specific rights to manipulate the survey.  These rights can be as broad as to activate a survey and possibly edit its question base.  They can be as minimum as simply able to review the results to date.&lt;br /&gt;
|-&lt;br /&gt;
|Participant || Those people who simply respond or participate in taking a survey.  They may or may not have token access.  They do not need a login account to the administrative interface and thus are not termed users.&lt;br /&gt;
|-&lt;br /&gt;
|Installer || A special class of person who has access to the MySQL (or similar) database server and possibly the command line interface of the computers operating system in order to install and configure the survey software.  This person is asked to setup the initial SuperAdmin user account from which other user login accounts can be created.&lt;br /&gt;
|-&lt;br /&gt;
|Developer || An very special class of person who has access to the source code and can manipulate it to change the programs behavior.  Generally only done with versions of the survey that are not available for live, active surveys. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Use one-time passwords=&lt;br /&gt;
&lt;br /&gt;
Since version 1.81 a user can call the limesurvey login at /limesurvey/admin and pass username and a one time password which was previously written into the users table (column one_time_pw) by an external application.&lt;br /&gt;
&lt;br /&gt;
To enable this login method [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Use_one_time_passwords a setting has to be turned on] ($use_one_time_passwords = true;) in config.php.&lt;br /&gt;
&lt;br /&gt;
The URL has to contain the following variables:&lt;br /&gt;
* &#039;&#039;&#039;user:&#039;&#039;&#039; The username normally used to login into Limesurvey. This username has to exist in the &#039;users&#039; table of the database.&lt;br /&gt;
* &#039;&#039;&#039;onepass:&#039;&#039;&#039; The plain text password which is then compared to the password in the &#039;users&#039; table&lt;br /&gt;
&lt;br /&gt;
A valid URL to login using a one-time password will look like this...&lt;br /&gt;
&lt;br /&gt;
... for 1.81 to 1.92:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/admin/admin.php?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...for 2.0 or later:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/index.php/admin/authentication/login?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Things to watch out for:&#039;&#039;&#039;&lt;br /&gt;
* One time passwords have to be enabled by setting use_one_time_passwords = true; in config.php&lt;br /&gt;
* The passed username has to exist in Limesurvey&#039;s &#039;&#039;users&#039;&#039; table&lt;br /&gt;
* The one time password, which can be set by an external application, has to be stored as [http://de.php.net/md5 MD5 hash] in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;&lt;br /&gt;
* The passed plain text password will be hashed using md5() function and will then be compared to the stored hash in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;. Both passwords have to match.&lt;br /&gt;
* After the first login with the one time password this password is deleted from the database. The user won&#039;t be able to login with this password anymore.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2165</id>
		<title>Manage users</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2165"/>
		<updated>2012-11-15T19:02:27Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= User management=&lt;br /&gt;
&lt;br /&gt;
==Create users==&lt;br /&gt;
&lt;br /&gt;
To create a new user open the user management (&#039;&#039;&#039;main menu&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Create/Edit users &#039;&#039;&#039; [[File:LimeSurveyBenuzerVerwaltung.jpg]]).&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddUser.jpg]]&lt;br /&gt;
* Enter the desired username into the textfield &#039;&#039;&#039;Username&#039;&#039;&#039;.&lt;br /&gt;
* Enter the email address into the textfield  &#039;&#039;&#039;Email&#039;&#039;&#039;. Please note&lt;br /&gt;
** If you don&#039;t want the user to recieve the confirmation email with a link to the LimeSurvey installation, username and password you can use your own email address to send the confirmation email to you. After that you can change the email address to the address of the user.&lt;br /&gt;
** LimeSurvey sends out a confirmation email to the address enterd into &#039;&#039;&#039;Email&#039;&#039;&#039;. This email address will be used as standard contact email address for surveys created by this user.&lt;br /&gt;
* Enter the users full name into the textfield &#039;&#039;&#039;Full name&#039;&#039;&#039; . Please note&lt;br /&gt;
** The full name entered here will be used as standard contact person name for surveys created by this user.&lt;br /&gt;
* Click &#039;&#039;&#039;Add user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So you created a new user. You will find out more about setting user permissions if you continue reading further.&lt;br /&gt;
&lt;br /&gt;
==Edit users==&lt;br /&gt;
&lt;br /&gt;
You can use the pen symbol [[File:LimeSurveyBleistiftSymbol.jpg]] to edit a user.&lt;br /&gt;
&lt;br /&gt;
You can set a new email address, full name and even change the password. If you have finished what you want to do click &#039;&#039;&#039;Save&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Delete users==&lt;br /&gt;
&lt;br /&gt;
To delete a user account simply click the delete button [[File:LimeSurveyBenutzerLoeschen.jpg]] in the line with the user account that should be deleted and hit &#039;&#039;&#039;OK&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=Global permissions=&lt;br /&gt;
&lt;br /&gt;
Global permissions apply to the whole LimeSurvey installation. If you want to set permissions only for a specific survey you can use the Survey permissions settings.&lt;br /&gt;
&lt;br /&gt;
==Setting global permissions for a user==&lt;br /&gt;
&lt;br /&gt;
To set global permissions for a user just click the key symbol [[File:LimeSurveySchluesselSymbol.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetGlobalPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now add or remove the following rights.&lt;br /&gt;
* &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;: This right can only be added or removed by the user called &#039;&#039;&#039;admin&#039;&#039;&#039; and grants full rights to the whole LimeSurvey installation. &#039;&#039;&#039;Please note:&#039;&#039;&#039; This right is very powerful and you should be very carfefully with granting this right.&lt;br /&gt;
* &#039;&#039;&#039;Create survey&#039;&#039;&#039;: This right lets the user create a survey as well as start, stop and it . This is the standard permission for people creating their own surveys.&lt;br /&gt;
* &#039;&#039;&#039;Configurator&#039;&#039;&#039;: With this right a user can check data integrity, save the SQL database to an sql file and view the php info in the global settings.&lt;br /&gt;
* &#039;&#039;&#039;Create user&#039;&#039;&#039;: Having this right a user can create new users and delete users created with this account. The newly created users cannot have higher permissions than the parent. If this has to be done a &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has to grant the rights.&lt;br /&gt;
* &#039;&#039;&#039;Use all/manage templates&#039;&#039;&#039;: It allows the user to use all design templates and edit all non standard templates. A person with this right should have sufficient knowledge in terms of  HTML/php, Javascript and CSS. If a user not familar with this things should use a specific design template it would be better to use the template permissions.&lt;br /&gt;
* &#039;&#039;&#039;Manage labels&#039;&#039;&#039;: This right grants all rights regarding label sets (create, edit and delete).&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
==Setting template permissions for a user==&lt;br /&gt;
&lt;br /&gt;
With template permissions you can set which design templates a user can select when creating or editing a survey. It might be a good idea to restrict the design templates a user can select in order to prevent unwanted use of design templates not suitable for a user/survey.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; If you have a specific design template for a group of users or customers you might want to restrict the access for them to use only the template created for their purpose.&lt;br /&gt;
&lt;br /&gt;
To set/edit the template permissions for a user simply click the key symbol for design templates [[File:LimeSurveySchluesselSymbolTemplates.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetDesignTemplatesLS.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now select the design templates this user can select. After you finished your selection/deselection just hit &#039;&#039;&#039;Save settings&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Setting permissions for a single survey=&lt;br /&gt;
&lt;br /&gt;
These permissions only apply for a single survey. If you want to set permissions for the whole system you can use the global permissions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; An existing user account is required to set permissions for a single survey. If the account doesn&#039;t exist you have to create it first and then change the survey permissions. You don&#039;t have to apply any global rights to the user, it is just necessary that the user account itself exists.&lt;br /&gt;
&lt;br /&gt;
==Setting user permissions for a single survey==&lt;br /&gt;
&lt;br /&gt;
To change the survey permissions you have to select &#039;&#039;&#039;Survey permissions&#039;&#039;&#039; from the &#039;&#039;&#039;Survey properties&#039;&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySurveyPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the next step you select the user you want to change the survey rights and click &#039;&#039;&#039;Add user&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddSurveyPermission.jpg]]&lt;br /&gt;
&lt;br /&gt;
After you click &#039;&#039;&#039;Set survey permissions&#039;&#039;&#039; the survey permissions matrix for the survey and user will be shown.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyUserPermissionMatrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
In this matrix you can set the rights for the different features and parts. You simply click  a checkbox if you want to add or remove this right. If you click a checkbox in the first column all rights for this line will be selected/removed.&lt;br /&gt;
&lt;br /&gt;
In the other columns you can choose whether a user can do a single actions from this feature/part.&lt;br /&gt;
&lt;br /&gt;
After you finished editing the survey permissions click &#039;&#039;&#039;Save now&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Use cases=&lt;br /&gt;
&lt;br /&gt;
In this part of the article we&#039;ll provide a few ideas which use cases may exist and how and which rights would be a good choice.&lt;br /&gt;
&lt;br /&gt;
==A new person in charge for administrating LimeSurvey will be added==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039;&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;&lt;br /&gt;
* not necessary: Setting the template permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all templates)&lt;br /&gt;
* not necessary: Setting the survey permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all surveys)&lt;br /&gt;
&lt;br /&gt;
==A new user wants to create own surveys==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;Create survey&#039;&#039;&#039;&lt;br /&gt;
* Set template permissions for user to the template/s that should be used by the user/user-group&lt;br /&gt;
* not necessary: Setting the survey permissions (The creator of a survey has all permissions for his/her surveys)&lt;br /&gt;
&lt;br /&gt;
==The creator of a survey needs another person to edit his/her survey==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set the survey permissions the way you want. It depends on what the new user should do and how much permissions he/she needs. If he/she should have all permissions for the survey you can select the first checkboxes in the first column with checkboxes (the one with the &#039;&#039;&#039;&amp;lt;&amp;lt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039; button as header).&lt;br /&gt;
&lt;br /&gt;
==A person responsible for the survey wants to see the results of the survey and export them==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set survey permissions to: &#039;&#039;&#039;Responses&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039; and &#039;&#039;&#039;export&#039;&#039;&#039; , &#039;&#039;&#039;Statistics&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyCusomerOwnStatistics.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To be moved somewhere else once better defined:&lt;br /&gt;
&lt;br /&gt;
There are several classes of possible people who access a LimeSurvey installation.  But only one set of people is actually termed a &#039;&#039;&#039;user&#039;&#039;&#039; in the code and documentation.  So lets understand what these classes of people are so we can better understand the terminology of the program.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Class||Description&lt;br /&gt;
|-&lt;br /&gt;
|Installation Administrator || Those people who create login user accounts to allow others to create, edit, activate and/or view surveys and their results.  Often can be given access to edit the templates, labelsets and other key features independent of any particular survey stored.&lt;br /&gt;
|-&lt;br /&gt;
|Survey Administrator || A person with a login account that is given some management access to a particular survey.  Each survey can have its own set of users with specific rights to manipulate the survey.  These rights can be as broad as to activate a survey and possibly edit its question base.  They can be as minimum as simply able to review the results to date.&lt;br /&gt;
|-&lt;br /&gt;
|Participant || Those people who simply respond or participate in taking a survey.  They may or may not have token access.  They do not need a login account to the administrative interface and thus are not termed users.&lt;br /&gt;
|-&lt;br /&gt;
|Installer || A special class of person who has access to the MySQL (or similar) database server and possibly the command line interface of the computers operating system in order to install and configure the survey software.  This person is asked to setup the initial SuperAdmin user account from which other user login accounts can be created.&lt;br /&gt;
|-&lt;br /&gt;
|Developer || An very special class of person who has access to the source code and can manipulate it to change the programs behavior.  Generally only done with versions of the survey that are not available for live, active surveys. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Use one time passwords=&lt;br /&gt;
&lt;br /&gt;
Since version 1.81 a user can call the limesurvey login at /limesurvey/admin and pass username and a one time password which was previously written into the users table (column one_time_pw) by an external application.&lt;br /&gt;
&lt;br /&gt;
To enable this login method [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Use_one_time_passwords a setting has to be turned on] ($use_one_time_passwords = true;) in config.php.&lt;br /&gt;
&lt;br /&gt;
The URL has to contain the following variables:&lt;br /&gt;
* &#039;&#039;&#039;user:&#039;&#039;&#039; The username normally used to login into Limesurvey. This username has to exist in the &#039;users&#039; table of the database.&lt;br /&gt;
* &#039;&#039;&#039;onepass:&#039;&#039;&#039; The plain text password which is then compared to the password in the &#039;users&#039; table&lt;br /&gt;
&lt;br /&gt;
A valid URL to login using a one-time password will look like this...&lt;br /&gt;
&lt;br /&gt;
... for 1.81 to 1.92:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/admin/admin.php?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...for 2.0 or later:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/index.php/admin/authentication/login?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Things to watch out for:&#039;&#039;&#039;&lt;br /&gt;
* One time passwords have to be enabled by setting use_one_time_passwords = true; in config.php&lt;br /&gt;
* The passed username has to exist in Limesurvey&#039;s &#039;&#039;users&#039;&#039; table&lt;br /&gt;
* The one time password, which can be set by an external application, has to be stored as [http://de.php.net/md5 MD5 hash] in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;&lt;br /&gt;
* The passed plain text password will be hashed using md5() function and will then be compared to the stored hash in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;. Both passwords have to match.&lt;br /&gt;
* After the first login with the one time password this password is deleted from the database. The user won&#039;t be able to login with this password anymore.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2166</id>
		<title>Manage users</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2166"/>
		<updated>2012-11-15T18:59:18Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= User management=&lt;br /&gt;
&lt;br /&gt;
==Create users==&lt;br /&gt;
&lt;br /&gt;
To create a new user open the user management (&#039;&#039;&#039;main menu&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Create/Edit users &#039;&#039;&#039; [[File:LimeSurveyBenuzerVerwaltung.jpg]]).&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddUser.jpg]]&lt;br /&gt;
* Enter the desired username into the textfield &#039;&#039;&#039;Username&#039;&#039;&#039;.&lt;br /&gt;
* Enter the email address into the textfield  &#039;&#039;&#039;Email&#039;&#039;&#039;. Please note&lt;br /&gt;
** If you don&#039;t want the user to recieve the confirmation email with a link to the LimeSurvey installation, username and password you can use your own email address to send the confirmation email to you. After that you can change the email address to the address of the user.&lt;br /&gt;
** LimeSurvey sends out a confirmation email to the address enterd into &#039;&#039;&#039;Email&#039;&#039;&#039;. This email address will be used as standard contact email address for surveys created by this user.&lt;br /&gt;
* Enter the users full name into the textfield &#039;&#039;&#039;Full name&#039;&#039;&#039; . Please note&lt;br /&gt;
** The full name entered here will be used as standard contact person name for surveys created by this user.&lt;br /&gt;
* Click &#039;&#039;&#039;Add user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So you created a new user. You will find out more about setting user permissions if you continue reading further.&lt;br /&gt;
&lt;br /&gt;
==Edit users==&lt;br /&gt;
&lt;br /&gt;
You can use the pen symbol [[File:LimeSurveyBleistiftSymbol.jpg]] to edit a user.&lt;br /&gt;
&lt;br /&gt;
You can set a new email address, full name and even change the password. If you have finished what you want to do click &#039;&#039;&#039;Save&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Delete users==&lt;br /&gt;
&lt;br /&gt;
To delete a user account simply click the delete button [[File:LimeSurveyBenutzerLoeschen.jpg]] in the line with the user account that should be deleted and hit &#039;&#039;&#039;OK&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=Global permissions=&lt;br /&gt;
&lt;br /&gt;
Global permissions apply to the whole LimeSurvey installation. If you want to set permissions only for a specific survey you can use the Survey permissions settings.&lt;br /&gt;
&lt;br /&gt;
==Setting global permissions for a user==&lt;br /&gt;
&lt;br /&gt;
To set global permissions for a user just click the key symbol [[File:LimeSurveySchluesselSymbol.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetGlobalPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now add or remove the following rights.&lt;br /&gt;
* &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;: This right can only be added or removed by the user called &#039;&#039;&#039;admin&#039;&#039;&#039; and grants full rights to the whole LimeSurvey installation. &#039;&#039;&#039;Please note:&#039;&#039;&#039; This right is very powerful and you should be very carfefully with granting this right.&lt;br /&gt;
* &#039;&#039;&#039;Create survey&#039;&#039;&#039;: This right lets the user create a survey as well as start, stop and it . This is the standard permission for people creating their own surveys.&lt;br /&gt;
* &#039;&#039;&#039;Configurator&#039;&#039;&#039;: With this right a user can check data integrity, save the SQL database to an sql file and view the php info in the global settings.&lt;br /&gt;
* &#039;&#039;&#039;Create user&#039;&#039;&#039;: Having this right a user can create new users and delete users created with this account. The newly created users cannot have higher permissions than the parent. If this has to be done a &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has to grant the rights.&lt;br /&gt;
* &#039;&#039;&#039;Use all/manage templates&#039;&#039;&#039;: It allows the user to use all design templates and edit all non standard templates. A person with this right should have sufficient knowledge in terms of  HTML/php, Javascript and CSS. If a user not familar with this things should use a specific design template it would be better to use the template permissions.&lt;br /&gt;
* &#039;&#039;&#039;Manage labels&#039;&#039;&#039;: This right grants all rights regarding label sets (create, edit and delete).&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
==Setting template permissions for a user==&lt;br /&gt;
&lt;br /&gt;
With template permissions you can set which design templates a user can select when creating or editing a survey. It might be a good idea to restrict the design templates a user can select in order to prevent unwanted use of design templates not suitable for a user/survey.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; If you have a specific design template for a group of users or customers you might want to restrict the access for them to use only the template created for their purpose.&lt;br /&gt;
&lt;br /&gt;
To set/edit the template permissions for a user simply click the key symbol for design templates [[File:LimeSurveySchluesselSymbolTemplates.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetDesignTemplatesLS.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now select the design templates this user can select. After you finished your selection/deselection just hit &#039;&#039;&#039;Save settings&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Setting permissions for a single survey=&lt;br /&gt;
&lt;br /&gt;
These permissions only apply for a single survey. If you want to set permissions for the whole system you can use the global permissions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; An existing user account is required to set permissions for a single survey. If the account doesn&#039;t exist you have to create it first and then change the survey permissions. You don&#039;t have to apply any global rights to the user, it is just necessary that the user account itself exists.&lt;br /&gt;
&lt;br /&gt;
==Setting user permissions for a single survey==&lt;br /&gt;
&lt;br /&gt;
To change the survey permissions you have to select &#039;&#039;&#039;Survey permissions&#039;&#039;&#039; from the &#039;&#039;&#039;Survey properties&#039;&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySurveyPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the next step you select the user you want to change the survey rights and click &#039;&#039;&#039;Add user&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddSurveyPermission.jpg]]&lt;br /&gt;
&lt;br /&gt;
After you click &#039;&#039;&#039;Set survey permissions&#039;&#039;&#039; the survey permissions matrix for the survey and user will be shown.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyUserPermissionMatrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
In this matrix you can set the rights for the different features and parts. You simply click  a checkbox if you want to add or remove this right. If you click a checkbox in the first column all rights for this line will be selected/removed.&lt;br /&gt;
&lt;br /&gt;
In the other columns you can choose whether a user can do a single actions from this feature/part.&lt;br /&gt;
&lt;br /&gt;
After you finished editing the survey permissions click &#039;&#039;&#039;Save now&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Use cases=&lt;br /&gt;
&lt;br /&gt;
In this part of the article we&#039;ll provide a few ideas which use cases may exist and how and which rights would be a good choice.&lt;br /&gt;
&lt;br /&gt;
==A new person in charge for administrating LimeSurvey will be added==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039;&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;&lt;br /&gt;
* not necessary: Setting the template permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all templates)&lt;br /&gt;
* not necessary: Setting the survey permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all surveys)&lt;br /&gt;
&lt;br /&gt;
==A new user wants to create own surveys==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;Create survey&#039;&#039;&#039;&lt;br /&gt;
* Set template permissions for user to the template/s that should be used by the user/user-group&lt;br /&gt;
* not necessary: Setting the survey permissions (The creator of a survey has all permissions for his/her surveys)&lt;br /&gt;
&lt;br /&gt;
==The creator of a survey needs another person to edit his/her survey==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set the survey permissions the way you want. It depends on what the new user should do and how much permissions he/she needs. If he/she should have all permissions for the survey you can select the first checkboxes in the first column with checkboxes (the one with the &#039;&#039;&#039;&amp;lt;&amp;lt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039; button as header).&lt;br /&gt;
&lt;br /&gt;
==A person responsible for the survey wants to see the results of the survey and export them==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set survey permissions to: &#039;&#039;&#039;Responses&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039; and &#039;&#039;&#039;export&#039;&#039;&#039; , &#039;&#039;&#039;Statistics&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyCusomerOwnStatistics.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To be moved somewhere else once better defined:&lt;br /&gt;
&lt;br /&gt;
There are several classes of possible people who access a LimeSurvey installation.  But only one set of people is actually termed a &#039;&#039;&#039;user&#039;&#039;&#039; in the code and documentation.  So lets understand what these classes of people are so we can better understand the terminology of the program.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Class||Description&lt;br /&gt;
|-&lt;br /&gt;
|Installation Administrator || Those people who create login user accounts to allow others to create, edit, activate and/or view surveys and their results.  Often can be given access to edit the templates, labelsets and other key features independent of any particular survey stored.&lt;br /&gt;
|-&lt;br /&gt;
|Survey Administrator || A person with a login account that is given some management access to a particular survey.  Each survey can have its own set of users with specific rights to manipulate the survey.  These rights can be as broad as to activate a survey and possibly edit its question base.  They can be as minimum as simply able to review the results to date.&lt;br /&gt;
|-&lt;br /&gt;
|Participant || Those people who simply respond or participate in taking a survey.  They may or may not have token access.  They do not need a login account to the administrative interface and thus are not termed users.&lt;br /&gt;
|-&lt;br /&gt;
|Installer || A special class of person who has access to the MySQL (or similar) database server and possibly the command line interface of the computers operating system in order to install and configure the survey software.  This person is asked to setup the initial SuperAdmin user account from which other user login accounts can be created.&lt;br /&gt;
|-&lt;br /&gt;
|Developer || An very special class of person who has access to the source code and can manipulate it to change the programs behavior.  Generally only done with versions of the survey that are not available for live, active surveys. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Use one time passwords=&lt;br /&gt;
&lt;br /&gt;
Since version 1.81 a user can call the limesurvey login at /limesurvey/admin and pass username and a one time password which was previously written into the users table (column one_time_pw) by an external application.&lt;br /&gt;
&lt;br /&gt;
To enable this login method [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Use_one_time_passwords a setting has to be turned on] ($use_one_time_passwords = true;) in config.php.&lt;br /&gt;
&lt;br /&gt;
The URL has to contain the following variables:&lt;br /&gt;
* &#039;&#039;&#039;user:&#039;&#039;&#039; The username normally used to login into Limesurvey. This username has to exist in the &#039;users&#039; table of the database.&lt;br /&gt;
* &#039;&#039;&#039;onepass:&#039;&#039;&#039; The plain text password which is then compared to the password in the &#039;users&#039; table&lt;br /&gt;
&lt;br /&gt;
A valid URL to login using a one-time password will look like this...&lt;br /&gt;
&lt;br /&gt;
... for 1.81 to 1.92:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/admin/admin.php?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...for 2.0 or later:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/index.php/admin/authentication/login?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Things to watch out for:&#039;&#039;&#039;&lt;br /&gt;
* One time passwords have to be enabled by setting $use_one_time_passwords = true; in config.php&lt;br /&gt;
* The passed username has to exist in Limesurvey&#039;s &#039;&#039;users&#039;&#039; table&lt;br /&gt;
* The one time password, which can be set by an external application, has to be stored as [http://de.php.net/md5 MD5 hash] in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;&lt;br /&gt;
* The passed plain text password will be hashed using md5() function and will then be compared to the stored hash in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;. Both passwords have to match.&lt;br /&gt;
* After the first login with the one time password this password is deleted from the database. The user won&#039;t be able to login with this password anymore. If you are confronted with session timeout problems [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Survey_Behavior raise the setting for $sessionlifetime] (default is 3600 seconds).&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2167</id>
		<title>Manage users</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2167"/>
		<updated>2012-11-15T18:58:05Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= User management=&lt;br /&gt;
&lt;br /&gt;
==Create users==&lt;br /&gt;
&lt;br /&gt;
To create a new user open the user management (&#039;&#039;&#039;main menu&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Create/Edit users &#039;&#039;&#039; [[File:LimeSurveyBenuzerVerwaltung.jpg]]).&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddUser.jpg]]&lt;br /&gt;
* Enter the desired username into the textfield &#039;&#039;&#039;Username&#039;&#039;&#039;.&lt;br /&gt;
* Enter the email address into the textfield  &#039;&#039;&#039;Email&#039;&#039;&#039;. Please note&lt;br /&gt;
** If you don&#039;t want the user to recieve the confirmation email with a link to the LimeSurvey installation, username and password you can use your own email address to send the confirmation email to you. After that you can change the email address to the address of the user.&lt;br /&gt;
** LimeSurvey sends out a confirmation email to the address enterd into &#039;&#039;&#039;Email&#039;&#039;&#039;. This email address will be used as standard contact email address for surveys created by this user.&lt;br /&gt;
* Enter the users full name into the textfield &#039;&#039;&#039;Full name&#039;&#039;&#039; . Please note&lt;br /&gt;
** The full name entered here will be used as standard contact person name for surveys created by this user.&lt;br /&gt;
* Click &#039;&#039;&#039;Add user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So you created a new user. You will find out more about setting user permissions if you continue reading further.&lt;br /&gt;
&lt;br /&gt;
==Edit users==&lt;br /&gt;
&lt;br /&gt;
You can use the pen symbol [[File:LimeSurveyBleistiftSymbol.jpg]] to edit a user.&lt;br /&gt;
&lt;br /&gt;
You can set a new email address, full name and even change the password. If you have finished what you want to do click &#039;&#039;&#039;Save&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Delete users==&lt;br /&gt;
&lt;br /&gt;
To delete a user account simply click the delete button [[File:LimeSurveyBenutzerLoeschen.jpg]] in the line with the user account that should be deleted and hit &#039;&#039;&#039;OK&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=Global permissions=&lt;br /&gt;
&lt;br /&gt;
Global permissions apply to the whole LimeSurvey installation. If you want to set permissions only for a specific survey you can use the Survey permissions settings.&lt;br /&gt;
&lt;br /&gt;
==Setting global permissions for a user==&lt;br /&gt;
&lt;br /&gt;
To set global permissions for a user just click the key symbol [[File:LimeSurveySchluesselSymbol.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetGlobalPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now add or remove the following rights.&lt;br /&gt;
* &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;: This right can only be added or removed by the user called &#039;&#039;&#039;admin&#039;&#039;&#039; and grants full rights to the whole LimeSurvey installation. &#039;&#039;&#039;Please note:&#039;&#039;&#039; This right is very powerful and you should be very carfefully with granting this right.&lt;br /&gt;
* &#039;&#039;&#039;Create survey&#039;&#039;&#039;: This right lets the user create a survey as well as start, stop and it . This is the standard permission for people creating their own surveys.&lt;br /&gt;
* &#039;&#039;&#039;Configurator&#039;&#039;&#039;: With this right a user can check data integrity, save the SQL database to an sql file and view the php info in the global settings.&lt;br /&gt;
* &#039;&#039;&#039;Create user&#039;&#039;&#039;: Having this right a user can create new users and delete users created with this account. The newly created users cannot have higher permissions than the parent. If this has to be done a &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has to grant the rights.&lt;br /&gt;
* &#039;&#039;&#039;Use all/manage templates&#039;&#039;&#039;: It allows the user to use all design templates and edit all non standard templates. A person with this right should have sufficient knowledge in terms of  HTML/php, Javascript and CSS. If a user not familar with this things should use a specific design template it would be better to use the template permissions.&lt;br /&gt;
* &#039;&#039;&#039;Manage labels&#039;&#039;&#039;: This right grants all rights regarding label sets (create, edit and delete).&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
==Setting template permissions for a user==&lt;br /&gt;
&lt;br /&gt;
With template permissions you can set which design templates a user can select when creating or editing a survey. It might be a good idea to restrict the design templates a user can select in order to prevent unwanted use of design templates not suitable for a user/survey.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; If you have a specific design template for a group of users or customers you might want to restrict the access for them to use only the template created for their purpose.&lt;br /&gt;
&lt;br /&gt;
To set/edit the template permissions for a user simply click the key symbol for design templates [[File:LimeSurveySchluesselSymbolTemplates.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetDesignTemplatesLS.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now select the design templates this user can select. After you finished your selection/deselection just hit &#039;&#039;&#039;Save settings&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Setting permissions for a single survey=&lt;br /&gt;
&lt;br /&gt;
These permissions only apply for a single survey. If you want to set permissions for the whole system you can use the global permissions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; An existing user account is required to set permissions for a single survey. If the account doesn&#039;t exist you have to create it first and then change the survey permissions. You don&#039;t have to apply any global rights to the user, it is just necessary that the user account itself exists.&lt;br /&gt;
&lt;br /&gt;
==Setting user permissions for a single survey==&lt;br /&gt;
&lt;br /&gt;
To change the survey permissions you have to select &#039;&#039;&#039;Survey permissions&#039;&#039;&#039; from the &#039;&#039;&#039;Survey properties&#039;&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySurveyPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the next step you select the user you want to change the survey rights and click &#039;&#039;&#039;Add user&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddSurveyPermission.jpg]]&lt;br /&gt;
&lt;br /&gt;
After you click &#039;&#039;&#039;Set survey permissions&#039;&#039;&#039; the survey permissions matrix for the survey and user will be shown.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyUserPermissionMatrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
In this matrix you can set the rights for the different features and parts. You simply click  a checkbox if you want to add or remove this right. If you click a checkbox in the first column all rights for this line will be selected/removed.&lt;br /&gt;
&lt;br /&gt;
In the other columns you can choose whether a user can do a single actions from this feature/part.&lt;br /&gt;
&lt;br /&gt;
After you finished editing the survey permissions click &#039;&#039;&#039;Save now&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Use cases=&lt;br /&gt;
&lt;br /&gt;
In this part of the article we&#039;ll provide a few ideas which use cases may exist and how and which rights would be a good choice.&lt;br /&gt;
&lt;br /&gt;
==A new person in charge for administrating LimeSurvey will be added==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039;&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;&lt;br /&gt;
* not necessary: Setting the template permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all templates)&lt;br /&gt;
* not necessary: Setting the survey permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all surveys)&lt;br /&gt;
&lt;br /&gt;
==A new user wants to create own surveys==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;Create survey&#039;&#039;&#039;&lt;br /&gt;
* Set template permissions for user to the template/s that should be used by the user/user-group&lt;br /&gt;
* not necessary: Setting the survey permissions (The creator of a survey has all permissions for his/her surveys)&lt;br /&gt;
&lt;br /&gt;
==The creator of a survey needs another person to edit his/her survey==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set the survey permissions the way you want. It depends on what the new user should do and how much permissions he/she needs. If he/she should have all permissions for the survey you can select the first checkboxes in the first column with checkboxes (the one with the &#039;&#039;&#039;&amp;lt;&amp;lt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039; button as header).&lt;br /&gt;
&lt;br /&gt;
==A person responisble for the survey wants to see the results of the survey and export them==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set survey permissions to: &#039;&#039;&#039;Responses&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039; and &#039;&#039;&#039;export&#039;&#039;&#039; , &#039;&#039;&#039;Statistics&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyCusomerOwnStatistics.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Article was translated and used with approval from &#039;&#039;&#039;vierundzwanzig&#039;&#039;&#039; (24/7 IT-SERVICES GmbH).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To be moved somewhere else once better defined:&lt;br /&gt;
&lt;br /&gt;
There are several classes of possible people who access a LimeSurvey installation.  But only one set of people is actually termed a &#039;&#039;&#039;user&#039;&#039;&#039; in the code and documentation.  So lets understand what these classes of people are so we can better understand the terminology of the program.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Class||Description&lt;br /&gt;
|-&lt;br /&gt;
|Installation Administrator || Those people who create login user accounts to allow others to create, edit, activate and/or view surveys and their results.  Often can be given access to edit the templates, labelsets and other key features independent of any particular survey stored.&lt;br /&gt;
|-&lt;br /&gt;
|Survey Administrator || A person with a login account that is given some management access to a particular survey.  Each survey can have its own set of users with specific rights to manipulate the survey.  These rights can be as broad as to activate a survey and possibly edit its question base.  They can be as minimum as simply able to review the results to date.&lt;br /&gt;
|-&lt;br /&gt;
|Participant || Those people who simply respond or participate in taking a survey.  They may or may not have token access.  They do not need a login account to the administrative interface and thus are not termed users.&lt;br /&gt;
|-&lt;br /&gt;
|Installer || A special class of person who has access to the MySQL (or similar) database server and possibly the command line interface of the computers operating system in order to install and configure the survey software.  This person is asked to setup the initial SuperAdmin user account from which other user login accounts can be created.&lt;br /&gt;
|-&lt;br /&gt;
|Developer || An very special class of person who has access to the source code and can manipulate it to change the programs behavior.  Generally only done with versions of the survey that are not available for live, active surveys. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Use one time passwords=&lt;br /&gt;
&lt;br /&gt;
Since version 1.81 a user can call the limesurvey login at /limesurvey/admin and pass username and a one time password which was previously written into the users table (column one_time_pw) by an external application.&lt;br /&gt;
&lt;br /&gt;
To enable this login method [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Use_one_time_passwords a setting has to be turned on] ($use_one_time_passwords = true;) in config.php.&lt;br /&gt;
&lt;br /&gt;
The URL has to contain the following variables:&lt;br /&gt;
* &#039;&#039;&#039;user:&#039;&#039;&#039; The username normally used to login into Limesurvey. This username has to exist in the &#039;users&#039; table of the database.&lt;br /&gt;
* &#039;&#039;&#039;onepass:&#039;&#039;&#039; The plain text password which is then compared to the password in the &#039;users&#039; table&lt;br /&gt;
&lt;br /&gt;
A valid URL to login using a one-time password will look like this...&lt;br /&gt;
&lt;br /&gt;
... for 1.81 to 1.92:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/admin/admin.php?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...for 2.0 or later:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/index.php/admin/authentication/login?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Things to watch out for:&#039;&#039;&#039;&lt;br /&gt;
* One time passwords have to be enabled by setting $use_one_time_passwords = true; in config.php&lt;br /&gt;
* The passed username has to exist in Limesurvey&#039;s &#039;&#039;users&#039;&#039; table&lt;br /&gt;
* The one time password, which can be set by an external application, has to be stored as [http://de.php.net/md5 MD5 hash] in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;&lt;br /&gt;
* The passed plain text password will be hashed using md5() function and will then be compared to the stored hash in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;. Both passwords have to match.&lt;br /&gt;
* After the first login with the one time password this password is deleted from the database. The user won&#039;t be able to login with this password anymore. If you are confronted with session timeout problems [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Survey_Behavior raise the setting for $sessionlifetime] (default is 3600 seconds).&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2168</id>
		<title>Manage users</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Manage_users&amp;diff=2168"/>
		<updated>2012-11-15T18:57:42Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= User management=&lt;br /&gt;
&lt;br /&gt;
==Create users==&lt;br /&gt;
&lt;br /&gt;
To create a new user open the user management (&#039;&#039;&#039;main menu&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Create/Edit users &#039;&#039;&#039; [[File:LimeSurveyBenuzerVerwaltung.jpg]]).&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddUser.jpg]]&lt;br /&gt;
* Enter the desired username into the textfield &#039;&#039;&#039;Username&#039;&#039;&#039;.&lt;br /&gt;
* Enter the email address into the textfield  &#039;&#039;&#039;Email&#039;&#039;&#039;. Please note&lt;br /&gt;
** If you don&#039;t want the user to recieve the confirmation email with a link to the LimeSurvey installation, username and password you can use your own email address to send the confirmation email to you. After that you can change the email address to the address of the user.&lt;br /&gt;
** LimeSurvey sends out a confirmation email to the address enterd into &#039;&#039;&#039;Email&#039;&#039;&#039;. This email address will be used as standard contact email address for surveys created by this user.&lt;br /&gt;
* Enter the users full name into the textfield &#039;&#039;&#039;Full name&#039;&#039;&#039; . Please note&lt;br /&gt;
** The full name entered here will be used as standard contact person name for surveys created by this user.&lt;br /&gt;
* Click &#039;&#039;&#039;Add user&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So you created a new user. You will find out more about setting user permissions if you continue reading further.&lt;br /&gt;
&lt;br /&gt;
==Edit users==&lt;br /&gt;
&lt;br /&gt;
You can use the pen symbol [[File:LimeSurveyBleistiftSymbol.jpg]] to edit a user.&lt;br /&gt;
&lt;br /&gt;
You can set a new email address, full name and even change the password. If you have finished what you want to do click &#039;&#039;&#039;Save&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Delete users==&lt;br /&gt;
&lt;br /&gt;
To delete a user account simply click the delete button [[File:LimeSurveyBenutzerLoeschen.jpg]] in the line with the user account that should be deleted and hit &#039;&#039;&#039;OK&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=Global permissions=&lt;br /&gt;
&lt;br /&gt;
Global permissions apply to the whole LimeSurvey installation. If you want to set permissions only for a specific survey you can use the Survey permissions settings.&lt;br /&gt;
&lt;br /&gt;
==Setting global permissions for a user==&lt;br /&gt;
&lt;br /&gt;
To set global permissions for a user just click the key symbol [[File:LimeSurveySchluesselSymbol.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetGlobalPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now add or remove the following rights.&lt;br /&gt;
* &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;: This right can only be added or removed by the user called &#039;&#039;&#039;admin&#039;&#039;&#039; and grants full rights to the whole LimeSurvey installation. &#039;&#039;&#039;Please note:&#039;&#039;&#039; This right is very powerful and you should be very carfefully with granting this right.&lt;br /&gt;
* &#039;&#039;&#039;Create survey&#039;&#039;&#039;: This right lets the user create a survey as well as start, stop and it . This is the standard permission for people creating their own surveys.&lt;br /&gt;
* &#039;&#039;&#039;Configurator&#039;&#039;&#039;: With this right a user can check data integrity, save the SQL database to an sql file and view the php info in the global settings.&lt;br /&gt;
* &#039;&#039;&#039;Create user&#039;&#039;&#039;: Having this right a user can create new users and delete users created with this account. The newly created users cannot have higher permissions than the parent. If this has to be done a &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has to grant the rights.&lt;br /&gt;
* &#039;&#039;&#039;Use all/manage templates&#039;&#039;&#039;: It allows the user to use all design templates and edit all non standard templates. A person with this right should have sufficient knowledge in terms of  HTML/php, Javascript and CSS. If a user not familar with this things should use a specific design template it would be better to use the template permissions.&lt;br /&gt;
* &#039;&#039;&#039;Manage labels&#039;&#039;&#039;: This right grants all rights regarding label sets (create, edit and delete).&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
==Setting template permissions for a user==&lt;br /&gt;
&lt;br /&gt;
With template permissions you can set which design templates a user can select when creating or editing a survey. It might be a good idea to restrict the design templates a user can select in order to prevent unwanted use of design templates not suitable for a user/survey.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; If you have a specific design template for a group of users or customers you might want to restrict the access for them to use only the template created for their purpose.&lt;br /&gt;
&lt;br /&gt;
To set/edit the template permissions for a user simply click the key symbol for design templates [[File:LimeSurveySchluesselSymbolTemplates.jpg]].&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySetDesignTemplatesLS.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can now select the design templates this user can select. After you finished your selection/deselection just hit &#039;&#039;&#039;Save settings&#039;&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=Setting permissions for a single survey=&lt;br /&gt;
&lt;br /&gt;
These permissions only apply for a single survey. If you want to set permissions for the whole system you can use the global permissions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; An existing user account is required to set permissions for a single survey. If the account doesn&#039;t exist you have to create it first and then change the survey permissions. You don&#039;t have to apply any global rights to the user, it is just necessary that the user account itself exists.&lt;br /&gt;
&lt;br /&gt;
==Setting user permissions for a single survey==&lt;br /&gt;
&lt;br /&gt;
To change the survey permissions you have to select &#039;&#039;&#039;Survey permissions&#039;&#039;&#039; from the &#039;&#039;&#039;Survey properties&#039;&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveySurveyPermissions.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the next step you select the user you want to change the survey rights and click &#039;&#039;&#039;Add user&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyAddSurveyPermission.jpg]]&lt;br /&gt;
&lt;br /&gt;
After you click &#039;&#039;&#039;Set survey permissions&#039;&#039;&#039; the survey permissions matrix for the survey and user will be shown.&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyUserPermissionMatrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
In this matrix you can set the rights for the different features and parts. You simply click  a checkbox if you want to add or remove this right. If you click a checkbox in the first column all rights for this line will be selected/removed.&lt;br /&gt;
&lt;br /&gt;
In the other columns you can choose whether a user can do a single actions from this feature/part.&lt;br /&gt;
&lt;br /&gt;
After you finished editing the survey permissions click &#039;&#039;&#039;Save now&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The most important use cases for granting user rights are collected at the &#039;&#039;&#039;use cases&#039;&#039;&#039; part of this article.&lt;br /&gt;
&lt;br /&gt;
=use cases=&lt;br /&gt;
&lt;br /&gt;
In this part of the article we&#039;ll provide a few ideas which use cases may exist and how and which rights would be a good choice.&lt;br /&gt;
&lt;br /&gt;
==A new person in charge for administrating LimeSurvey will be added==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039;&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039;&lt;br /&gt;
* not necessary: Setting the template permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all templates)&lt;br /&gt;
* not necessary: Setting the survey permissions (&#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; has all permissions for all surveys)&lt;br /&gt;
&lt;br /&gt;
==A new user wants to create own surveys==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set global permissions for user to &#039;&#039;&#039;Create survey&#039;&#039;&#039;&lt;br /&gt;
* Set template permissions for user to the template/s that should be used by the user/user-group&lt;br /&gt;
* not necessary: Setting the survey permissions (The creator of a survey has all permissions for his/her surveys)&lt;br /&gt;
&lt;br /&gt;
==The creator of a survey needs another person to edit his/her survey==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set the survey permissions the way you want. It depends on what the new user should do and how much permissions he/she needs. If he/she should have all permissions for the survey you can select the first checkboxes in the first column with checkboxes (the one with the &#039;&#039;&#039;&amp;lt;&amp;lt;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;gt;&amp;gt;&#039;&#039;&#039; button as header).&lt;br /&gt;
&lt;br /&gt;
==A person responisble for the survey wants to see the results of the survey and export them==&lt;br /&gt;
* login as &#039;&#039;&#039;admin&#039;&#039;&#039; or user with &#039;&#039;&#039;SuperAdministrator&#039;&#039;&#039; permission.&lt;br /&gt;
* Create a new user account&lt;br /&gt;
* Set &#039;&#039;&#039;no global permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set &#039;&#039;&#039;no template permissions&#039;&#039;&#039; for user&lt;br /&gt;
* Set survey permissions to: &#039;&#039;&#039;Responses&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039; and &#039;&#039;&#039;export&#039;&#039;&#039; , &#039;&#039;&#039;Statistics&#039;&#039;&#039;: &#039;&#039;&#039;View/read&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:LimeSurveyCusomerOwnStatistics.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Article was translated and used with approval from &#039;&#039;&#039;vierundzwanzig&#039;&#039;&#039; (24/7 IT-SERVICES GmbH).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To be moved somewhere else once better defined:&lt;br /&gt;
&lt;br /&gt;
There are several classes of possible people who access a LimeSurvey installation.  But only one set of people is actually termed a &#039;&#039;&#039;user&#039;&#039;&#039; in the code and documentation.  So lets understand what these classes of people are so we can better understand the terminology of the program.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Class||Description&lt;br /&gt;
|-&lt;br /&gt;
|Installation Administrator || Those people who create login user accounts to allow others to create, edit, activate and/or view surveys and their results.  Often can be given access to edit the templates, labelsets and other key features independent of any particular survey stored.&lt;br /&gt;
|-&lt;br /&gt;
|Survey Administrator || A person with a login account that is given some management access to a particular survey.  Each survey can have its own set of users with specific rights to manipulate the survey.  These rights can be as broad as to activate a survey and possibly edit its question base.  They can be as minimum as simply able to review the results to date.&lt;br /&gt;
|-&lt;br /&gt;
|Participant || Those people who simply respond or participate in taking a survey.  They may or may not have token access.  They do not need a login account to the administrative interface and thus are not termed users.&lt;br /&gt;
|-&lt;br /&gt;
|Installer || A special class of person who has access to the MySQL (or similar) database server and possibly the command line interface of the computers operating system in order to install and configure the survey software.  This person is asked to setup the initial SuperAdmin user account from which other user login accounts can be created.&lt;br /&gt;
|-&lt;br /&gt;
|Developer || An very special class of person who has access to the source code and can manipulate it to change the programs behavior.  Generally only done with versions of the survey that are not available for live, active surveys. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Use one time passwords=&lt;br /&gt;
&lt;br /&gt;
Since version 1.81 a user can call the limesurvey login at /limesurvey/admin and pass username and a one time password which was previously written into the users table (column one_time_pw) by an external application.&lt;br /&gt;
&lt;br /&gt;
To enable this login method [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Use_one_time_passwords a setting has to be turned on] ($use_one_time_passwords = true;) in config.php.&lt;br /&gt;
&lt;br /&gt;
The URL has to contain the following variables:&lt;br /&gt;
* &#039;&#039;&#039;user:&#039;&#039;&#039; The username normally used to login into Limesurvey. This username has to exist in the &#039;users&#039; table of the database.&lt;br /&gt;
* &#039;&#039;&#039;onepass:&#039;&#039;&#039; The plain text password which is then compared to the password in the &#039;users&#039; table&lt;br /&gt;
&lt;br /&gt;
A valid URL to login using a one-time password will look like this...&lt;br /&gt;
&lt;br /&gt;
... for 1.81 to 1.92:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/admin/admin.php?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...for 2.0 or later:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;http://www.yourdomain.org/limesurvey/index.php/admin/authentication/login?user=myusername&amp;amp;onepass;=secretpassword&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Things to watch out for:&#039;&#039;&#039;&lt;br /&gt;
* One time passwords have to be enabled by setting $use_one_time_passwords = true; in config.php&lt;br /&gt;
* The passed username has to exist in Limesurvey&#039;s &#039;&#039;users&#039;&#039; table&lt;br /&gt;
* The one time password, which can be set by an external application, has to be stored as [http://de.php.net/md5 MD5 hash] in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;&lt;br /&gt;
* The passed plain text password will be hashed using md5() function and will then be compared to the stored hash in column &#039;&#039;one_time_pw&#039;&#039; of table &#039;&#039;users&#039;&#039;. Both passwords have to match.&lt;br /&gt;
* After the first login with the one time password this password is deleted from the database. The user won&#039;t be able to login with this password anymore. If you are confronted with session timeout problems [http://docs.limesurvey.org/tiki-index.php?page=Optional+settings#Survey_Behavior raise the setting for $sessionlifetime] (default is 3600 seconds).&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=RemoteControl_2_API&amp;diff=2938</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=2938"/>
		<updated>2012-11-15T14:58:32Z</updated>

		<summary type="html">&lt;p&gt;Admin: &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 later. The old [RemoteControl] will not be available any longer in version 2.&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;Services&#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 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 the following functions:&lt;br /&gt;
&lt;br /&gt;
==get_session_key==&lt;br /&gt;
&lt;br /&gt;
Using this function you can create a new XML-RPC session key. This is mandatory for all following LSRC2 function calls.&lt;br /&gt;
&lt;br /&gt;
Parameters: username (string), password (string)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: A session key (string)&lt;br /&gt;
*On failure: Error Code 1&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;
Parameters: session key (string)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*Always: &#039;OK&#039; (string)&lt;br /&gt;
&lt;br /&gt;
==get_site_settings==&lt;br /&gt;
&lt;br /&gt;
Function to provide with site settings only to administrators&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) The session key&lt;br /&gt;
&lt;br /&gt;
sSetttingName (string) -  Name of the setting to get&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) Setting&lt;br /&gt;
*On failure: (string) Error message&lt;br /&gt;
&lt;br /&gt;
==add_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to add an empty survey with minimum details&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID     (int),    The wish id of the Survey to add&lt;br /&gt;
&lt;br /&gt;
sSurveyTitle     (string),  Title of the new Survey&lt;br /&gt;
&lt;br /&gt;
sSurveyLanguage    (string),  Default language of the Survey&lt;br /&gt;
&lt;br /&gt;
sformat     (string),  Question appearance format (S|G|A)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) $iNewSurveyID&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Faulty parameters&lt;br /&gt;
**Creation Failed&lt;br /&gt;
&lt;br /&gt;
==delete_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to Delete a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string), Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (int), The Survey to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: Status =&amp;gt;OK (array)&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==import_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to import a survey from lss,csv,xls or survey zip archive.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
sImportData  (string) String containing the BASE 64 encoded data of a lss,csv,xls or survey zip archive&lt;br /&gt;
&lt;br /&gt;
sImportDataType     (string),    The format of the import file (lss,csv,xls or zip)&lt;br /&gt;
&lt;br /&gt;
sNewSurveyName     (string),  The optional new name of the survey (base language)&lt;br /&gt;
&lt;br /&gt;
DestSurveyID    (int), This is the new ID of the survey - if already used a random one will be taken instead&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) $iNewSurveyID&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Import error&lt;br /&gt;
&lt;br /&gt;
==get_survey_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to get properties of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveySettings     (array),    An array with the properties to return&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) the requested value&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||   ||   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|   sid||   savetimings||   allowprev||   tokenanswerspersistence||   showgroupinfo||   showwelcome&lt;br /&gt;
|-&lt;br /&gt;
|   owner_id||   template||   printanswers||   assessments||  shownoanswer ||   showprogress&lt;br /&gt;
|-&lt;br /&gt;
|   admin||   language||   ipaddr||   usecaptcha||   showqnumcode||   allowjumps&lt;br /&gt;
|-&lt;br /&gt;
|   active||   additional_languages ||   refurl||   usetokens||   bouncetime||   navigationdelay&lt;br /&gt;
|-&lt;br /&gt;
|   expires||   datestamp||   datecreated||   bounce_email||   bounceprocessing||   nokeyboard&lt;br /&gt;
|-&lt;br /&gt;
|   startdate||   usecookie||   publicstatistics||   attributedescriptions||   bounceaccounttype||   alloweditaftercompletion&lt;br /&gt;
|-&lt;br /&gt;
|   adminemail||   allowregister||   publicgraphs||   emailresponseto||   bounceaccounthost||   googleanalyticsstyle&lt;br /&gt;
|-&lt;br /&gt;
|   anonymized||   allowsave||   listpublic||   emailnotificationto||   bounceaccountpass||   googleanalyticsapikey&lt;br /&gt;
|-&lt;br /&gt;
|   faxto||   autonumber_start||   htmlemail||   tokenlength||   bounceaccountencryption||&lt;br /&gt;
|-&lt;br /&gt;
|format||   autoredirect||   sendconfirmation||   showxquestions||   bounceaccountuser||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_survey_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set properties of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveySettings     (array),    An assosiative array with the name-value  pair of the properties to set&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The result of the change for each property&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
Properties available for changing are all those defined in get_survey_properties with the following exceptions&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|properties not allowed to be modified|| Properties not allowed to be modified when survey active&lt;br /&gt;
|-&lt;br /&gt;
|sid||anonymized&lt;br /&gt;
|-&lt;br /&gt;
|language||datestamp&lt;br /&gt;
|-&lt;br /&gt;
|additional_languages||savetimings&lt;br /&gt;
|-&lt;br /&gt;
|active||ipaddr&lt;br /&gt;
|-&lt;br /&gt;
|||refurl&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_surveys==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to list the ids and info of surveys belonging to a user.&lt;br /&gt;
&lt;br /&gt;
    * If user is admin he can get surveys of every user (parameter sUser) or all surveys (sUser=null)&lt;br /&gt;
&lt;br /&gt;
    * Else only the syrveys belonging to the user requesting will be shown.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
sUser (string) -  The users surveys to list&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Survey&#039;s properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid user&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No surveys found&lt;br /&gt;
&lt;br /&gt;
Survey&#039;s properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|property||type&lt;br /&gt;
|-&lt;br /&gt;
|sid||integer&lt;br /&gt;
|-&lt;br /&gt;
|surveyls_title||string&lt;br /&gt;
|-&lt;br /&gt;
|startdate||date&lt;br /&gt;
|-&lt;br /&gt;
|expires||date&lt;br /&gt;
|-&lt;br /&gt;
|active||y/n&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==activate_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine that launches a newly created survey (sets active -available for users)&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
*On success: (array) The result of the activation&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**Activation Error&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==export_statistics==&lt;br /&gt;
&lt;br /&gt;
RPC routine to export statistics of a survey to a user.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
docType (string) - Type of document to generate&lt;br /&gt;
&lt;br /&gt;
sLanguage (string) Optional language of the survey to use (if not set, default language is selected)&lt;br /&gt;
&lt;br /&gt;
graph (string) - Optional parameter to enable graphs (0|1)&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
*On success: (string) Base64 encoded string with the statistics file&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==get_summary==&lt;br /&gt;
&lt;br /&gt;
RPC routine to get survey summary, regarding token usage and survey participation.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
sStatname (string) - The statistic to return&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
*On success: (string) Base64 encoded string with the statistics file&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**No available data&lt;br /&gt;
**No such property&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
Available statistics:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Survey stats||Token stats&lt;br /&gt;
|-&lt;br /&gt;
|completed_responses||token_count&lt;br /&gt;
|-&lt;br /&gt;
|incomplete_responses||token_invalid&lt;br /&gt;
|-&lt;br /&gt;
|full_responses||tokens_sent&lt;br /&gt;
|-&lt;br /&gt;
|||token_opted_out&lt;br /&gt;
|-&lt;br /&gt;
|||token_completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==add_language==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to add a language to an existing survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
session key (string) - The session key&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aLanguage (string) - The language shortcut for the new language to be added. Note: If the language is already in that survey no error will be thrown.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
*On success: (array) status=&amp;gt;OK&lt;br /&gt;
*On failure: (array) Any other status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Error&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==delete_survey_language==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete a language of an existing survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
session key (string) The session key&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aLanguage (string) - The language shortcut for the language to be removed. Note: If the language is not part of that survey no error will be thrown.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
*On success: (array) status=&amp;gt;OK&lt;br /&gt;
*On failure: (array) Any other status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Cannot remove base language&lt;br /&gt;
**Error&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid session key&lt;br /&gt;
&lt;br /&gt;
==get_language_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to get survey language properties&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveyLocaleSettings     (array) -  An array with the properties to return&lt;br /&gt;
&lt;br /&gt;
slang (string)    - The language to use&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) the requested value&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available parameters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_survey_id            ||    surveyls_url                  ||    surveyls_email_register_subj  ||    email_admin_notification_subj&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_language             ||    surveyls_urldescription       ||    surveyls_email_register       ||    email_admin_notification&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_title                ||    surveyls_email_invite_subj    ||    surveyls_email_confirm_subj   ||    email_admin_responses_subj&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_description          ||    surveyls_email_invite         ||    surveyls_email_confirm        ||    email_admin_responses&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_welcometext          || surveyls_email_remind_subj       ||    surveyls_dateformat           ||    surveyls_numberformat&lt;br /&gt;
|-&lt;br /&gt;
|surveyls_endtext              ||    surveyls_email_remind         ||    surveyls_attributecaptions    ||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_language_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set survey language properties&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveyLocaleData     (array) -  An assosiative array with the key-value pairs of properties to set. Invalid fieldnames or fields that may not be modified are ignored.&lt;br /&gt;
&lt;br /&gt;
sLanguage (string)    - The language to use&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) Result for each parameter set&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Allowed Parameters:&lt;br /&gt;
&lt;br /&gt;
All those defined in get-language_properties except:&lt;br /&gt;
*surveyls_language&lt;br /&gt;
*surveyls_survey_id&lt;br /&gt;
&lt;br /&gt;
==add_group==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to add an empty group with minimum details.&lt;br /&gt;
&lt;br /&gt;
    * Used as a placeholder for importing questions.&lt;br /&gt;
&lt;br /&gt;
    * Returns the groupid of the created group.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the surveythat the group will be added&lt;br /&gt;
&lt;br /&gt;
sGroupTitle     (string) -  Name of the new group&lt;br /&gt;
&lt;br /&gt;
sGroupDescription (string) - Optional description of the group&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) The ID of the new group&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Error:Survey is active and not editable&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Creation Failed&lt;br /&gt;
&lt;br /&gt;
==delete_group==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete a group of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey that the group belongs&lt;br /&gt;
&lt;br /&gt;
sGroupID    (int) -  Id of the group to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) The ID of the deleted group&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**Invalid Group ID&lt;br /&gt;
**Error:Survey is active and not editable&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Group deletion failed&lt;br /&gt;
&lt;br /&gt;
==import_group==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to import a group - imports lsg,csv&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  The id of the survey that the group will belong&lt;br /&gt;
&lt;br /&gt;
sImportData     (string) -  String containing the BASE 64 encoded data of a lsg,csv&lt;br /&gt;
&lt;br /&gt;
sGroupDescription (string) -The format of the importfile in the stream (lsg|csv)&lt;br /&gt;
&lt;br /&gt;
sNewGroupName (string) - Optional new name for the group&lt;br /&gt;
&lt;br /&gt;
sNewGroupDescription (string) - Optional new description for the group&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) The ID of the new group&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Error:Survey is active and not editable&lt;br /&gt;
**Invalid extension&lt;br /&gt;
**Error: Invalid LimeSurvey group structure XML&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Import Error&lt;br /&gt;
&lt;br /&gt;
==get_group_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return properties of a group of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iGroupID (integer) -  The id of the group to get properties of&lt;br /&gt;
&lt;br /&gt;
aGroupSettings     (array) -  Array containing the properties to request.&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The requested properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Error: Invalid group ID&lt;br /&gt;
**No valid Data&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| ||&lt;br /&gt;
|-&lt;br /&gt;
|gid||description&lt;br /&gt;
|-&lt;br /&gt;
|sid||language&lt;br /&gt;
|-&lt;br /&gt;
|group_name||randomization_group&lt;br /&gt;
|-&lt;br /&gt;
|group_order||grelevance&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_group_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set properties of a group of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iGroupID (integer) -  The id of the group to set properties to&lt;br /&gt;
&lt;br /&gt;
aGroupData     (array) -  Assosiative Array containing key-value pairs of the properties to set.&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The result of each set action&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Error: Invalid group ID&lt;br /&gt;
**No valid Data&lt;br /&gt;
**Group with dependencies - Order cannot be changed&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| ||&lt;br /&gt;
|-&lt;br /&gt;
|||description&lt;br /&gt;
|-&lt;br /&gt;
|||language&lt;br /&gt;
|-&lt;br /&gt;
|group_name||randomization_group&lt;br /&gt;
|-&lt;br /&gt;
|group_order||grelevance&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_groups==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return the ids and info of groups belonging to survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  The id of the survey to get groups of&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The list of the groups&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**No groups found&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==delete_question==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete a question of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iQuestionID  (int) Id of the question to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int)id of the deleted Question&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
** Invalid question ID&lt;br /&gt;
**Survey is active and not editable&lt;br /&gt;
**Cannot delete Question. Others rely on this question&lt;br /&gt;
**Error&lt;br /&gt;
&lt;br /&gt;
==import_question==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to import a question - imports lsq,csv&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey that the new questions belongs&lt;br /&gt;
&lt;br /&gt;
iGroupID (int) - Id of the group that the new questions belongs&lt;br /&gt;
&lt;br /&gt;
sImportData (string) - String containing the BASE 64 encoded data of a lsg,csv&lt;br /&gt;
&lt;br /&gt;
sImportDataType (string)  - Format of the input stream (lsq,csv)&lt;br /&gt;
&lt;br /&gt;
sMandatory (string) - Optional Mandatory question option (default to No)&lt;br /&gt;
&lt;br /&gt;
sNewQuestionTitle (string) - Optional new title for the question&lt;br /&gt;
&lt;br /&gt;
sNewqQuestion (string) - An optional new question&lt;br /&gt;
&lt;br /&gt;
sNewQuestionHelp (string) - An optional new question help text&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) Id of the new Question&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid group ID&lt;br /&gt;
**Survey is active and not editable&lt;br /&gt;
**Invalid extension&lt;br /&gt;
**Invalid LimeSurvey question structure XML&lt;br /&gt;
&lt;br /&gt;
==get_question_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return properties of a question of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iQuestionID  (int) Id of the question to get properties of&lt;br /&gt;
&lt;br /&gt;
aQuestionSettings (array) The properties to get&lt;br /&gt;
&lt;br /&gt;
sLanguage (string) Optional parameter language for multilingual questions&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The requested properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid questionid&lt;br /&gt;
**Invalid language&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|gid||type||help||language&lt;br /&gt;
|-&lt;br /&gt;
|parent_qid||title||other||scale_id&lt;br /&gt;
|-&lt;br /&gt;
|sid||question||mandatory||same_default&lt;br /&gt;
|-&lt;br /&gt;
|gid||preg||question_order||relevance&lt;br /&gt;
|-&lt;br /&gt;
|subquestions||attributes||attributes_lang||answeroptions&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_question_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set question properties&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iQuestionID  (int) - Id of the question to get properties of&lt;br /&gt;
&lt;br /&gt;
aQuestionData (array)  - An array with the particular fieldnames as keys and their values to set on that particular question&lt;br /&gt;
&lt;br /&gt;
sLanguage (string)  -  Optional parameter language for multilingual questions&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The resilt of the set of each property&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid questionid&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Questions with dependencies - Order cannot be changed&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|help|| ||&lt;br /&gt;
|-&lt;br /&gt;
|title||other||scale_id&lt;br /&gt;
|-&lt;br /&gt;
|question||mandatory||same_default&lt;br /&gt;
|-&lt;br /&gt;
|preg||question_order||relevance&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_questions==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return the ids and info of questions of a survey/group.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (int) - Id of the survey to get questions of&lt;br /&gt;
&lt;br /&gt;
iGroupID  (int) - Id of the group to get questions of&lt;br /&gt;
&lt;br /&gt;
sLanguage (string)  -  Optional parameter language for multilingual questions&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The list of the questions&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid questionid&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Missmatch in surveyid and groupid&lt;br /&gt;
**No questions found&lt;br /&gt;
&lt;br /&gt;
==activate_tokens==&lt;br /&gt;
&lt;br /&gt;
Activate tokens&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
session key (string) The session key&lt;br /&gt;
&lt;br /&gt;
surveyid (string) The survey ID&lt;br /&gt;
&lt;br /&gt;
additional_attributes (array of integers) Any additional attribute fields to create. Just give the attribute IDs&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) status OK&lt;br /&gt;
*On failure: (array) Any other status&lt;br /&gt;
&lt;br /&gt;
==add_participants==&lt;br /&gt;
&lt;br /&gt;
Using this function you can add new entries to your token table. You can also set if for these new entries a token key is automatically create&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
*session key (string) - The session key&lt;br /&gt;
*survey ID (string) - The survey id&lt;br /&gt;
*participant data (array) -  2-dimensional array/structure containing your participants data&lt;br /&gt;
*createTokenKey (boolean) - Set this to true if you want a token key create automatically for each entry - if your participant data included a [token] field it will be overwritten&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success:  participant data (struct) -  structure containing your participants data plus the token ID and (if applicable) the new token&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
&lt;br /&gt;
==delete_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete multiple participants of a Survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (int) - Id of the survey to get questions of&lt;br /&gt;
&lt;br /&gt;
aTokenIDs  (array) - IId of the tokens/participants to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of deletion status for each participant&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
&lt;br /&gt;
==get_participant_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return settings of a token/participant of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the Survey to get token properties&lt;br /&gt;
&lt;br /&gt;
iTokenID (int) - Id of the participant to check&lt;br /&gt;
&lt;br /&gt;
aTokenProperties (array) - The properties to get&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of requested values&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**Invalid tokenid&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Parameters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|tid||   token||   completed&lt;br /&gt;
|-&lt;br /&gt;
| participant_id ||   language||   usesleft&lt;br /&gt;
|-&lt;br /&gt;
|firstname||   blacklisted||   validfrom&lt;br /&gt;
|-&lt;br /&gt;
|   lastname||   sent||   validuntil&lt;br /&gt;
|-&lt;br /&gt;
|email||   remindersent||   mpid&lt;br /&gt;
|-&lt;br /&gt;
|emailstatus||   remindercount||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_participant_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set properties of a survey participant/token&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the Survey to set token properties&lt;br /&gt;
&lt;br /&gt;
iTokenID (int) - Id of the participant to alter&lt;br /&gt;
&lt;br /&gt;
aTokenData (array) - Key - value pair of the properties to set&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of results of changing properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**Invalid tokenid&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Parameters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|||   token||   completed&lt;br /&gt;
|-&lt;br /&gt;
| participant_id ||   language||   usesleft&lt;br /&gt;
|-&lt;br /&gt;
|firstname||   blacklisted||   validfrom&lt;br /&gt;
|-&lt;br /&gt;
|   lastname||   sent||   validuntil&lt;br /&gt;
|-&lt;br /&gt;
|email||   remindersent||   mpid&lt;br /&gt;
|-&lt;br /&gt;
|emailstatus||   remindercount||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return the ids and info  of token/participants of a survey.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to list participants&lt;br /&gt;
&lt;br /&gt;
iStart (int) - Start id of the token list&lt;br /&gt;
&lt;br /&gt;
iLimit (int) - Number of participants to return&lt;br /&gt;
&lt;br /&gt;
bUnused (bool) - If you want unused tokensm, set true&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of Participants info&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**No Tokens found&lt;br /&gt;
&lt;br /&gt;
==activate_tokens==&lt;br /&gt;
&lt;br /&gt;
RPC routine to to initialise the survey&#039;s collection of tokens where new participant tokens may be later added&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to list participants&lt;br /&gt;
&lt;br /&gt;
aAttributeFields (array) - An array of integer describing any additional attribute fields&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Status OK&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Token table could not be created&lt;br /&gt;
&lt;br /&gt;
==invite_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to invite participants in a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to send invitation to participants&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array)  Array of result of each email send action and count of invitations left to send&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**No candidate tokens&lt;br /&gt;
&lt;br /&gt;
==remind_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to send reminder for participants in a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to send invitation to participants&lt;br /&gt;
&lt;br /&gt;
iMinDaysBetween (int) - Optional parameter days from last reminder&lt;br /&gt;
&lt;br /&gt;
iMaxReminders (int) - Optional parameter Maximum reminders count&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array)  Array of result of each email send action and count of invitations left to send&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**No candidate tokens&lt;br /&gt;
&lt;br /&gt;
==add_response==&lt;br /&gt;
&lt;br /&gt;
Using this function you can add new responses to your survey response table.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
*sSessionKey (string) - The session key&lt;br /&gt;
*iSurveyID (integer) - The survey id&lt;br /&gt;
*aResponseData (array) -  array/structure containing your response data&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: response_id (integer) -  Returns the id of the inserted survey response&lt;br /&gt;
*On failure: (array) with error description&lt;br /&gt;
&lt;br /&gt;
==export_responses==&lt;br /&gt;
&lt;br /&gt;
Export response data to pdf,csv,xls,doc&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
SurveyID (int) - Id of the Survey&lt;br /&gt;
&lt;br /&gt;
DocumentType (string) - pdf,csv,xls,doc&lt;br /&gt;
&lt;br /&gt;
sLanguageCode (string) - Optional The language to be used - if not given then the base language will be used&lt;br /&gt;
&lt;br /&gt;
CompletionStatus (string) - Optional &#039;complete&#039;,&#039;incomplete&#039; or &#039;all&#039; selection of responses - defaults to complete&lt;br /&gt;
&lt;br /&gt;
HeadingType (string) - &#039;code&#039;,&#039;full&#039; or &#039;abbreviated&#039;. type of question heading. Optional defaults to &#039;code&#039;&lt;br /&gt;
&lt;br /&gt;
ResponseType (string) - &#039;short&#039; or &#039;long&#039; response type.Optional defaults to &#039;short&#039;&lt;br /&gt;
&lt;br /&gt;
FromResponse (int) - Optional start number of response&lt;br /&gt;
&lt;br /&gt;
ToResponse (int) - Optional end number of responses&lt;br /&gt;
&lt;br /&gt;
Return:&lt;br /&gt;
&lt;br /&gt;
On success: Requested file as base 64-encoded string.&lt;br /&gt;
&lt;br /&gt;
On failure: Array with error information&lt;br /&gt;
&lt;br /&gt;
Note: If you have huge response sets try only to request a certain number of records at a time otherwise the server may run out of memory.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
To test you will have to activate JSON-RPC in global settings. To run a simple self-test go to&lt;br /&gt;
&lt;br /&gt;
http://path_to_your_limesurvey_installation/index.php/admin/remotecontrol/test . This will import the example survey, do various things with it and delete it afterwards.&lt;br /&gt;
&lt;br /&gt;
The test assumes that you still are using the standard user &#039;admin&#039; with password &#039;password&#039;.&lt;br /&gt;
&lt;br /&gt;
The client function for this test can be found in /application/controller/admin/remotecontrol.php and the particular function is called test().&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 based on the tiny jsonRPCClient from [http://jsonrpcphp.org/ | jsonrpcphp.org]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once &#039;jsonRPCClient.php&#039;;&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_BASEURL&#039;, &#039;http://localhost/limesurvey/&#039;);  // adjust this one to your actual LimeSurvey URL&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_USER&#039;, &#039;rpcuser&#039; );&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_PASSWORD&#039;, &#039;mypassword&#039; );&lt;br /&gt;
&lt;br /&gt;
// the survey to process&lt;br /&gt;
&lt;br /&gt;
$survey_id=374699;&lt;br /&gt;
&lt;br /&gt;
// instanciate a new client&lt;br /&gt;
&lt;br /&gt;
$myJSONRPCClient = new jsonRPCClient( LS_BASEURL.&#039;/admin/remotecontrol&#039; );&lt;br /&gt;
&lt;br /&gt;
// receive session key&lt;br /&gt;
&lt;br /&gt;
$sessionKey= $myJSONRPCClient-&amp;gt;get_session_key( LS_USER, LS_PASSWORD );&lt;br /&gt;
&lt;br /&gt;
// receive all ids and info of groups belonging to a given survey&lt;br /&gt;
&lt;br /&gt;
$groups = $myJSONRPCClient-&amp;gt;list_groups( $sessionKey, $survey_id );&lt;br /&gt;
&lt;br /&gt;
print_r($groups, null );&lt;br /&gt;
&lt;br /&gt;
// release the session key&lt;br /&gt;
&lt;br /&gt;
$myJSONRPCClient-&amp;gt;release_session_key( $sessionKey );&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Changes=&lt;br /&gt;
&lt;br /&gt;
2.0a Only three functions are supported right now: getSessionKey, releaseSessionKey, deleteSurvey&lt;br /&gt;
&lt;br /&gt;
2.0b Added function add_participants&lt;br /&gt;
&lt;br /&gt;
2.0RC5 Added import_survey, activate_survey, activate_tokens&lt;br /&gt;
&lt;br /&gt;
2.0 (build 121030) Added subquestions, attributes, attributes_lang and answeroptions properties for get_question_properties&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=RemoteControl_2_API&amp;diff=2940</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=2940"/>
		<updated>2012-11-15T14:24:26Z</updated>

		<summary type="html">&lt;p&gt;Admin: &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 later. The old [RemoteControl] will not be available any longer in version 2.&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;Services&#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 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 the following functions:&lt;br /&gt;
&lt;br /&gt;
==get_session_key==&lt;br /&gt;
&lt;br /&gt;
Using this function you can create a new XML-RPC session key. This is mandatory for all following LSRC2 function calls.&lt;br /&gt;
&lt;br /&gt;
Parameters: username (string), password (string)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: A session key (string)&lt;br /&gt;
*On failure: Error Code 1&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;
Parameters: session key (string)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*Always: &#039;OK&#039; (string)&lt;br /&gt;
&lt;br /&gt;
==get_site_settings==&lt;br /&gt;
&lt;br /&gt;
Function to provide with site settings only to administrators&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) The session key&lt;br /&gt;
&lt;br /&gt;
sSetttingName (string) -  Name of the setting to get&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) Setting&lt;br /&gt;
*On failure: (string) Error message&lt;br /&gt;
&lt;br /&gt;
==add_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to add an empty survey with minimum details&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID     (int),    The wish id of the Survey to add&lt;br /&gt;
&lt;br /&gt;
sSurveyTitle     (string),  Title of the new Survey&lt;br /&gt;
&lt;br /&gt;
sSurveyLanguage    (string),  Default language of the Survey&lt;br /&gt;
&lt;br /&gt;
sformat     (string),  Question appearance format (S|G|A)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) $iNewSurveyID&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Faulty parameters&lt;br /&gt;
**Creation Failed&lt;br /&gt;
&lt;br /&gt;
==delete_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to Delete a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string), Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (int), The Survey to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: Status =&amp;gt;OK (array)&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==import_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to import a survey from lss,csv,xls or survey zip archive.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
sImportData  (string) String containing the BASE 64 encoded data of a lss,csv,xls or survey zip archive&lt;br /&gt;
&lt;br /&gt;
sImportDataType     (string),    The format of the import file (lss,csv,xls or zip)&lt;br /&gt;
&lt;br /&gt;
sNewSurveyName     (string),  The optional new name of the survey (base language)&lt;br /&gt;
&lt;br /&gt;
DestSurveyID    (int), This is the new ID of the survey - if already used a random one will be taken instead&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) $iNewSurveyID&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Import error&lt;br /&gt;
&lt;br /&gt;
==get_survey_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to get properties of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveySettings     (array),    An array with the properties to return&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) the requested value&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||   ||   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|   sid||   savetimings||   allowprev||   tokenanswerspersistence||   showgroupinfo||   showwelcome&lt;br /&gt;
|-&lt;br /&gt;
|   owner_id||   template||   printanswers||   assessments||  shownoanswer ||   showprogress&lt;br /&gt;
|-&lt;br /&gt;
|   admin||   language||   ipaddr||   usecaptcha||   showqnumcode||   allowjumps&lt;br /&gt;
|-&lt;br /&gt;
|   active||   additional_languages ||   refurl||   usetokens||   bouncetime||   navigationdelay&lt;br /&gt;
|-&lt;br /&gt;
|   expires||   datestamp||   datecreated||   bounce_email||   bounceprocessing||   nokeyboard&lt;br /&gt;
|-&lt;br /&gt;
|   startdate||   usecookie||   publicstatistics||   attributedescriptions||   bounceaccounttype||   alloweditaftercompletion&lt;br /&gt;
|-&lt;br /&gt;
|   adminemail||   allowregister||   publicgraphs||   emailresponseto||   bounceaccounthost||   googleanalyticsstyle&lt;br /&gt;
|-&lt;br /&gt;
|   anonymized||   allowsave||   listpublic||   emailnotificationto||   bounceaccountpass||   googleanalyticsapikey&lt;br /&gt;
|-&lt;br /&gt;
|   faxto||   autonumber_start||   htmlemail||   tokenlength||   bounceaccountencryption||&lt;br /&gt;
|-&lt;br /&gt;
|format||   autoredirect||   sendconfirmation||   showxquestions||   bounceaccountuser||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_survey_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set properties of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveySettings     (array),    An assosiative array with the name-value  pair of the properties to set&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The result of the change for each property&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
Properties available for changing are all those defined in get_survey_properties with the following exceptions&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|properties not allowed to be modified|| Properties not allowed to be modified when survey active&lt;br /&gt;
|-&lt;br /&gt;
|sid||anonymized&lt;br /&gt;
|-&lt;br /&gt;
|language||datestamp&lt;br /&gt;
|-&lt;br /&gt;
|additional_languages||savetimings&lt;br /&gt;
|-&lt;br /&gt;
|active||ipaddr&lt;br /&gt;
|-&lt;br /&gt;
|||refurl&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_surveys==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to list the ids and info of surveys belonging to a user.&lt;br /&gt;
&lt;br /&gt;
    * If user is admin he can get surveys of every user (parameter sUser) or all surveys (sUser=null)&lt;br /&gt;
&lt;br /&gt;
    * Else only the syrveys belonging to the user requesting will be shown.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
sUser (string) -  The users surveys to list&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Survey&#039;s properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid user&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No surveys found&lt;br /&gt;
&lt;br /&gt;
Survey&#039;s properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|property||type&lt;br /&gt;
|-&lt;br /&gt;
|sid||integer&lt;br /&gt;
|-&lt;br /&gt;
|surveyls_title||string&lt;br /&gt;
|-&lt;br /&gt;
|startdate||date&lt;br /&gt;
|-&lt;br /&gt;
|expires||date&lt;br /&gt;
|-&lt;br /&gt;
|active||y/n&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==activate_survey==&lt;br /&gt;
&lt;br /&gt;
RPC Routine that launches a newly created survey (sets active -available for users)&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
*On success: (array) The result of the activation&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**Activation Error&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==export_statistics==&lt;br /&gt;
&lt;br /&gt;
RPC routine to export statistics of a survey to a user.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
docType (string) - Type of document to generate&lt;br /&gt;
&lt;br /&gt;
sLanguage (string) Optional language of the survey to use (if not set, default language is selected)&lt;br /&gt;
&lt;br /&gt;
graph (string) - Optional parameter to enable graphs (0|1)&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
*On success: (string) Base64 encoded string with the statistics file&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==get_summary==&lt;br /&gt;
&lt;br /&gt;
RPC routine to get survey summary, regarding token usage and survey participation.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
sStatname (string) - The statistic to return&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
*On success: (string) Base64 encoded string with the statistics file&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**No available data&lt;br /&gt;
**No such property&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
Available statistics:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Survey stats||Token stats&lt;br /&gt;
|-&lt;br /&gt;
|completed_responses||token_count&lt;br /&gt;
|-&lt;br /&gt;
|incomplete_responses||token_invalid&lt;br /&gt;
|-&lt;br /&gt;
|full_responses||tokens_sent&lt;br /&gt;
|-&lt;br /&gt;
|||token_opted_out&lt;br /&gt;
|-&lt;br /&gt;
|||token_completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==add_language==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to add a language to an existing survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
session key (string) - The session key&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aLanguage (string) - The language shortcut for the new language to be added. Note: If the language is already in that survey no error will be thrown.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
*On success: (array) status=&amp;gt;OK&lt;br /&gt;
*On failure: (array) Any other status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Error&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==delete_survey_language==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete a language of an existing survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
session key (string) The session key&lt;br /&gt;
&lt;br /&gt;
SurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aLanguage (string) - The language shortcut for the language to be removed. Note: If the language is not part of that survey no error will be thrown.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
*On success: (array) status=&amp;gt;OK&lt;br /&gt;
*On failure: (array) Any other status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Cannot remove base language&lt;br /&gt;
**Error&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid session key&lt;br /&gt;
&lt;br /&gt;
==get_language_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to get survey language properties&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveyLocaleSettings     (array) -  An array with the properties to return&lt;br /&gt;
&lt;br /&gt;
slang (string)    - The language to use&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) the requested value&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available parameters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_survey_id            ||    surveyls_url                  ||    surveyls_email_register_subj  ||    email_admin_notification_subj&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_language             ||    surveyls_urldescription       ||    surveyls_email_register       ||    email_admin_notification&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_title                ||    surveyls_email_invite_subj    ||    surveyls_email_confirm_subj   ||    email_admin_responses_subj&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_description          ||    surveyls_email_invite         ||    surveyls_email_confirm        ||    email_admin_responses&lt;br /&gt;
|-&lt;br /&gt;
|    surveyls_welcometext          || surveyls_email_remind_subj       ||    surveyls_dateformat           ||    surveyls_numberformat&lt;br /&gt;
|-&lt;br /&gt;
|surveyls_endtext              ||    surveyls_email_remind         ||    surveyls_attributecaptions    ||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_language_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set survey language properties&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey&lt;br /&gt;
&lt;br /&gt;
aSurveyLocaleData     (array) -  An assosiative array with the key-value pairs of properties to set. Invalid fieldnames or fields that may not be modified are ignored.&lt;br /&gt;
&lt;br /&gt;
sLanguage (string)    - The language to use&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (string) Result for each parameter set&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Allowed Parameters:&lt;br /&gt;
&lt;br /&gt;
All those defined in get-language_properties except:&lt;br /&gt;
*surveyls_language&lt;br /&gt;
*surveyls_survey_id&lt;br /&gt;
&lt;br /&gt;
==add_group==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to add an empty group with minimum details.&lt;br /&gt;
&lt;br /&gt;
    * Used as a placeholder for importing questions.&lt;br /&gt;
&lt;br /&gt;
    * Returns the groupid of the created group.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the surveythat the group will be added&lt;br /&gt;
&lt;br /&gt;
sGroupTitle     (string) -  Name of the new group&lt;br /&gt;
&lt;br /&gt;
sGroupDescription (string) - Optional description of the group&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) The ID of the new group&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Error:Survey is active and not editable&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Creation Failed&lt;br /&gt;
&lt;br /&gt;
==delete_group==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete a group of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  ID of the survey that the group belongs&lt;br /&gt;
&lt;br /&gt;
sGroupID    (int) -  Id of the group to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) The ID of the deleted group&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**Invalid Group ID&lt;br /&gt;
**Error:Survey is active and not editable&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Group deletion failed&lt;br /&gt;
&lt;br /&gt;
==import_group==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to import a group - imports lsg,csv&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  The id of the survey that the group will belong&lt;br /&gt;
&lt;br /&gt;
sImportData     (string) -  String containing the BASE 64 encoded data of a lsg,csv&lt;br /&gt;
&lt;br /&gt;
sGroupDescription (string) -The format of the importfile in the stream (lsg|csv)&lt;br /&gt;
&lt;br /&gt;
sNewGroupName (string) - Optional new name for the group&lt;br /&gt;
&lt;br /&gt;
sNewGroupDescription (string) - Optional new description for the group&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) The ID of the new group&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Error:Survey is active and not editable&lt;br /&gt;
**Invalid extension&lt;br /&gt;
**Error: Invalid LimeSurvey group structure XML&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Import Error&lt;br /&gt;
&lt;br /&gt;
==get_group_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return properties of a group of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iGroupID (integer) -  The id of the group to get properties of&lt;br /&gt;
&lt;br /&gt;
aGroupSettings     (array) -  Array containing the properties to request.&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The requested properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Error: Invalid group ID&lt;br /&gt;
**No valid Data&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| ||&lt;br /&gt;
|-&lt;br /&gt;
|gid||description&lt;br /&gt;
|-&lt;br /&gt;
|sid||language&lt;br /&gt;
|-&lt;br /&gt;
|group_name||randomization_group&lt;br /&gt;
|-&lt;br /&gt;
|group_order||grelevance&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_group_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set properties of a group of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iGroupID (integer) -  The id of the group to set properties to&lt;br /&gt;
&lt;br /&gt;
aGroupData     (array) -  Assosiative Array containing key-value pairs of the properties to set.&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The result of each set action&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Error: Invalid group ID&lt;br /&gt;
**No valid Data&lt;br /&gt;
**Group with dependencies - Order cannot be changed&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
Available properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| ||&lt;br /&gt;
|-&lt;br /&gt;
|||description&lt;br /&gt;
|-&lt;br /&gt;
|||language&lt;br /&gt;
|-&lt;br /&gt;
|group_name||randomization_group&lt;br /&gt;
|-&lt;br /&gt;
|group_order||grelevance&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_groups==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return the ids and info of groups belonging to survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (integer) -  The id of the survey to get groups of&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The list of the groups&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid Survey ID&lt;br /&gt;
**No groups found&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
&lt;br /&gt;
==delete_question==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete a question of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iQuestionID  (int) Id of the question to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int)id of the deleted Question&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
** Invalid question ID&lt;br /&gt;
**Survey is active and not editable&lt;br /&gt;
**Cannot delete Question. Others rely on this question&lt;br /&gt;
**Error&lt;br /&gt;
&lt;br /&gt;
==import_question==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to import a question - imports lsq,csv&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey that the new questions belongs&lt;br /&gt;
&lt;br /&gt;
iGroupID (int) - Id of the group that the new questions belongs&lt;br /&gt;
&lt;br /&gt;
sImportData (string) - String containing the BASE 64 encoded data of a lsg,csv&lt;br /&gt;
&lt;br /&gt;
sImportDataType (string)  - Format of the input stream (lsq,csv)&lt;br /&gt;
&lt;br /&gt;
sMandatory (string) - Optional Mandatory question option (default to No)&lt;br /&gt;
&lt;br /&gt;
sNewQuestionTitle (string) - Optional new title for the question&lt;br /&gt;
&lt;br /&gt;
sNewqQuestion (string) - An optional new question&lt;br /&gt;
&lt;br /&gt;
sNewQuestionHelp (string) - An optional new question help text&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (int) Id of the new Question&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Invalid group ID&lt;br /&gt;
**Survey is active and not editable&lt;br /&gt;
**Invalid extension&lt;br /&gt;
**Invalid LimeSurvey question structure XML&lt;br /&gt;
&lt;br /&gt;
==get_question_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return properties of a question of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string)  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iQuestionID  (int) Id of the question to get properties of&lt;br /&gt;
&lt;br /&gt;
aQuestionSettings (array) The properties to get&lt;br /&gt;
&lt;br /&gt;
sLanguage (string) Optional parameter language for multilingual questions&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The requested properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid questionid&lt;br /&gt;
**Invalid language&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|gid||type||help||language&lt;br /&gt;
|-&lt;br /&gt;
|parent_qid||title||other||scale_id&lt;br /&gt;
|-&lt;br /&gt;
|sid||question||mandatory||same_default&lt;br /&gt;
|-&lt;br /&gt;
|gid||preg||question_order||relevance&lt;br /&gt;
|-&lt;br /&gt;
|subquestions||attributes||attributes_lang||answeroptions&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_question_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set question properties&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iQuestionID  (int) - Id of the question to get properties of&lt;br /&gt;
&lt;br /&gt;
aQuestionData (array)  - An array with the particular fieldnames as keys and their values to set on that particular question&lt;br /&gt;
&lt;br /&gt;
sLanguage (string)  -  Optional parameter language for multilingual questions&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The resilt of the set of each property&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid questionid&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Questions with dependencies - Order cannot be changed&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Properties:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|help|| ||&lt;br /&gt;
|-&lt;br /&gt;
|title||other||scale_id&lt;br /&gt;
|-&lt;br /&gt;
|question||mandatory||same_default&lt;br /&gt;
|-&lt;br /&gt;
|preg||question_order||relevance&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_questions==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return the ids and info of questions of a survey/group.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (int) - Id of the survey to get questions of&lt;br /&gt;
&lt;br /&gt;
iGroupID  (int) - Id of the group to get questions of&lt;br /&gt;
&lt;br /&gt;
sLanguage (string)  -  Optional parameter language for multilingual questions&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) The list of the questions&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid questionid&lt;br /&gt;
**Invalid language&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Missmatch in surveyid and groupid&lt;br /&gt;
**No questions found&lt;br /&gt;
&lt;br /&gt;
==activate_tokens==&lt;br /&gt;
&lt;br /&gt;
Activate tokens&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
session key (string) The session key&lt;br /&gt;
&lt;br /&gt;
surveyid (string) The survey ID&lt;br /&gt;
&lt;br /&gt;
additional_attributes (array of integers) Any additional attribute fields to create. Just give the attribute IDs&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) status OK&lt;br /&gt;
*On failure: (array) Any other status&lt;br /&gt;
&lt;br /&gt;
==add_participants==&lt;br /&gt;
&lt;br /&gt;
Using this function you can add new entries to your token table. You can also set if for these new entries a token key is automatically create&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
*session key (string) - The session key&lt;br /&gt;
*survey ID (string) - The survey id&lt;br /&gt;
*participant data (array) -  2-dimensional array/structure containing your participants data&lt;br /&gt;
*createTokenKey (boolean) - Set this to true if you want a token key create automatically for each entry - if your participant data included a [token] field it will be overwritten&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success:  participant data (struct) -  structure containing your participants data plus the token ID and (if applicable) the new token&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
&lt;br /&gt;
==delete_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to delete multiple participants of a Survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID (int) - Id of the survey to get questions of&lt;br /&gt;
&lt;br /&gt;
aTokenIDs  (array) - IId of the tokens/participants to delete&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of deletion status for each participant&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
&lt;br /&gt;
==get_participant_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return settings of a token/participant of a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the Survey to get token properties&lt;br /&gt;
&lt;br /&gt;
iTokenID (int) - Id of the participant to check&lt;br /&gt;
&lt;br /&gt;
aTokenProperties (array) - The properties to get&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of requested values&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**Invalid tokenid&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Parameters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|tid||   token||   completed&lt;br /&gt;
|-&lt;br /&gt;
| participant_id ||   language||   usesleft&lt;br /&gt;
|-&lt;br /&gt;
|firstname||   blacklisted||   validfrom&lt;br /&gt;
|-&lt;br /&gt;
|   lastname||   sent||   validuntil&lt;br /&gt;
|-&lt;br /&gt;
|email||   remindersent||   mpid&lt;br /&gt;
|-&lt;br /&gt;
|emailstatus||   remindercount||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==set_participant_properties==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to set properties of a survey participant/token&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the Survey to set token properties&lt;br /&gt;
&lt;br /&gt;
iTokenID (int) - Id of the participant to alter&lt;br /&gt;
&lt;br /&gt;
aTokenData (array) - Key - value pair of the properties to set&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of results of changing properties&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**Invalid tokenid&lt;br /&gt;
**No valid Data&lt;br /&gt;
&lt;br /&gt;
Available Parameters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   ||   ||&lt;br /&gt;
|-&lt;br /&gt;
|||   token||   completed&lt;br /&gt;
|-&lt;br /&gt;
| participant_id ||   language||   usesleft&lt;br /&gt;
|-&lt;br /&gt;
|firstname||   blacklisted||   validfrom&lt;br /&gt;
|-&lt;br /&gt;
|   lastname||   sent||   validuntil&lt;br /&gt;
|-&lt;br /&gt;
|email||   remindersent||   mpid&lt;br /&gt;
|-&lt;br /&gt;
|emailstatus||   remindercount||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==list_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to return the ids and info  of token/participants of a survey.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to list participants&lt;br /&gt;
&lt;br /&gt;
iStart (int) - Start id of the token list&lt;br /&gt;
&lt;br /&gt;
iLimit (int) - Number of participants to return&lt;br /&gt;
&lt;br /&gt;
bUnused (bool) - If you want unused tokensm, set true&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Array of Participants info&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**No Tokens found&lt;br /&gt;
&lt;br /&gt;
==activate_tokens==&lt;br /&gt;
&lt;br /&gt;
RPC routine to to initialise the survey&#039;s collection of tokens where new participant tokens may be later added&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to list participants&lt;br /&gt;
&lt;br /&gt;
aAttributeFields (array) - An array of integer describing any additional attribute fields&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array) Status OK&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**Token table could not be created&lt;br /&gt;
&lt;br /&gt;
==invite_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to invite participants in a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to send invitation to participants&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array)  Array of result of each email send action and count of invitations left to send&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**No candidate tokens&lt;br /&gt;
&lt;br /&gt;
==remind_participants==&lt;br /&gt;
&lt;br /&gt;
RPC Routine to send reminder for participants in a survey&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) -  Auth credentials&lt;br /&gt;
&lt;br /&gt;
iSurveyID  (int) - Id of the survey to send invitation to participants&lt;br /&gt;
&lt;br /&gt;
iMinDaysBetween (int) - Optional parameter days from last reminder&lt;br /&gt;
&lt;br /&gt;
iMaxReminders (int) - Optional parameter Maximum reminders count&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: (array)  Array of result of each email send action and count of invitations left to send&lt;br /&gt;
*On failure: (array) Failure status&lt;br /&gt;
**Invalid session key&lt;br /&gt;
**No permission&lt;br /&gt;
**Invalid survey ID&lt;br /&gt;
**No token table&lt;br /&gt;
**No candidate tokens&lt;br /&gt;
&lt;br /&gt;
==add_response==&lt;br /&gt;
&lt;br /&gt;
Using this function you can add new responses to your survey response table.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
*sSessionKey (string) - The session key&lt;br /&gt;
*iSurveyID (integer) - The survey id&lt;br /&gt;
*aResponseData (array) -  array/structure containing your response data&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
*On success: response_id (integer) -  Returns the id of the inserted survey response&lt;br /&gt;
*On failure: (array) with error description&lt;br /&gt;
&lt;br /&gt;
==export_responses==&lt;br /&gt;
&lt;br /&gt;
Export response data to pdf,csv,xls,doc&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
sSessionKey (string) - Auth credentials&lt;br /&gt;
&lt;br /&gt;
SurveyID (int) - Id of the Survey&lt;br /&gt;
&lt;br /&gt;
DocumentType (string) - pdf,csv,xls,doc&lt;br /&gt;
&lt;br /&gt;
sLanguageCode (string) - Optional The language to be used - if not given then the base language will be used&lt;br /&gt;
&lt;br /&gt;
CompletionStatus (string) - Optional &#039;complete&#039;,&#039;incomplete&#039; or &#039;all&#039; selection of responses - defaults to complete&lt;br /&gt;
&lt;br /&gt;
HeadingType (string) - &#039;code&#039;,&#039;full&#039; or &#039;abbreviated&#039;. type of question heading. Optional defaults to &#039;code&#039;&lt;br /&gt;
&lt;br /&gt;
ResponseType (string) - &#039;short&#039; or &#039;long&#039; response type.Optional defaults to &#039;short&#039;&lt;br /&gt;
&lt;br /&gt;
FromResponseID (int) - Optional start number of response&lt;br /&gt;
&lt;br /&gt;
ToResponseID (int) - Optional end number of responses&lt;br /&gt;
&lt;br /&gt;
Return:&lt;br /&gt;
&lt;br /&gt;
On success: Requested file as base 64-encoded string.&lt;br /&gt;
&lt;br /&gt;
On failure: Array with error information&lt;br /&gt;
&lt;br /&gt;
Note: If you have huge response sets try only to request a certain number of records at a time otherwise the server may run out of memory.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
To test you will have to activate JSON-RPC in global settings. To run a simple self-test go to&lt;br /&gt;
&lt;br /&gt;
http://path_to_your_limesurvey_installation/index.php/admin/remotecontrol/test . This will import the example survey, do various things with it and delete it afterwards.&lt;br /&gt;
&lt;br /&gt;
The test assumes that you still are using the standard user &#039;admin&#039; with password &#039;password&#039;.&lt;br /&gt;
&lt;br /&gt;
The client function for this test can be found in /application/controller/admin/remotecontrol.php and the particular function is called test().&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 based on the tiny jsonRPCClient from [http://jsonrpcphp.org/ | jsonrpcphp.org]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once &#039;jsonRPCClient.php&#039;;&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_BASEURL&#039;, &#039;http://localhost/limesurvey/&#039;);  // adjust this one to your actual LimeSurvey URL&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_USER&#039;, &#039;rpcuser&#039; );&lt;br /&gt;
&lt;br /&gt;
define( &#039;LS_PASSWORD&#039;, &#039;mypassword&#039; );&lt;br /&gt;
&lt;br /&gt;
// the survey to process&lt;br /&gt;
&lt;br /&gt;
$survey_id=374699;&lt;br /&gt;
&lt;br /&gt;
// instanciate a new client&lt;br /&gt;
&lt;br /&gt;
$myJSONRPCClient = new jsonRPCClient( LS_BASEURL.&#039;/admin/remotecontrol&#039; );&lt;br /&gt;
&lt;br /&gt;
// receive session key&lt;br /&gt;
&lt;br /&gt;
$sessionKey= $myJSONRPCClient-&amp;gt;get_session_key( LS_USER, LS_PASSWORD );&lt;br /&gt;
&lt;br /&gt;
// receive all ids and info of groups belonging to a given survey&lt;br /&gt;
&lt;br /&gt;
$groups = $myJSONRPCClient-&amp;gt;list_groups( $sessionKey, $survey_id );&lt;br /&gt;
&lt;br /&gt;
print_r($groups, null );&lt;br /&gt;
&lt;br /&gt;
// release the session key&lt;br /&gt;
&lt;br /&gt;
$myJSONRPCClient-&amp;gt;release_session_key( $sessionKey );&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Changes=&lt;br /&gt;
&lt;br /&gt;
2.0a Only three functions are supported right now: getSessionKey, releaseSessionKey, deleteSurvey&lt;br /&gt;
&lt;br /&gt;
2.0b Added function add_participants&lt;br /&gt;
&lt;br /&gt;
2.0RC5 Added import_survey, activate_survey, activate_tokens&lt;br /&gt;
&lt;br /&gt;
2.0 (build 121030) Added subquestions, attributes, attributes_lang and answeroptions properties for get_question_properties&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=URL_fields&amp;diff=3589</id>
		<title>URL fields</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=URL_fields&amp;diff=3589"/>
		<updated>2012-11-14T18:25:34Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
At the end of a survey, or when a quota causes a survey to terminate, there is the option of setting a URL. This URL is presented to the participant who has finished the survey on the completed page, or you can optionally set the participant to be automatically redirected to the URL.&lt;br /&gt;
&lt;br /&gt;
There are a number of fields available to be used to enhance the functionality of this URL.&lt;br /&gt;
&lt;br /&gt;
===Basic fields===&lt;br /&gt;
&lt;br /&gt;
You can use {SAVEDID}, {TOKEN}, {SID} and {LANG} (since 1.71+) in this URL.&lt;br /&gt;
* SAVEDID is the id assigned to this particular submission,&lt;br /&gt;
* TOKEN is the token used to participate in the survey,&lt;br /&gt;
* SID is the survey ID, and&lt;br /&gt;
* LANG is the language code&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
http://www.limesurvey.org/test.php?var1={SAVEDID}&amp;amp;var2;={TOKEN}&amp;amp;var3;={SID}&amp;amp;lang;={LANG} (external link)&lt;br /&gt;
&lt;br /&gt;
===Answer fields===&lt;br /&gt;
&lt;br /&gt;
You can also use {INSERTANS:SGQA} in this URL (since 1.82+).&lt;br /&gt;
* {INSERTANS: SGQA} allows adding the response to a specific question in the survey to the final url. This can be useful for sending a response to an external script (ie an email address collected during the survey).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Expressions===&lt;br /&gt;
&lt;br /&gt;
You can also use any Expression Manager expression (since 1.92+).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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;
&lt;br /&gt;
===Passthrough fields (LimeSurvey 2.x or later)===&lt;br /&gt;
&lt;br /&gt;
Starting with version 2.0 you can now define any additional parameters that should be passed to the end URl in the survey settings (Tab &amp;quot;Panel integration&amp;quot;). To use such a parameter in the end URL just insert the tag {PASSTHRU:&amp;lt;paramname&amp;gt;} where &amp;lt;paramname&amp;gt; is the name of your input parameter.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
You defined in the Panel integration tab a parameter named &#039;foobar&#039;. The survey is started with a link like&lt;br /&gt;
&lt;br /&gt;
  http://localhost/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123&lt;br /&gt;
&lt;br /&gt;
where XYZ123 is the value you want to pass.&lt;br /&gt;
&lt;br /&gt;
A survey exit URL of &amp;quot;http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}&amp;quot; would then convert to &amp;quot;http://www.limesurvey.org/test.php?foobarout=XYZ123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Passthrough fields (LimeSurvey 1.92 and older)===&lt;br /&gt;
&lt;br /&gt;
You can also use a &#039;passthrough&#039; field name and data value in the end URL.&lt;br /&gt;
&lt;br /&gt;
In some instances you may want to pass a value to the survey at initialization, and then have that value passed through to an external script at the end (for example a marketing firms subsid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this case you&#039;d start the survey with the query url &amp;quot;index.php?sid=12345&amp;amp;passthru;=subsid&amp;amp;subsid;=9999&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In your URL you would use {PASSTHRULABEL} and {PASSTHRUVALUE} to reuse these values at the end of the survey.&lt;br /&gt;
&lt;br /&gt;
A URL of &amp;quot;http://www.limesurvey.org/test.php?{PASSTHRULABEL}={PASSTHRUVALUE}&amp;quot; would then convert to &amp;quot;http://www.limesurvey.org/test.php?subsid=9999&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Places to use URL fields===&lt;br /&gt;
&lt;br /&gt;
URL fields can be used in the general survey exit URL (see [[Creating a new survey]] ), and in the URL setting for each individual quota (see [[Quotas]] ).&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=URL_fields&amp;diff=3590</id>
		<title>URL fields</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=URL_fields&amp;diff=3590"/>
		<updated>2012-11-14T18:25:07Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
At the end of a survey, or when a quota causes a survey to terminate, there is the option of setting a URL. This URL is presented to the participant who has finished the survey on the completed page, or you can optionally set the participant to be automatically redirected to the URL.&lt;br /&gt;
&lt;br /&gt;
There are a number of fields available to be used to enhance the functionality of this URL.&lt;br /&gt;
&lt;br /&gt;
===Basic fields===&lt;br /&gt;
&lt;br /&gt;
You can use {SAVEDID}, {TOKEN}, {SID} and {LANG} (since 1.71+) in this URL.&lt;br /&gt;
* SAVEDID is the id assigned to this particular submission,&lt;br /&gt;
* TOKEN is the token used to participate in the survey,&lt;br /&gt;
* SID is the survey ID, and&lt;br /&gt;
* LANG is the language code&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
http://www.limesurvey.org/test.php?var1={SAVEDID}&amp;amp;var2;={TOKEN}&amp;amp;var3;={SID}&amp;amp;lang;={LANG} (external link)&lt;br /&gt;
&lt;br /&gt;
===Answer fields===&lt;br /&gt;
&lt;br /&gt;
You can also use {INSERTANS:SGQA} in this URL (since 1.82+).&lt;br /&gt;
* {INSERTANS: SGQA} allows adding the response to a specific question in the survey to the final url. This can be useful for sending a response to an external script (ie an email address collected during the survey).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Expressions===&lt;br /&gt;
&lt;br /&gt;
You can also use any Expression Manager expression (since 1.92+).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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;
&lt;br /&gt;
===Passthrough fields (LimeSurvey 2.x or later)===&lt;br /&gt;
&lt;br /&gt;
Starting with version 2.0 you can now define any additional parameters that should be passed to the end URl in the survey settings (Tab &amp;quot;Panel integration&amp;quot;). To use such a paramter in the end URL just insert the tag {PASSTHRU:&amp;lt;paramname&amp;gt;} where &amp;lt;paramname&amp;gt; is the name of your input parameter.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
You defined in the Panel integration tab a parameter named &#039;foobar&#039;. The survey is started with a link like&lt;br /&gt;
&lt;br /&gt;
  http://localhost/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123&lt;br /&gt;
&lt;br /&gt;
where XYZ123 is the value you want to pass.&lt;br /&gt;
&lt;br /&gt;
A survey exit URL of &amp;quot;http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}&amp;quot; would then convert to &amp;quot;http://www.limesurvey.org/test.php?foobarout=XYZ123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Passthrough fields (LimeSurvey 1.92 and older)===&lt;br /&gt;
&lt;br /&gt;
You can also use a &#039;passthrough&#039; field name and data value in the end URL.&lt;br /&gt;
&lt;br /&gt;
In some instances you may want to pass a value to the survey at initialization, and then have that value passed through to an external script at the end (for example a marketing firms subsid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this case you&#039;d start the survey with the query url &amp;quot;index.php?sid=12345&amp;amp;passthru;=subsid&amp;amp;subsid;=9999&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In your URL you would use {PASSTHRULABEL} and {PASSTHRUVALUE} to reuse these values at the end of the survey.&lt;br /&gt;
&lt;br /&gt;
A URL of &amp;quot;http://www.limesurvey.org/test.php?{PASSTHRULABEL}={PASSTHRUVALUE}&amp;quot; would then convert to &amp;quot;http://www.limesurvey.org/test.php?subsid=9999&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Places to use URL fields===&lt;br /&gt;
&lt;br /&gt;
URL fields can be used in the general survey exit URL (see [[Creating a new survey]] ), and in the URL setting for each individual quota (see [[Quotas]] ).&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3565</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3565"/>
		<updated>2012-10-02T12:21:46Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use this instruction if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
## The upgrade process try to replace the template.js inclusion by the placeholder {TEMPLATEJS}. If you have javascript issue with your custom template, verify if your template have the placeholder {TEMPLATEJS} in startpage.pstpl.&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be automatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=3358</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=3358"/>
		<updated>2012-09-27T17:08:38Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{maketoc title=&amp;quot;Contents:&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey has a basic template and style system providing a theme-like capability found in many browser-based applications.  They are simply termed &#039;&#039;&#039;Templates&#039;&#039;&#039; here.  The Templates allow control over the look and feel of pages during a survey.  A survey administrator can select the template to use for each survey to thus personalize that survey&#039;s look and feel.  Changes to a Template can be as simple as adding a unique logo on the welcome page, changing background colors, or maybe new text colors for specific types of questions.&lt;br /&gt;
&lt;br /&gt;
LimeSurvey comes with a set of templates right out of the box. These initial templates are defined by directories within the LimeSurvey installation &amp;quot;templates&amp;quot; directory.  Each template has it&#039;s own directory.  Within the main directory of a template are numerous files: &#039;&#039;&#039;templates (.pstpl)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;) and maybe others.&lt;br /&gt;
&lt;br /&gt;
Like in other theme-based systems, fragments of HTML code are stored in the .pstpl template files.  These fragments are read in and used to construct the page to display to the end user during the operation of a survey. Often &#039;&#039;&#039;keywords&#039;&#039;&#039; surrounded by curly braces are included in the files that are then replaced with the relevant text.  The following gives an example of a template file content and its result when used in a survey page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&amp;lt;font face=&#039;verdana&#039; color=&#039;red&#039;&amp;gt;{SURVEYNAME}&amp;lt;/font&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&#039;verdana&#039; color=&#039;blue&#039;&amp;gt;&amp;lt;u&amp;gt;{SURVEYDESCRIPTION}&amp;lt;/u&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One gets a result that looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&#039;&#039;&#039;&amp;lt;span style=&#039;color:red&#039;&amp;gt;My New Survey&amp;lt;/span&amp;gt;&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;u&amp;gt;&amp;lt;span style=&#039;color:#0000ff&#039;&amp;gt;This is a survey written by me to find out what sort of chocolate people like.&amp;lt;/span&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Templates, being HTML code, tend to define the positioning and type of text to be displayed and similar structural features of the page.  They often reference or include other files.  Most reference a common cascading style sheets (CSS) file that defines the font style, color, size, background and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code.  This allows the style sheet to describe once how to display each of the many types of text or other objects that may appear in multiple places.  There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each.  Image files, like logos or special progress-bar constructors, may be referenced as well in the Template file.  Finally, special Keywords in curly braces are replaced with text defined in the Survey for each of its corresponding language translations (for example, the Survey Title or Question Text for each language defined).&lt;br /&gt;
&lt;br /&gt;
If you create a new custom template, please consider contributing it back to the LimeSurvey community, and make it available to others. With your help, we can grow our repository of templates, surveys, and other ad-ons, to make LimeSurvey even better! See the shared [http://www.limesurvey.org/component/remository/lang,en-gb/ Template Repository]&lt;br /&gt;
&lt;br /&gt;
=Creating a new Template=&lt;br /&gt;
&lt;br /&gt;
To be able to create a new template (or edit an existing template), you need Template Editing user permission in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039; As template changes can affect all surveys in an installation, changes should be limited to those skilled in understanding general concepts in the code base. Templates are an advanced feature that can take some experimentation to get correct if you are not familiar with HTML code methods.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The preferred way to create a new template is through the Template Editor (see below) via the web Admin interface. Some people may like to work directly with template files so that they can use their favorite text editor instead of the web interface. In this case, still use the Template Editor to first create your new template. This will create a new base template with all the files you need in the LimeSurvey_web_root/upload/templates/your_new_template directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these template files will be owned by the group and user who the web server is running as (may be &amp;quot;www&amp;quot; for some systems). So make sure you have access to edit these files, and when you save them make sure they don&#039;t change ownership, so you can still use the web Template Editing interface if needed&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Template files may seem complex to understand at first. You have to likely understand HTML code, possibly Styles and Style Sheets, and have access to the underlying LimeSurvey installation files if the template files and directories are not editable. Copy an existing template to a new directory to play around with the content. This may help make the concept clearer.&lt;br /&gt;
&lt;br /&gt;
A number of the &#039;public&#039; elements of LimeSurvey can be adjusted by a series of templates. This section provides a very brief explanation of these templates, however more detailed information - especially regarding the editing/creation of new templates is available under [[Templates + Styles]].&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey Template Editor=&lt;br /&gt;
&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application.  This Template Editor is only available to users given the privilege in the User Security settings.  A template effects all surveys and can render a survey inoperable if not constructed properly.  So Template editing is thought best restricted to a very limited, knowledgeable set of users.  Having permission to enter the Template Editor is not enough though.&lt;br /&gt;
&lt;br /&gt;
The LimeSurvey Template Editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on the &amp;quot;Template Editor&amp;quot; icon [[File:templates.png]] in the LimeSurvey Administration toolbar (Templates). The main screen is similar to the LimeSurvey Survey Administration screen. It allows you to select the template to edit/view. Once this has been selected you can then select from one of the different public survey pages. You are then presented with a list of the template files that make up that particular page.&lt;br /&gt;
&lt;br /&gt;
==The Template Menu==&lt;br /&gt;
*&#039;&#039;&#039;Edit Icon:&#039;&#039;&#039; The &amp;quot;edit&amp;quot; icon indicates whether or not the template is editable. A blurred out icon indicates that the template is read only; a clickable icon indicates you may make modifications. To change the icon from blurred to clear, you have to modify the template&#039;s permissions.&lt;br /&gt;
*&#039;&#039;&#039;Rename this template:&#039;&#039;&#039; Allows you to change the name of the template.  Generally used after copying an existing template or importing a template by manipulating the underlying directories.&lt;br /&gt;
*&#039;&#039;&#039;Export Template:&#039;&#039;&#039; Allows you to export the current template to a .zip-File.&lt;br /&gt;
*&#039;&#039;&#039;Copy Template:&#039;&#039;&#039; Allows you to make a new template by copying the current one.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Screen&amp;quot; drop-down list on the right allows you to choose which particular survey page you are currently looking at.&lt;br /&gt;
&lt;br /&gt;
==Import/Export/Copy a Template==&lt;br /&gt;
&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, this will create a zip-file archive with all the files your template consists of (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import &#039;&#039;&#039;the exported zip-file at other Limesurvey systems by using the import feature or you can manually copy the archive to another installation and extract it into the corresponding template directory there. If you copy the template in the same installation, you will need to rename the folder to create another named copy of that template.&lt;br /&gt;
&lt;br /&gt;
If the file and directory permissions are open for the LimeSurvey application to write, then you can use the programs &#039;&#039;&#039;copy &#039;&#039;&#039;and rename features to make a local copy of a template.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use==&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Submit Page:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, submit.pstpl, (privacy.pstpl), navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files==&lt;br /&gt;
&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag, even though many browsers do not require strict adherence to the W3 HTML stanards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag, to run certain javascript elements. It is not expected that many &#039;keywords&#039; will be used in the startpage.pstpl file, however you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file, so you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages, and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (ie: don&#039;t leave a table open here because there is nowhere else to close it)&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. It is separate to the startgroup.pstpl file because in a &amp;quot;question by question&amp;quot; survey it will be displayed on its own unique page in between groups, whereas in a &amp;quot;group by group&amp;quot; or &amp;quot;all in one&amp;quot; survey it provides a header to the subsequent questions. groupdescription.pstpl does not have a corresponding &#039;closing&#039; template file, so all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer and help text sections of your survey, and in the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LS1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. NOTE: templates using question_start.pstpl will still work at least for a couple more versions of LS 1.x&lt;br /&gt;
*&#039;&#039;&#039;submit.pstpl (and privacy.pstpl):&#039;&#039;&#039; This page is the penultimate page for all types of survey (except the &amp;quot;all in one&amp;quot; type) where the participant is given an option to review questions before submitting their responses. It provides privacy information where a survey is anonymous, which it extracts from the &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039; file.&lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl endgroup.pstpl but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript==&lt;br /&gt;
&lt;br /&gt;
Two files are allways used for template : template.css for css and template.js for javascript.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default css or javascript===&lt;br /&gt;
&lt;br /&gt;
Some question use specific files for javascript or css. You can use your own files. All files used in your survey included in ./scripts or in .//styles-public can be replaced, just put a file with the same name in your template.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039; and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages==&lt;br /&gt;
&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the survey&#039;s settings.  The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  &#039;&#039;&#039;Survey Pages:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;||Survey&amp;lt;br/&amp;gt;List||Welcome||Question||Completed||Clear All||Register||Load||Save||Print&amp;lt;br/&amp;gt;Answers||Print&amp;lt;br/&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList|| [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| || [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| || [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| || [[File:check.gif]]|| [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || || [[File:check.gif]]|| || || [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || || [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || || [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || || [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || || [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || || [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || || [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || || [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || || [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || || [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || || [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br/&amp;gt;EndPage&amp;lt;br/&amp;gt;Template.css|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In versions 1.90 and up this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included by the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in your one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section==&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Other Files&amp;quot; window shows a list of all other files in the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. Note: Instead of a link directly to each picture in your template you can use the field string {TEMPLATEURL}.  So instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; You can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible at the bottom of the screen. There is no way to to delete a template from the template editor. This must be done by accessing the underlying directory and deleting the file there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the Template Editor and should never be changed. If you want to modify them, create a copy first and modify the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location of template files==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the /templates directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the /upload/templates directory.&lt;br /&gt;
&lt;br /&gt;
To create a new template, use the according icon in the template editor.&lt;br /&gt;
&lt;br /&gt;
There should ALWAYS be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. The &amp;quot;default&amp;quot; directory comes with the package.&lt;br /&gt;
&lt;br /&gt;
You can use any image files that you upload into the template management area with syntax like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS=&lt;br /&gt;
&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type now has a unique class. Mandatory question&#039;s also have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and if the question is mandatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and if the question is mandatory but the user didn&#039;t answer it or if there is validation on a question&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and if the question has validation applied but the user hasn&#039;t answered correctly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (flexible labels) (dropdown)||.list-dropdown-flexible||W&lt;br /&gt;
|-&lt;br /&gt;
|List (flexible labels) (radio)||.list-radio-flexible||Z&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
The .hide-tip option and .input-error options, by default, interact so that you can have validation tips start hidden, but appear when there validation errors, and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages.  Instead, tips can appear/disappear as needed, and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been med; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template==&lt;br /&gt;
&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
  START: Question styles  &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt; */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re styling your own custom template, You should be able to copy everything after the above from templates/default/template.css (for tables based layouts) or /templates/limespired/template.css (for CSS based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets==&lt;br /&gt;
&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6, IE7 and most other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either /templates/default/ or /templates/limespired for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer===&lt;br /&gt;
&lt;br /&gt;
You can put conditional class for body in startpage.pstpl, and use this class in your template.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in template.css use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.ie6{/*specific for internet explorer */}&lt;br /&gt;
&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see this alternative in citronade template.&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify==&lt;br /&gt;
&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL Text. However, the editor itself shows the RTL language in a left to right format when justified.  This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords==&lt;br /&gt;
&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}&lt;br /&gt;
&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;::KEYWORD::&#039;&#039;&#039;|| &#039;&#039;&#039;TEMPLATE FILES::&#039;&#039;&#039; || &#039;&#039;&#039;::DESCRIPTION::&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded but the {QUESTION_...} keywords as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE} and {QUESTION_INPUT_ERROR_CLASS} and appropriate wrapping HTML instead of {QUESTION})&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself, to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITBUTTON}||submit.pstpl||Displays the final submit button&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; messagem for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACY}||submit.pstpl||Displays privacy information when survey is anonymous&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [http://docs.limesurvey.org/tiki-index.php?page=LimeSurvey+1.x+Translating+LimeSurvey The text can be edited/translated] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{CLOSEWINDOW}||All Files (Preferably in navigator.pstpl)||URL to close current window&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons==&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file, and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes (these are set by relevant section above) but does allow changing of background colour, text colour and size etc for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally you should use this to make sure that their font size and colour is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background colour for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the colour and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the colour and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
An example of using these classes with style sheets can be found in the &amp;quot;bubblegum&amp;quot; template that comes with the LimeSurvey application.&lt;br /&gt;
&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &amp;lt;div class=&#039;new_name&#039;&amp;gt; and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before version 1.87:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chart.jpg file is a simple one pixel image file which is used to create the progress bar image in the &#039;PERCENTCOMPLETE&#039; table. If the file does not exist, LimeSurvey will use the default &#039;maroon&#039; coloured image in the public directory. If you want to create a bar to match your own colour scheme, then you should save the color in this file. Remember it should be a &#039;&#039;&#039;JPEG&#039;&#039;&#039; file, 1 pixel x 1 pixel, in the colour desired.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Version 1.87 and newer:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
To change the background colour of the bar, add something like the following to the end of your template.css file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the border colour of the bar, add something like the following to the end of your template.css file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers==&lt;br /&gt;
&lt;br /&gt;
Starting with version 0.99, LimeSurvey has integrated some user-made patches that allow for some special changes.  These very advanced features generally require changes to the underlying code base of LimeSurvey and should be done carefully so as not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Basic CMS Integration support===&lt;br /&gt;
&lt;br /&gt;
To be able to integrate LimeSurvey into another CMS, use the following options in &#039;&#039;&#039;config.php&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
// Set $embedded to true and specify the header and footer functions if the survey is to be displayed embedded in a CMS&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$embedded = false;&lt;br /&gt;
&lt;br /&gt;
$embedded_inc = &amp;quot;&amp;quot;;               // path to the header to include if any&lt;br /&gt;
&lt;br /&gt;
$embedded_headerfunc = &amp;quot;&amp;quot;;        // e.g. COM_siteHeader for geeklog&lt;br /&gt;
&lt;br /&gt;
$embedded_footerfunc = &amp;quot;&amp;quot;;        // e.g. COM_siteFooter for geeklog&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;$embedded = true;&#039;&#039;&#039; to enable CMS-embedding. By using the &#039;&#039;&#039;$embedded_inc&#039;&#039;&#039; variable one can include their own &#039;&#039;&#039;.php&#039;&#039;&#039; files.  By setting &#039;&#039;&#039;$embedded_headerfunc&#039;&#039;&#039; or &#039;&#039;&#039;$embedded_footerfunc&#039;&#039;&#039;, one can call functions from within included files that output the relevant headers or footers instead of LimeSurveys default ones.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions===&lt;br /&gt;
&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so.  This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling each.  This way a template author can create their own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Version 1.87 and newer:&#039;&#039;&#039;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
*There are more details in the [http://docs.limesurvey.org/tiki-index.php?page=Workarounds%3A+Manipulating+a+survey+at+runtime+using+Javascript&amp;amp;structure;=English+Instructions+for+LimeSurvey#How_to_use_Script_eg._JavaScript_etc._in_LimeSurvey_ workaround section].&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates=&lt;br /&gt;
&lt;br /&gt;
These videos will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, customizing survey description page, and completed page.&lt;br /&gt;
&lt;br /&gt;
Part I&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;nLsfxMjRXyk?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part II&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;yrAXStFH34Q?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part III&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;TYlJXHgt8R0?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part IV&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;Rml0gqeErVc?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part V&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;LX24Ix1ylmY?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part VI&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;-202CqQcW8g?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks=&lt;br /&gt;
&lt;br /&gt;
==Some language specific element==&lt;br /&gt;
&lt;br /&gt;
If you want to have some langage specific sentence in a survey, for example an help at end of each page, you can add in a .pstl file a sentence and hidding it for other langage. ANd hidding it in the template.css, we can use psuedo selector :lang, but for best compatibility, we use some class.&lt;br /&gt;
&lt;br /&gt;
Example for a help sentence at bottom of the page, in french an english, put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ans in template.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use it to for other sentence in your question before 1.92 ( in 1.92, there are better solutions).&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page==&lt;br /&gt;
&lt;br /&gt;
When editing a template this template can be assigned to a single survey while the survey list page, which is shown at www.yourdomain.org/limesurveyinstallfolder, lists all your surveys.&lt;br /&gt;
&lt;br /&gt;
To use your current template for this page you have change the according setting at the Global Settings screen; at older versions this change can be done by editing the $defaulttemplate setting at the config file: Copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to $defaulttemplate = &#039;yourtemplatename&#039;;&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users==&lt;br /&gt;
&lt;br /&gt;
Mac users, please note: Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
a work around is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
or scripts in their mac-compiled counterparts:&lt;br /&gt;
&lt;br /&gt;
http://homepage.mac.com/roger_jolly/software/&lt;br /&gt;
&lt;br /&gt;
==Changing your templates traffic light from red to green==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, set the admin directory to read/write/execute (777). The files within it, however, may be set to read/execute only (chmod 755).&lt;br /&gt;
&lt;br /&gt;
GO to file directory ie file manager, find templates directory.&lt;br /&gt;
&lt;br /&gt;
1 change permission on eg&amp;quot;vallendar&amp;quot; (or any template of your choice) directory to read 777&lt;br /&gt;
&lt;br /&gt;
2 voila! the red traffic light on &amp;quot;vallendar&amp;quot; is now green.&lt;br /&gt;
&lt;br /&gt;
3 NOTE: to restrict access for safety, when finished editing template files, change all templates files back to what they were eg 644&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon==&lt;br /&gt;
&lt;br /&gt;
When a question help text is shown then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It then will be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Before uploading new logo delete previous one.&lt;br /&gt;
&lt;br /&gt;
1. To edit logo go to &amp;amp;bdquo;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&amp;amp;rdquo;, you can find it here (see in screen):&lt;br /&gt;
&lt;br /&gt;
[[File:1.PNG]]&lt;br /&gt;
&lt;br /&gt;
2. Find and Click Search button, to find place where is logo style text.&lt;br /&gt;
&lt;br /&gt;
[[File:2.PNG]]&lt;br /&gt;
&lt;br /&gt;
3. Find in search &amp;lt;u&amp;gt;#logo&amp;lt;/u&amp;gt; (It is logo design code)&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
&lt;br /&gt;
4. Edit style file&lt;br /&gt;
&lt;br /&gt;
You will see something like this code:&lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]] &lt;br /&gt;
&lt;br /&gt;
If you want change image just replace logo.gif to antoher image link. Like: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt;, &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;, &amp;lt;u&amp;gt;logo.swf&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
If you want change image size just change, width and height (in pixels) like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;Width:100px; Height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo==&lt;br /&gt;
&lt;br /&gt;
1. Find and Open &amp;amp;bdquo;&amp;lt;u&amp;gt;startpage.pstpl&amp;lt;/u&amp;gt;&amp;amp;rdquo; template file.&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]] &lt;br /&gt;
&lt;br /&gt;
2. Write in &amp;amp;bdquo;&amp;lt;u&amp;gt;startpage.pstpl&amp;lt;/u&amp;gt;&amp;amp;rdquo; this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img id=&amp;amp;rdquo;page_logo&amp;amp;rdquo; src=&amp;amp;rdquo;{TEMPLATEURL}logo.png&amp;amp;rdquo;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/syntaxhighlight&amp;gt; After &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;body ... &amp;gt;&amp;lt;/syntaxhighlight&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]] &lt;br /&gt;
&lt;br /&gt;
3. To add logo go to &amp;amp;bdquo;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&amp;amp;rdquo;, you can find it here (see in screen):&lt;br /&gt;
&lt;br /&gt;
[[File:1.PNG]]&lt;br /&gt;
&lt;br /&gt;
3.1 Go to end of &amp;amp;bdquo;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&amp;amp;rdquo; style file.&lt;br /&gt;
&lt;br /&gt;
3.2 Write in end:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want in left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#page_logo{&lt;br /&gt;
&lt;br /&gt;
   float:left;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want in right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#page_logo{&lt;br /&gt;
&lt;br /&gt;
   float:right;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want in center:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#page_logo{&lt;br /&gt;
&lt;br /&gt;
   display: block;&lt;br /&gt;
&lt;br /&gt;
   margin-left: auto;&lt;br /&gt;
&lt;br /&gt;
   margin-right: auto;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos==&lt;br /&gt;
&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip)==&lt;br /&gt;
&lt;br /&gt;
There are 2 solution to remove the default help, like a [[Advanced question settings|#hide_tip|hide_tip attribute]] but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and is container from the file question.pstl, but it can be a bad idea for screenreader.&lt;br /&gt;
# for the default template and some other , add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon==&lt;br /&gt;
&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template directory&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages==&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;Version 1.91 and newer&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages) you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your css file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
example from default template of LimeSurvey 1.91+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To &#039;&#039;&#039;not&#039;&#039;&#039; differentiate even and odd pages at the (default) template find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array==&lt;br /&gt;
&lt;br /&gt;
To create a vertical separator border for a dual scale array you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
header_separator is used to adress the separator for the header &amp;quot;td&amp;quot; and &amp;quot;dual_scale_separator&amp;quot; is used to adress the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list==&lt;br /&gt;
&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; meassage on the start page (with the survey list) you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages==&lt;br /&gt;
&lt;br /&gt;
If you want to remove the survey contact message from error messages it&#039;ll be trickier. You can add the following function call to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&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;
It will probably not work for an englisch survey and have to be extended when using for multilingual surveys. But it&#039;s an idea/tip how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes (before version 2.0 at which those were added)==&lt;br /&gt;
&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at Limesurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the template.css of your template (at /limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css) add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=3359</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=3359"/>
		<updated>2012-09-27T17:03:54Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{maketoc title=&amp;quot;Contents:&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
LimeSurvey has a basic template and style system providing a theme-like capability found in many browser-based applications.  They are simply termed &#039;&#039;&#039;Templates&#039;&#039;&#039; here.  The Templates allow control over the look and feel of pages during a survey.  A survey administrator can select the template to use for each survey to thus personalize that survey&#039;s look and feel.  Changes to a Template can be as simple as adding a unique logo on the welcome page, changing background colors, or maybe new text colors for specific types of questions.&lt;br /&gt;
&lt;br /&gt;
LimeSurvey comes with a set of templates right out of the box. These initial templates are defined by directories within the LimeSurvey installation &amp;quot;templates&amp;quot; directory.  Each template has it&#039;s own directory.  Within the main directory of a template are numerous files: &#039;&#039;&#039;templates (.pstpl)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;) and maybe others.&lt;br /&gt;
&lt;br /&gt;
Like in other theme-based systems, fragments of HTML code are stored in the .pstpl template files.  These fragments are read in and used to construct the page to display to the end user during the operation of a survey. Often &#039;&#039;&#039;keywords&#039;&#039;&#039; surrounded by curly braces are included in the files that are then replaced with the relevant text.  The following gives an example of a template file content and its result when used in a survey page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&amp;lt;font face=&#039;verdana&#039; color=&#039;red&#039;&amp;gt;{SURVEYNAME}&amp;lt;/font&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font face=&#039;verdana&#039; color=&#039;blue&#039;&amp;gt;&amp;lt;u&amp;gt;{SURVEYDESCRIPTION}&amp;lt;/u&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One gets a result that looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&#039;&#039;&#039;&amp;lt;span style=&#039;color:red&#039;&amp;gt;My New Survey&amp;lt;/span&amp;gt;&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;u&amp;gt;&amp;lt;span style=&#039;color:#0000ff&#039;&amp;gt;This is a survey written by me to find out what sort of chocolate people like.&amp;lt;/span&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Templates, being HTML code, tend to define the positioning and type of text to be displayed and similar structural features of the page.  They often reference or include other files.  Most reference a common cascading style sheets (CSS) file that defines the font style, color, size, background and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code.  This allows the style sheet to describe once how to display each of the many types of text or other objects that may appear in multiple places.  There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each.  Image files, like logos or special progress-bar constructors, may be referenced as well in the Template file.  Finally, special Keywords in curly braces are replaced with text defined in the Survey for each of its corresponding language translations (for example, the Survey Title or Question Text for each language defined).&lt;br /&gt;
&lt;br /&gt;
If you create a new custom template, please consider contributing it back to the LimeSurvey community, and make it available to others. With your help, we can grow our repository of templates, surveys, and other ad-ons, to make LimeSurvey even better! See the shared [http://www.limesurvey.org/component/remository/lang,en-gb/ Template Repository]&lt;br /&gt;
&lt;br /&gt;
=Creating a new Template=&lt;br /&gt;
&lt;br /&gt;
To be able to create a new template (or edit an existing template), you need Template Editing user permission in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039; As template changes can affect all surveys in an installation, changes should be limited to those skilled in understanding general concepts in the code base. Templates are an advanced feature that can take some experimentation to get correct if you are not familiar with HTML code methods.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The preferred way to create a new template is through the Template Editor (see below) via the web Admin interface. Some people may like to work directly with template files so that they can use their favorite text editor instead of the web interface. In this case, still use the Template Editor to first create your new template. This will create a new base template with all the files you need in the LimeSurvey_web_root/upload/templates/your_new_template directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these template files will be owned by the group and user who the web server is running as (may be &amp;quot;www&amp;quot; for some systems). So make sure you have access to edit these files, and when you save them make sure they don&#039;t change ownership, so you can still use the web Template Editing interface if needed&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Template files may seem complex to understand at first. You have to likely understand HTML code, possibly Styles and Style Sheets, and have access to the underlying LimeSurvey installation files if the template files and directories are not editable. Copy an existing template to a new directory to play around with the content. This may help make the concept clearer.&lt;br /&gt;
&lt;br /&gt;
A number of the &#039;public&#039; elements of LimeSurvey can be adjusted by a series of templates. This section provides a very brief explanation of these templates, however more detailed information - especially regarding the editing/creation of new templates is available under [[Templates + Styles]].&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey Template Editor=&lt;br /&gt;
&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application.  This Template Editor is only available to users given the privilege in the User Security settings.  A template effects all surveys and can render a survey inoperable if not constructed properly.  So Template editing is thought best restricted to a very limited, knowledgeable set of users.  Having permission to enter the Template Editor is not enough though.&lt;br /&gt;
&lt;br /&gt;
The LimeSurvey Template Editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on the &amp;quot;Template Editor&amp;quot; icon [[File:templates.png]] in the LimeSurvey Administration toolbar (Templates). The main screen is similar to the LimeSurvey Survey Administration screen. It allows you to select the template to edit/view. Once this has been selected you can then select from one of the different public survey pages. You are then presented with a list of the template files that make up that particular page.&lt;br /&gt;
&lt;br /&gt;
==The Template Menu==&lt;br /&gt;
*&#039;&#039;&#039;Edit Icon:&#039;&#039;&#039; The &amp;quot;edit&amp;quot; icon indicates whether or not the template is editable. A blurred out icon indicates that the template is read only; a clickable icon indicates you may make modifications. To change the icon from blurred to clear, you have to modify the template&#039;s permissions.&lt;br /&gt;
*&#039;&#039;&#039;Rename this template:&#039;&#039;&#039; Allows you to change the name of the template.  Generally used after copying an existing template or importing a template by manipulating the underlying directories.&lt;br /&gt;
*&#039;&#039;&#039;Export Template:&#039;&#039;&#039; Allows you to export the current template to a .zip-File.&lt;br /&gt;
*&#039;&#039;&#039;Copy Template:&#039;&#039;&#039; Allows you to make a new template by copying the current one.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Screen&amp;quot; drop-down list on the right allows you to choose which particular survey page you are currently looking at.&lt;br /&gt;
&lt;br /&gt;
==Import/Export/Copy a Template==&lt;br /&gt;
&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, this will create a zip-file archive with all the files your template consists of (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import &#039;&#039;&#039;the exported zip-file at other Limesurvey systems by using the import feature or you can manually copy the archive to another installation and extract it into the corresponding template directory there. If you copy the template in the same installation, you will need to rename the folder to create another named copy of that template.&lt;br /&gt;
&lt;br /&gt;
If the file and directory permissions are open for the LimeSurvey application to write, then you can use the programs &#039;&#039;&#039;copy &#039;&#039;&#039;and rename features to make a local copy of a template.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use==&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Submit Page:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, submit.pstpl, (privacy.pstpl), navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files==&lt;br /&gt;
&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag, even though many browsers do not require strict adherence to the W3 HTML stanards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag, to run certain javascript elements. It is not expected that many &#039;keywords&#039; will be used in the startpage.pstpl file, however you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file, so you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages, and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (ie: don&#039;t leave a table open here because there is nowhere else to close it)&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. It is separate to the startgroup.pstpl file because in a &amp;quot;question by question&amp;quot; survey it will be displayed on its own unique page in between groups, whereas in a &amp;quot;group by group&amp;quot; or &amp;quot;all in one&amp;quot; survey it provides a header to the subsequent questions. groupdescription.pstpl does not have a corresponding &#039;closing&#039; template file, so all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer and help text sections of your survey, and in the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LS1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. NOTE: templates using question_start.pstpl will still work at least for a couple more versions of LS 1.x&lt;br /&gt;
*&#039;&#039;&#039;submit.pstpl (and privacy.pstpl):&#039;&#039;&#039; This page is the penultimate page for all types of survey (except the &amp;quot;all in one&amp;quot; type) where the participant is given an option to review questions before submitting their responses. It provides privacy information where a survey is anonymous, which it extracts from the &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039; file.&lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl endgroup.pstpl but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript==&lt;br /&gt;
&lt;br /&gt;
Two files are allways used for template : template.css for css and template.js for javascript.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default css or javascript===&lt;br /&gt;
&lt;br /&gt;
Some question use specific files for javascript or css. You can use your own files. All files used in your survey included in ./scripts or in .//styles-public can be replaced, just put a file with the same name in your template.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039; and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages==&lt;br /&gt;
&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the survey&#039;s settings.  The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  &#039;&#039;&#039;Survey Pages:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;||Survey&amp;lt;br/&amp;gt;List||Welcome||Question||Completed||Clear All||Register||Load||Save||Print&amp;lt;br/&amp;gt;Answers||Print&amp;lt;br/&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList|| [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| || [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| || [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| || [[File:check.gif]]|| [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || || [[File:check.gif]]|| || || [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || || [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || || [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || || [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || || [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || || [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || || [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || || [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || || [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || || [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || || [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || || [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br/&amp;gt;EndPage&amp;lt;br/&amp;gt;Template.css|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In versions 1.90 and up this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The File Control Section==&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Other Files&amp;quot; window shows a list of all other files in the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. Note: Instead of a link directly to each picture in your template you can use the field string {TEMPLATEURL}.  So instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; You can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible at the bottom of the screen. There is no way to to delete a template from the template editor. This must be done by accessing the underlying directory and deleting the file there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the Template Editor and should never be changed. If you want to modify them, create a copy first and modify the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location of template files==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the /templates directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the /upload/templates directory.&lt;br /&gt;
&lt;br /&gt;
To create a new template, use the according icon in the template editor.&lt;br /&gt;
&lt;br /&gt;
There should ALWAYS be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. The &amp;quot;default&amp;quot; directory comes with the package.&lt;br /&gt;
&lt;br /&gt;
You can use any image files that you upload into the template management area with syntax like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS=&lt;br /&gt;
&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type now has a unique class. Mandatory question&#039;s also have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and if the question is mandatory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and if the question is mandatory but the user didn&#039;t answer it or if there is validation on a question&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and if the question has validation applied but the user hasn&#039;t answered correctly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (flexible labels) (dropdown)||.list-dropdown-flexible||W&lt;br /&gt;
|-&lt;br /&gt;
|List (flexible labels) (radio)||.list-radio-flexible||Z&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
The .hide-tip option and .input-error options, by default, interact so that you can have validation tips start hidden, but appear when there validation errors, and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages.  Instead, tips can appear/disappear as needed, and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been med; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template==&lt;br /&gt;
&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;----&lt;br /&gt;
&lt;br /&gt;
  START: Question styles  &amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt;&amp;lt;strike&amp;gt;-&amp;lt;/strike&amp;gt; */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re styling your own custom template, You should be able to copy everything after the above from templates/default/template.css (for tables based layouts) or /templates/limespired/template.css (for CSS based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets==&lt;br /&gt;
&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6, IE7 and most other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either /templates/default/ or /templates/limespired for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer===&lt;br /&gt;
&lt;br /&gt;
You can put conditional class for body in startpage.pstpl, and use this class in your template.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in template.css use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.ie6{/*specific for internet explorer */}&lt;br /&gt;
&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see this alternative in citronade template.&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify==&lt;br /&gt;
&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL Text. However, the editor itself shows the RTL language in a left to right format when justified.  This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords==&lt;br /&gt;
&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}&lt;br /&gt;
&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;::KEYWORD::&#039;&#039;&#039;|| &#039;&#039;&#039;TEMPLATE FILES::&#039;&#039;&#039; || &#039;&#039;&#039;::DESCRIPTION::&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded but the {QUESTION_...} keywords as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE} and {QUESTION_INPUT_ERROR_CLASS} and appropriate wrapping HTML instead of {QUESTION})&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself, to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITBUTTON}||submit.pstpl||Displays the final submit button&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; messagem for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACY}||submit.pstpl||Displays privacy information when survey is anonymous&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [http://docs.limesurvey.org/tiki-index.php?page=LimeSurvey+1.x+Translating+LimeSurvey The text can be edited/translated] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{CLOSEWINDOW}||All Files (Preferably in navigator.pstpl)||URL to close current window&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons==&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file, and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes (these are set by relevant section above) but does allow changing of background colour, text colour and size etc for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally you should use this to make sure that their font size and colour is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background colour for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the colour and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the colour and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
An example of using these classes with style sheets can be found in the &amp;quot;bubblegum&amp;quot; template that comes with the LimeSurvey application.&lt;br /&gt;
&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &amp;lt;div class=&#039;new_name&#039;&amp;gt; and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Before version 1.87:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chart.jpg file is a simple one pixel image file which is used to create the progress bar image in the &#039;PERCENTCOMPLETE&#039; table. If the file does not exist, LimeSurvey will use the default &#039;maroon&#039; coloured image in the public directory. If you want to create a bar to match your own colour scheme, then you should save the color in this file. Remember it should be a &#039;&#039;&#039;JPEG&#039;&#039;&#039; file, 1 pixel x 1 pixel, in the colour desired.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Version 1.87 and newer:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
To change the background colour of the bar, add something like the following to the end of your template.css file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the border colour of the bar, add something like the following to the end of your template.css file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers==&lt;br /&gt;
&lt;br /&gt;
Starting with version 0.99, LimeSurvey has integrated some user-made patches that allow for some special changes.  These very advanced features generally require changes to the underlying code base of LimeSurvey and should be done carefully so as not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Basic CMS Integration support===&lt;br /&gt;
&lt;br /&gt;
To be able to integrate LimeSurvey into another CMS, use the following options in &#039;&#039;&#039;config.php&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
// Set $embedded to true and specify the header and footer functions if the survey is to be displayed embedded in a CMS&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$embedded = false;&lt;br /&gt;
&lt;br /&gt;
$embedded_inc = &amp;quot;&amp;quot;;               // path to the header to include if any&lt;br /&gt;
&lt;br /&gt;
$embedded_headerfunc = &amp;quot;&amp;quot;;        // e.g. COM_siteHeader for geeklog&lt;br /&gt;
&lt;br /&gt;
$embedded_footerfunc = &amp;quot;&amp;quot;;        // e.g. COM_siteFooter for geeklog&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;$embedded = true;&#039;&#039;&#039; to enable CMS-embedding. By using the &#039;&#039;&#039;$embedded_inc&#039;&#039;&#039; variable one can include their own &#039;&#039;&#039;.php&#039;&#039;&#039; files.  By setting &#039;&#039;&#039;$embedded_headerfunc&#039;&#039;&#039; or &#039;&#039;&#039;$embedded_footerfunc&#039;&#039;&#039;, one can call functions from within included files that output the relevant headers or footers instead of LimeSurveys default ones.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions===&lt;br /&gt;
&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so.  This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling each.  This way a template author can create their own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Version 1.87 and newer:&#039;&#039;&#039;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
*There are more details in the [http://docs.limesurvey.org/tiki-index.php?page=Workarounds%3A+Manipulating+a+survey+at+runtime+using+Javascript&amp;amp;structure;=English+Instructions+for+LimeSurvey#How_to_use_Script_eg._JavaScript_etc._in_LimeSurvey_ workaround section].&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates=&lt;br /&gt;
&lt;br /&gt;
These videos will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, customizing survey description page, and completed page.&lt;br /&gt;
&lt;br /&gt;
Part I&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;nLsfxMjRXyk?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part II&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;yrAXStFH34Q?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part III&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;TYlJXHgt8R0?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part IV&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;Rml0gqeErVc?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part V&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;LX24Ix1ylmY?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
Part VI&lt;br /&gt;
&lt;br /&gt;
{YOUTUBE(movie=&amp;quot;-202CqQcW8g?fs=1&amp;amp;amp;hl=en_US&amp;amp;amp;rel=0&amp;quot;,width=&amp;quot;640&amp;quot;,height=&amp;quot;385&amp;quot;)}{YOUTUBE}&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks=&lt;br /&gt;
&lt;br /&gt;
==Some language specific element==&lt;br /&gt;
&lt;br /&gt;
If you want to have some langage specific sentence in a survey, for example an help at end of each page, you can add in a .pstl file a sentence and hidding it for other langage. ANd hidding it in the template.css, we can use psuedo selector :lang, but for best compatibility, we use some class.&lt;br /&gt;
&lt;br /&gt;
Example for a help sentence at bottom of the page, in french an english, put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ans in template.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use it to for other sentence in your question before 1.92 ( in 1.92, there are better solutions).&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page==&lt;br /&gt;
&lt;br /&gt;
When editing a template this template can be assigned to a single survey while the survey list page, which is shown at www.yourdomain.org/limesurveyinstallfolder, lists all your surveys.&lt;br /&gt;
&lt;br /&gt;
To use your current template for this page you have change the according setting at the Global Settings screen; at older versions this change can be done by editing the $defaulttemplate setting at the config file: Copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to $defaulttemplate = &#039;yourtemplatename&#039;;&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users==&lt;br /&gt;
&lt;br /&gt;
Mac users, please note: Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
a work around is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
or scripts in their mac-compiled counterparts:&lt;br /&gt;
&lt;br /&gt;
http://homepage.mac.com/roger_jolly/software/&lt;br /&gt;
&lt;br /&gt;
==Changing your templates traffic light from red to green==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, set the admin directory to read/write/execute (777). The files within it, however, may be set to read/execute only (chmod 755).&lt;br /&gt;
&lt;br /&gt;
GO to file directory ie file manager, find templates directory.&lt;br /&gt;
&lt;br /&gt;
1 change permission on eg&amp;quot;vallendar&amp;quot; (or any template of your choice) directory to read 777&lt;br /&gt;
&lt;br /&gt;
2 voila! the red traffic light on &amp;quot;vallendar&amp;quot; is now green.&lt;br /&gt;
&lt;br /&gt;
3 NOTE: to restrict access for safety, when finished editing template files, change all templates files back to what they were eg 644&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon==&lt;br /&gt;
&lt;br /&gt;
When a question help text is shown then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It then will be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Before uploading new logo delete previous one.&lt;br /&gt;
&lt;br /&gt;
1. To edit logo go to &amp;amp;bdquo;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&amp;amp;rdquo;, you can find it here (see in screen):&lt;br /&gt;
&lt;br /&gt;
[[File:1.PNG]]&lt;br /&gt;
&lt;br /&gt;
2. Find and Click Search button, to find place where is logo style text.&lt;br /&gt;
&lt;br /&gt;
[[File:2.PNG]]&lt;br /&gt;
&lt;br /&gt;
3. Find in search &amp;lt;u&amp;gt;#logo&amp;lt;/u&amp;gt; (It is logo design code)&lt;br /&gt;
&lt;br /&gt;
[[File:3.PNG]]&lt;br /&gt;
&lt;br /&gt;
4. Edit style file&lt;br /&gt;
&lt;br /&gt;
You will see something like this code:&lt;br /&gt;
&lt;br /&gt;
[[File:4.PNG]] &lt;br /&gt;
&lt;br /&gt;
If you want change image just replace logo.gif to antoher image link. Like: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt;, &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;, &amp;lt;u&amp;gt;logo.swf&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
If you want change image size just change, width and height (in pixels) like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;Width:100px; Height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo==&lt;br /&gt;
&lt;br /&gt;
1. Find and Open &amp;amp;bdquo;&amp;lt;u&amp;gt;startpage.pstpl&amp;lt;/u&amp;gt;&amp;amp;rdquo; template file.&lt;br /&gt;
&lt;br /&gt;
[[File:5.PNG]] &lt;br /&gt;
&lt;br /&gt;
2. Write in &amp;amp;bdquo;&amp;lt;u&amp;gt;startpage.pstpl&amp;lt;/u&amp;gt;&amp;amp;rdquo; this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img id=&amp;amp;rdquo;page_logo&amp;amp;rdquo; src=&amp;amp;rdquo;{TEMPLATEURL}logo.png&amp;amp;rdquo;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/syntaxhighlight&amp;gt; After &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;body ... &amp;gt;&amp;lt;/syntaxhighlight&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
[[File:6.PNG]] &lt;br /&gt;
&lt;br /&gt;
3. To add logo go to &amp;amp;bdquo;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&amp;amp;rdquo;, you can find it here (see in screen):&lt;br /&gt;
&lt;br /&gt;
[[File:1.PNG]]&lt;br /&gt;
&lt;br /&gt;
3.1 Go to end of &amp;amp;bdquo;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&amp;amp;rdquo; style file.&lt;br /&gt;
&lt;br /&gt;
3.2 Write in end:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want in left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#page_logo{&lt;br /&gt;
&lt;br /&gt;
   float:left;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want in right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#page_logo{&lt;br /&gt;
&lt;br /&gt;
   float:right;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want in center:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#page_logo{&lt;br /&gt;
&lt;br /&gt;
   display: block;&lt;br /&gt;
&lt;br /&gt;
   margin-left: auto;&lt;br /&gt;
&lt;br /&gt;
   margin-right: auto;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos==&lt;br /&gt;
&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip)==&lt;br /&gt;
&lt;br /&gt;
There are 2 solution to remove the default help, like a [[Advanced question settings|#hide_tip|hide_tip attribute]] but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and is container from the file question.pstl, but it can be a bad idea for screenreader.&lt;br /&gt;
# for the default template and some other , add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon==&lt;br /&gt;
&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template directory&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages==&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;Version 1.91 and newer&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages) you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your css file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
example from default template of LimeSurvey 1.91+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To &#039;&#039;&#039;not&#039;&#039;&#039; differentiate even and odd pages at the (default) template find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array==&lt;br /&gt;
&lt;br /&gt;
To create a vertical separator border for a dual scale array you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
header_separator is used to adress the separator for the header &amp;quot;td&amp;quot; and &amp;quot;dual_scale_separator&amp;quot; is used to adress the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list==&lt;br /&gt;
&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; meassage on the start page (with the survey list) you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages==&lt;br /&gt;
&lt;br /&gt;
If you want to remove the survey contact message from error messages it&#039;ll be trickier. You can add the following function call to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   {&lt;br /&gt;
&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&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;
It will probably not work for an englisch survey and have to be extended when using for multilingual surveys. But it&#039;s an idea/tip how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes (before version 2.0 at which those were added)==&lt;br /&gt;
&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at Limesurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the template.css of your template (at /limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css) add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Central_participants_database_(User_panel)_Development&amp;diff=3084</id>
		<title>Central participants database (User panel) Development</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Central_participants_database_(User_panel)_Development&amp;diff=3084"/>
		<updated>2012-09-22T20:56:50Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Database Schema=&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Central Storage==&lt;br /&gt;
&lt;br /&gt;
===lime_participants===&lt;br /&gt;
&lt;br /&gt;
The first table is the actual central table where all the participants&amp;amp;rsquo; entries are stored. The table is as follows&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|participant_id||first_name||last_name||   e_mail||blacklisted_global&lt;br /&gt;
|-&lt;br /&gt;
|4b3403665fea6||Carsten ||Schmitz||carsten.schmitz@example.com||N&lt;br /&gt;
|-&lt;br /&gt;
|4b1357665fea6||Jason||Cleeland||js@example.org||N&lt;br /&gt;
|-&lt;br /&gt;
|4dc14fa0db7f4||Thilabult||Lemer||thilabault.lemer@example.net||N&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|language||   owner_uid||   date_created||date_modified||   max_surveys&lt;br /&gt;
|-&lt;br /&gt;
|en||   1||    2007-11-04 01:00:01|| 2007-11-04 01:00:01||0&lt;br /&gt;
|-&lt;br /&gt;
|en||   2|| 2007-11-04 01:00:01|| 2007-11-04 01:00:01||2&lt;br /&gt;
|-&lt;br /&gt;
|en||   1|| 2007-11-04 01:00:01|| 2007-11-04 01:00:01||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Fields in table are explained below:&lt;br /&gt;
*participant_id : It is the primary key for the table and will be auto-generated.&lt;br /&gt;
*first_name : It contains the first name of the participant.&lt;br /&gt;
*last_name : It contains the last name of the participant.&lt;br /&gt;
*e_mail : It contains the email id of participant.&lt;br /&gt;
*language : It contains the language preference of the participant.&lt;br /&gt;
*blacklisted_global : It is a field that will be updated if a participant hit a particular URL mentioned in the email sent to him. There will be two URL mentioned in the mail. One will allow the participant to blacklist himself globally from any survey from that server, or from a particular survey. When the user will blacklist himself from the server as a whole, he will be marked against the e-mail address in the above table , when it&#039;s survey specific, he will marked with the help of email and the survey_id in the tokens table. If for a particular participant, this field is set, the administrator would be not allowed to add that user to any of the survey&#039;s. If a new survey is set, then also administrator will not be allowed to add that particular participant. If the global setting for blacklisting is updated, then all the local tables will be updated accordingly.Once blocked the user will not be allowed to participate either. The user will have another set of URL&#039;s in case he/she wishes to unblock himself/herself.&lt;br /&gt;
*owner_uid: It will contain the user id of the person who is adding the participant, this will be extracted based on who is logged in, in case the owner field is set to be editable then it can be changed.&lt;br /&gt;
*date_created and date_modified are self-explanatory fields.&lt;br /&gt;
*max_surveys:The max_locks field will contain a number which will indicate, the max number of surveys to which participant is to be locked for example if it contain 0, the participant is free to be added to any other survey, However if it values is 2, this means that the participant is locked to two surveys so after adding him to two surveys, he shouldn&#039;t be added to any third survey.&lt;br /&gt;
&lt;br /&gt;
The combination of email and owner_uid will be the composite key for this table.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Locking Feature==&lt;br /&gt;
&lt;br /&gt;
In the lock feature there is one tables,lime_survey_info.The lime_participant_info table will contain the information regarding to which survey the participant is added.&lt;br /&gt;
&lt;br /&gt;
===lime_participant_links===&lt;br /&gt;
&lt;br /&gt;
The schema of the table is&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|participant_id||survey_id||token_id||date_created&lt;br /&gt;
|-&lt;br /&gt;
|4b3403665fea6||63273||1||2011-03-08 12:32&lt;br /&gt;
|-&lt;br /&gt;
|4b1357665fea6||76581||1||2011-03-08 12:32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This table will be used for two purposes as far as I can see for now,&lt;br /&gt;
&lt;br /&gt;
1) It will give the clear cut info as to which survey a particular participant is added to.&lt;br /&gt;
&lt;br /&gt;
2) When a user will try to share a participant, but in the settings it is set that he can&#039;t be added to more than two surveys, then a SQL COUNT query will be run for that participant and if that number is equal to the max_locks field an error message will sprung up saying, these participants can&#039;t be added to the survey.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Token Table==&lt;br /&gt;
&lt;br /&gt;
===lime_tokens_xxxxxx===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|participant_id||token||token_id||e_mail_status   ||sent||reminder_sent&lt;br /&gt;
|-&lt;br /&gt;
|4b3403665fea6||afir2ski6wrcyny||1||OK||2011-03-08 12:32||N&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|reminder_count||completed||uses_left||valid_from||valid_until||blacklisted   ||att_id&lt;br /&gt;
|-&lt;br /&gt;
|0||   2011-03-08 12:32||0||23.03.2011 00:00     ||26.03.2011 00:00||   N||2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Some minor changes have been done to this table to make it work with the other Central Database System.One of then is that the user information will not be stored in this table, but in the Central Table and will be linked using the participant_id.Also, a blacklisted field is also added that will contain the survey and participant specific blacklist settings.&lt;br /&gt;
&lt;br /&gt;
The Fields in table are explained below:&lt;br /&gt;
*participant_id : This is the key for linking participants in this system.&lt;br /&gt;
*token,token_id,e_mail_status,sent,reminder_sent,reminder_count,completed,uses_left,valid_from,valid_until: Same as in the previous system.&lt;br /&gt;
*blacklisted: This is the survey specific blacklist field which will contain as to whether the participant has chosen to blacklist himself from this survey or not.&lt;br /&gt;
*att_id : This field will contain a id of the attribute that is added into the system. A combination of att_id and participant_id will extract information from lime_participant_attributes table&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Attribute Control==&lt;br /&gt;
&lt;br /&gt;
This feature will be using three tables namely :&lt;br /&gt;
&lt;br /&gt;
1) lime_participant_attributes - Store the actual attribute information&lt;br /&gt;
&lt;br /&gt;
2) lime_participant_attribute_info - Store the UI information related to the attribute&lt;br /&gt;
&lt;br /&gt;
3) lime_participant_attribute_values - Store the possible values of the attribute&lt;br /&gt;
&lt;br /&gt;
===lime_participant_attributes===&lt;br /&gt;
&lt;br /&gt;
This is the table that will hold the actual values&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   participant_id||   attribute_id||   value||   id&lt;br /&gt;
|-&lt;br /&gt;
|4b3403665fea6||   1||   Male||   1&lt;br /&gt;
|-&lt;br /&gt;
|4b1357665fea6||   1||   Male||   2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The fields of the table are explained below&lt;br /&gt;
* participant_id : Again this is the unique id for the participants.&lt;br /&gt;
* attribute_id : Each attribute in the attribute control will have a unique id similar to participant_id and a combination of participant_id and attribute_id will tell give the value of the attribute.&lt;br /&gt;
* value : This field contain the actual value of the attribute, in case of textbox, It will contain the value contained in the text box.&lt;br /&gt;
&lt;br /&gt;
===lime_participant_attribute_info===&lt;br /&gt;
&lt;br /&gt;
This is the table that will hold the UI related information for attribute control&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   attrbute_id||   attribute_name||   attribute_type||   visible&lt;br /&gt;
|-&lt;br /&gt;
|1||   sex||   DD||   1&lt;br /&gt;
|}&lt;br /&gt;
*attribute_id : The unique id give to each additional attribute.&lt;br /&gt;
*attribute_name : This is the label that will be shown in the UI created for additional attribute.&lt;br /&gt;
*attribute_type : This field contains the type of UI that needs to be created for this particular attribute&lt;br /&gt;
*visible : This field will tell whether that attribute is to be used for the current set of participants or not&lt;br /&gt;
&lt;br /&gt;
===lime_participant_attribute_values===&lt;br /&gt;
&lt;br /&gt;
This is the table that will hold all the possible values for the particular attribute. The scehma of this table is&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   attribute_id||   value_id||   p_value&lt;br /&gt;
|-&lt;br /&gt;
|   1||   1||   male&lt;br /&gt;
|-&lt;br /&gt;
|   1||   2||   male&lt;br /&gt;
|-&lt;br /&gt;
|2||   1||   &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The above example will make it more clear, but keep in mind that in case of a text box and date-picker, this field will be empty because any value can be entered in the system. For multi-line text input we will use a different value_id for each text box, for example address.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Relationship==&lt;br /&gt;
&lt;br /&gt;
The relationship between the tables explained above is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Relationsv4.png]]}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=User Interface=&lt;br /&gt;
&lt;br /&gt;
In the user interface aspect, the entire participant control that we used to have` in the token menu will now be available globally, but the token will be generated in the survey specific table only. The link for adding participants to the limesurvey installation will be on the front screen.&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_1.png]]&lt;br /&gt;
&lt;br /&gt;
When clicked on the Add Participants the following screen will come up&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Add Participant==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Explanation of the above screenshot is given below:&lt;br /&gt;
*ID : This is the autogenerated ID for each participant.&lt;br /&gt;
*First Name, Last Name, Email, Language : These fields are self-explanatory.&lt;br /&gt;
*Blacklisted: This is the local blacklisted field I explained earlier.&lt;br /&gt;
*Locked_with_survey : This is the field that will not allow the participant to be added to any other survey. The &amp;quot;add&amp;quot; link will allow the user to add more than one survey to be locked to. It will open a modal-dialog box. The unlocking will be possible only at the survey level, i.e. the participant could only be unlocked if the user has the access to that particular survey to which the participant is locked.&lt;br /&gt;
*Owner: This will be a fixed field by default that will contain the owner&amp;amp;rsquo;s id of the owner who is adding that particular participant to the central database. However this field will only be editable if set in the user control options&lt;br /&gt;
*Max Surveys: This field will tell set the number of surveys a particular participant can be added to, for example is the user set it to 0, then the participant can be added to as many as surveys the user wants.If it it set 2 it can be added to the maximum two surveys.&lt;br /&gt;
*Sex: This is the additional attribute we set under attribute_control.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Import from CSV/LDAP==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_3.jpg]]&lt;br /&gt;
&lt;br /&gt;
The CSV file upload feature is similar to what we used to do under tokens, however with some differences, the differences are mentioned below:&lt;br /&gt;
*The language is no longer an optional field, but under the mandatory fields.&lt;br /&gt;
*Owner is the fields have the id of the user that is currently logged in and the participants will be added under this field. This field will only be editable if the corresponding option is set in user control.&lt;br /&gt;
*Optional attributes are the survey specific fields, and will be added to the survey specified in the above field, along with the participants, this option will be enabled only if the participants are added to the survey table automatically based on the id they are adding.&lt;br /&gt;
*locked_with_survey field will have another option, besides the survey. It will be &amp;quot;free&amp;quot; that will allow the participant to be added to any survey. This will be the default value.&lt;br /&gt;
*Max Surveys: This field will tell set the number of surveys a particular participant can be added to, for example is the user set it to 0, then the participant can be added to as many as surveys the user wants.If it it set 2 it can be added to the maximum two surveys.&lt;br /&gt;
*The LDAP import will work in the same way, and with the same options, I mean the locked to survey, group_id and optional fields.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display Participants==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_4.png]]&lt;br /&gt;
&lt;br /&gt;
Again this screen is only for editing/deleting the participant entries. It is global, and hence nothing survey specific will be found here. If the user clicks on the edit button, then the screen similar to add participant screen will show up, showing the details of the participant, which can be edited there.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Blacklist Control==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_5.png]]&lt;br /&gt;
&lt;br /&gt;
All the settings under this page will be stored under the settings_global table. Each of setting is&lt;br /&gt;
&lt;br /&gt;
explained below&lt;br /&gt;
*The first option if set, will mark participant blacklist for all the survey&#039;s that are present in the system currently.&lt;br /&gt;
*The second option will mark the participant as blacklist for any new survey that is added to the system, if the global field is set.&lt;br /&gt;
*The third option will not allow the participant to be even added to the survey if the global blacklist field is set.&lt;br /&gt;
*The fourth option will not show the blacklisted participant in the display participant.&lt;br /&gt;
*In the fifth option, if the participant blacklist himself/herself globally , he will be deleted from the database .&lt;br /&gt;
*The sixth option will decide that whether the URL to blacklist the user will be sent in the invitation.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==User Control==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_6.png]]&lt;br /&gt;
&lt;br /&gt;
This is the user control, by user I mean the administrator. The three options under this field will be stored in the global table. The options are explained below.&lt;br /&gt;
*The first field if enabled or disable this feature completely.&lt;br /&gt;
*The second option if set to yes, when the user uploads a csv file or adding a new participant indivisually. *The new participant will be added to the survey of which the user is the owner.&lt;br /&gt;
*The third option will set if the owner field is editable or not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Attribute Control==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_7.png]]&lt;br /&gt;
&lt;br /&gt;
This is a new feature I am planning to implement, in this feature I will be allowing the administrator to add a new attribute with a proper UI, rather than just a textbox. The value related to this feature will be stored in attribute_info_table. These are the UI components that I am planning to add for additional attribute&lt;br /&gt;
*Drop Down&lt;br /&gt;
*Check Box&lt;br /&gt;
*Radio&lt;br /&gt;
*jQuery DatePicker&lt;br /&gt;
*Text Box&lt;br /&gt;
&lt;br /&gt;
In case of Drop Down,Check Box, Radio the &amp;quot;Add More&amp;quot; will allow the administrator to add more possible values. More advanced UI&#039;s can be added once the basic feature is ready.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Add to survey==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_8.png]]&lt;br /&gt;
&lt;br /&gt;
The UI is explained below:&lt;br /&gt;
*The add group is basically the user id whose participants are to be added to the survey after going through three checks, locked or not, blacklisted or not,has permission or not.&lt;br /&gt;
*Lock this group to the survey will lock this particular group to the survey, and will not allow any other&lt;br /&gt;
*This field will give all the global attributes that are present with the participants and only relevant attributes are added to the survey&lt;br /&gt;
*Allow blacklisted enteries to be added to the survey, if set, otherwise will not allow the blacklist enteries to be added. The main reason for this option is that in case the participant un-blacklist himself from the server, then he/she can participate in that survey. A automatic module can be made that will check for any participant that unblocked himself/herself and can be send invitation after that. I know this feature is not in the top of the list, but with many participants, will be worth it.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Sign Up Control==&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_10.png]]&lt;br /&gt;
&lt;br /&gt;
This feature will allow the participant to just go on to the home screen, and sign him up. He will be verified against his e-mail. On the front screen there will be a sign up button, that when clicked will open a pop-up asking for the e-mail id. When entered an invitation mail will be sent to him asking for the rest of details. This way we will be sure that we have a valid participant. Once those details are entered, automatically a token will be generated for that user, and he will be redirected to the survey. Alternatively, if the administrator wants, he/she can disable this feature completey, or allow the participating to only participate only when he/she sends the invitation.&lt;br /&gt;
&lt;br /&gt;
The mock - up of the sign up control is as shown :&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_shot_9.png]]&lt;br /&gt;
&lt;br /&gt;
This feature again will have a survey specific settings, which will be stored in the survey&#039;s table. The local settings if set ,will override the global settings.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=CodeIgniter Specific Details=&lt;br /&gt;
&lt;br /&gt;
Since we are porting LimeSurvey to codeIgniter and any new projects have to be developed according to the CodeIgniter framework. I will try and give the basic outline of the approach I will be following.&lt;br /&gt;
&lt;br /&gt;
==Controller==&lt;br /&gt;
&lt;br /&gt;
I as of now, will be adding a single controller for the whole project, and it will be named &#039;centralDB&#039;. The functions under this controller will be of the form&lt;br /&gt;
*addParticipant //Add Participant&lt;br /&gt;
*import //Import CSV/LDAP&lt;br /&gt;
*displayparticipant //Display the jqgrid&lt;br /&gt;
*blcontrol //Blacklist Control&lt;br /&gt;
*usercontrol //User Control&lt;br /&gt;
*signupcontrol //signupcontrol&lt;br /&gt;
&lt;br /&gt;
All the controller&#039;s listed above will be used for only showing of the view, retrieving previous settings and storing new settings, and for import and displayparticipant functions, it will have major functionality as display participant will also be used for adding the participants to the database, and import will also be providing functionality and not just storing data.&lt;br /&gt;
&lt;br /&gt;
For Storing data we have functions such as&lt;br /&gt;
*storeParticipant&lt;br /&gt;
*storeBL&lt;br /&gt;
*storeUser&lt;br /&gt;
*storeSignup&lt;br /&gt;
&lt;br /&gt;
These methods will get the post variables from the view and storing it in the database using appropriate model. For displayParticipant and all, there will other functions such as addtosurvey.&lt;br /&gt;
&lt;br /&gt;
==Models==&lt;br /&gt;
&lt;br /&gt;
For the models we have&lt;br /&gt;
*participants_model&lt;br /&gt;
*attribute_model&lt;br /&gt;
*token_model(older token table)&lt;br /&gt;
*survey_links_model&lt;br /&gt;
&lt;br /&gt;
I think it&#039;s best to compress the three attributes table to one model. Rest of the models are pretty much simple, get and store records.This is the basic structure, what we need to concentrate on is what to do when we are joining tables and getting data from multiple tables.&lt;br /&gt;
&lt;br /&gt;
==View==&lt;br /&gt;
&lt;br /&gt;
For the view, I have decided to use the following views. These are&lt;br /&gt;
*headercpdb&lt;br /&gt;
*addparticipant_view&lt;br /&gt;
*displayparticipant_view&lt;br /&gt;
*importparticipant_view&lt;br /&gt;
*blcontrol_view&lt;br /&gt;
*usercontrol_view&lt;br /&gt;
*signupcontrol_view&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Scenario Testing=&lt;br /&gt;
&lt;br /&gt;
The main purpose of making this proposal on the wiki page is to get the review of the community and suggest us some scenario&#039;s where you can see the system failing, so that we can make the changes before it&#039;s too late. If you see any shortcomings or any other feedback, please leave a comment and please try and answer these questions&lt;br /&gt;
&lt;br /&gt;
1) What do you want to do?&lt;br /&gt;
&lt;br /&gt;
2) Where will the system fail?&lt;br /&gt;
&lt;br /&gt;
3) Feature Suggestion?&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Action Plan :)=&lt;br /&gt;
&lt;br /&gt;
I received my date-sheet and I have exams from 24th of May to 11th of June, So I will be tweaking the action plan a bit in order to get things right :).&lt;br /&gt;
&lt;br /&gt;
Plan for June&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|   Date||What to do ?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span style=&#039;color:#999&#039;&amp;gt;4-7th ||Talk to Shubham and Diogo during this period, as I think by that time they will be officially clear as to how they will be doing the porting, also, I will decide as to how I should go about it.If everything goes as planned I should be able to complete the add participant UI and the addition of data to the central database(without any features) along with the required validations.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|12-15th ||Will add the user_id info(based on the logged in user), along with the datestamp in the central database. Also will be creating the owner control as mentioned in the original proposal along with the required functionality with it. Like automatically adding participants to the token table or not, or editable owner&#039;s field or not .&lt;br /&gt;
|-&lt;br /&gt;
|16-22th June ||Addition and attribute control&lt;br /&gt;
|-&lt;br /&gt;
|23-28th June ||CSV and LDAP upload with attribute support&lt;br /&gt;
|-&lt;br /&gt;
|29-10th July ||Add to token table and vice versa with editing logic and max surveys feature&lt;br /&gt;
|-&lt;br /&gt;
|11-15th July ||Sending email with blacklist control and the required logic&lt;br /&gt;
|-&lt;br /&gt;
|(12 July - 16 July) || (Midterm Break)&lt;br /&gt;
|-&lt;br /&gt;
|16-31th July ||sign up addition for participants along with the multiligual attribute support for token system&lt;br /&gt;
|-&lt;br /&gt;
|1-15th August ||features from if we have time list&lt;br /&gt;
|-&lt;br /&gt;
|16-22th August ||cleaning up code, video tutorials, testing and bug fixing&lt;br /&gt;
|-&lt;br /&gt;
|23-31th August ||worst case scenario or else party time ;) &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is the action plan for the first milestone according to my original proposal, I will create the further action plan once I am done with this target. I will also be updating a weekly progress report here as well as a mail to the administration team of LimeSurvey, about the discussions we have during the week. The actual coding and progress report will start from 12th of June.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Weekly Meetings=&lt;br /&gt;
&lt;br /&gt;
This will contain the logs of the weekly meetings we have:&lt;br /&gt;
&lt;br /&gt;
12th May 2011 -&amp;gt; http://docs.limesurvey.org/CPDB+Meeting+Log+12-05-2011&lt;br /&gt;
&lt;br /&gt;
Logs of meeting from the 19th of May will be available at the link below&lt;br /&gt;
&lt;br /&gt;
http://docs.limesurvey.org/CPDB+Meeting+Logs&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Scenarios=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the following section to describe (as succinctly and clearly as possible) various different scenarios in which the Central Participants Database may be used. These scenarios can assist in clarifying User Interface issues and in initial database design&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Privacy Scenarios==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Single Company Installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario, LimeSurvey is installed by a single company for use by that company&#039;s staff. The right to view and access data relating to participants is shared by all staff and there is no need to fence data off between users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Multi User Installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey is installed at a University and different students or academics are using it to run surveys. Their ethics rules require that they keep their participant data to themselves, so other users cannot see it.&lt;br /&gt;
&lt;br /&gt;
==Survey Invitation Scenarios==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pre-existing List, Add it to Participants Database&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A user has a list of 500 people in their personal spreadsheet/database that they want to invite to participate in their survey. They create a survey, create a tokens table for it and then import the list (as per existing system). They want to make sure that their list is on the participants database for future use, and that they will be able to select these 500 people easily later on for future surveys.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pre-existing List, Don&#039;t add it to the participants database&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A user has a list of 300 people in their personal spreadsheet/database that they want to invite to participate in a survey. They create a survey, create a tokens table table for it and then import the list (as per exising system). They &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want their list to be added to the central participants database.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Generate attributes for the participants database from answers to a survey&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A user has run a survey which asked whether participants live in a capitol city, a major regional centre or a minor regional centre. He wants to transfer the answers from that survey to the participants attributes in the central participants table. He also wants to transfer the annual income results from a question. He already has this information for some of the participants, but wants to update it with the information collected in this survey.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Generate tokens from participants list based on earlier survey&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A user creates a new survey and wants to invite all the participants from an earlier survey to this new survey. He needs to be able to select all those who participated in the earlier survey, preferably just those who actually completed it. He might want to add those who didn&#039;t complete the earlier survey later on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Generate tokens from participants list based on their survey history&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A user creates a new survey and wants to invite only participants that have not taken part in a survey for the last 2 months. He might also want to exclude all that have participated in a survey with a similar topic in the last 6 months. User will need to view a search form where he can:&lt;br /&gt;
&lt;br /&gt;
1) Select search criteria from values such as &amp;quot;survey name&amp;quot;, &amp;quot;survey completed date&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2) Fill out matching values (ie: text string for survey name, dates for completion dates)&lt;br /&gt;
&lt;br /&gt;
3) Make the system search through all participants for matches to the search criteria&lt;br /&gt;
&lt;br /&gt;
4) See a list of all the matching participants (and the relevant information)&lt;br /&gt;
&lt;br /&gt;
5) Be able to do something with the resulting list (most likely copy them to a token table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Generate tokens from participants list based on other attribute&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A user creates a new survey and wants to invite all the participants he owns who have an income greater than $50,000 per annum and live in a capital city. User will need to be able to fill out a search form where he is able to:&lt;br /&gt;
&lt;br /&gt;
1) Select the attribute or attributes to use in his search&lt;br /&gt;
&lt;br /&gt;
2) Enter a search value/criteria for the search&lt;br /&gt;
&lt;br /&gt;
3) Make the system search through all the participants he has rights to view, for matches to his search criteria&lt;br /&gt;
&lt;br /&gt;
4) See a list of all the matching participants (and probably the relevant attribute data)&lt;br /&gt;
&lt;br /&gt;
5) Do stuff with the list (most likely, copy those participants to a token table for a survey)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Taking care of the panel health&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The manager of the central participant list wants to check on the panel health. He wants to know if all participants have been invited to surveys in a certain period of time, how often they have been invited, the ration between invitation and participation, etc. Ideally there would be a system to attribute &amp;quot;points&amp;quot; to each survey and those points would be added to each participant (something like the total km count for a car). Ideally there would also be another field with points that can be reset (e.g. like the day km in a car). This would help to remunerate participants for their participations, without having to &amp;quot;pay&amp;quot; them for every single survey.&lt;br /&gt;
&lt;br /&gt;
After running the survey for 5 days he realises he needs more, so he then wants to add people who live in major regional centres.&lt;br /&gt;
&lt;br /&gt;
==Other scenario types?==&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_FAQ&amp;diff=1658</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_FAQ&amp;diff=1658"/>
		<updated>2012-09-21T08:00:29Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Contents:{maketoc maxdepth=2}&lt;br /&gt;
&lt;br /&gt;
=During Installation=&lt;br /&gt;
&lt;br /&gt;
==How can I create a database and a user in mysql with command line access?==&lt;br /&gt;
&lt;br /&gt;
You have to enter the below commands in your mysql.&lt;br /&gt;
&lt;br /&gt;
create database &#039;&#039;&#039;&amp;lt;your_database_name&amp;gt;&#039;&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
create user &#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
create user &#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039;@localhost;&lt;br /&gt;
&lt;br /&gt;
set password for &#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039; = PASSWORD(&#039;&#039;&#039;&#039;&amp;lt;your_database_password&amp;gt;&#039;&#039;&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
set password for &#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039;@localhost = PASSWORD(&#039;&#039;&#039;&#039;&amp;lt;your_database_password&amp;gt;&#039;&#039;&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
grant all on &#039;&#039;&#039;&amp;lt;your_database_name&amp;gt;&#039;&#039;&#039;.* to &#039;&#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
grant all on &#039;&#039;&#039;&amp;lt;your_database_name&amp;gt;&#039;&#039;&#039;.* to &#039;&#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039;&#039;@&#039;localhost&#039;;&lt;br /&gt;
&lt;br /&gt;
You have to replace &#039;&#039;&#039;&amp;lt;your_database_name&amp;gt;&#039;&#039;&#039;, &#039;&#039;&#039;&amp;lt;your_database_username&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;&amp;lt;your_database_password&amp;gt;&#039;&#039;&#039; in above commands with according values.&lt;br /&gt;
&lt;br /&gt;
==What if I can&#039;t create a database through a script?==&lt;br /&gt;
&lt;br /&gt;
Normally, the script creates a new database, and then the table structure. However if your server/ISP doesn&#039;t give you admin rights to create a new database in MySQL, you will need to contact your server administrator to create the necessary database (or create it yourself). They should create a blank database for you that gives you the appropriate access rights (ie: read/write/create). Enter the name of this database, and your user name and password in the config.php script, and run the /admin/install/index.php script. The script will then create the required tables in the database.&lt;br /&gt;
&lt;br /&gt;
==What is this mbstring (Multibyte String Functions) library?==&lt;br /&gt;
&lt;br /&gt;
The mbstring library is a PHP library to be able to convert char sets from one language to another.  You need it if you want to run LimeSurvey. To check if it is already installed open the URL&lt;br /&gt;
&lt;br /&gt;
 http://&amp;lt;your_server&amp;gt;/&amp;lt;your_limesurvey_directory&amp;gt;/admin/install/phpinfo.php&lt;br /&gt;
&lt;br /&gt;
from the web browser. A lot of information will be shown. Search for the string &#039;mbstring&#039; under the &#039;&#039;&#039;Configuration&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
If you find the mbstring section then all should be well and you can continue on with your LimeSurvey installation!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you don&#039;t find the mbstring section&#039;&#039;&#039; you might have a problem on your hands.&lt;br /&gt;
&lt;br /&gt;
There are three possible scenarios:&lt;br /&gt;
*If it&#039;s your providers server: Ask your provider to activate that extension in PHP or how to activate it - if you have a good administration panel for your server you may be able to activate it yourself.&lt;br /&gt;
*If it&#039;s your own &#039;&#039;&#039;Linux&#039;&#039;&#039; server: You may have to re-compile PHP and include the mbstring library. Ask the Linux experts how to do that. In most Linux versions today you can install it using your Linux packet manager.&lt;br /&gt;
**If you are using a version of Linux that supports &#039;yum&#039; (CentOS, RedHat, Fedora):&lt;br /&gt;
### Use the terminal (as a super user) and type: &#039;&#039;&#039;yum install php-mbstring&#039;&#039;&#039;&lt;br /&gt;
### Make sure to update /etc/php.ini to update and uncomment the various mbstring params&lt;br /&gt;
### Make sure to restart apache after installing it:  &#039;&#039;&#039;/etc/init.d/httpd restart&#039;&#039;&#039;&lt;br /&gt;
*If it&#039;s your own &#039;&#039;&#039;Windows&#039;&#039;&#039; server: Search for php.ini on your system, open it with an editor and search for mbstring. Most probably the line that contains that string is commented out with a semicolon. Remove the semicolon, save and restart your web server.&lt;br /&gt;
&lt;br /&gt;
==When I am entering special chars (Chinese, Cyrillic, Greek, Arabic) into my survey, every character is shown as a question mark?==&lt;br /&gt;
&lt;br /&gt;
This happens if your database itself is not created to use an UTF-8 charset. This can happen when you have to create the database using a provider administration panel. You can fix this problem by executing the following SQL command on your database (using for example phpMyAdmin)&lt;br /&gt;
&lt;br /&gt;
ALTER DATABASE `&amp;lt;your_database_name&amp;gt;` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;your_database_name&amp;gt; with the name of your database. &#039;&#039;&#039;You need to do this before installing LimeSurvey.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Blank page when accessing the Install page==&lt;br /&gt;
&lt;br /&gt;
The problem is not with the LimeSurvey installation but with the PHP installation.&lt;br /&gt;
*Verify you have the MySQL PHP module (php-mysql) installed.&lt;br /&gt;
*Verify your PHP install is loading the PHP.ini file your are modifying and not parsing other PHP.INI files on your system.&lt;br /&gt;
*Verify the location and permissions of the following setting in your PHP.ini&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;upload_tmp_dir=&amp;quot;/temp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
session.save_path=&amp;quot;/temp&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Error messages because of a not existing ressources==&lt;br /&gt;
&lt;br /&gt;
Sometimes files are not uploaded correctly or were broken during upload. This leads to several different error messages. Most of them refer to a file or function within a file which can&#039;t be found.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution:&#039;&#039;&#039; Re-upload all files using the binary mode of your FTP program.&lt;br /&gt;
&lt;br /&gt;
=After Database Creation=&lt;br /&gt;
&lt;br /&gt;
==Blank Page after Database Creation==&lt;br /&gt;
&lt;br /&gt;
===Symptoms===&lt;br /&gt;
* LimeSurvey installed OK, and database was created, but instead of the admin page, you get an empty page&lt;br /&gt;
* Web surver log shows &amp;quot;Fatal error: Call to a member function on a non-object in /path/to/limesurvey/admin/login_check.php on line 69&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Fix===&lt;br /&gt;
&lt;br /&gt;
This is probably an incorrect setting for $rooturl or $rootdir in config.php. In particular, config.php attempts to set $rootdir correctly by calling &amp;lt;nowiki&amp;gt;dirname(&#039;&#039;&#039;FILE&#039;&#039;&#039;)&amp;lt;/nowiki&amp;gt; and while this usually works, it can be upset when LimeSurvey is installed in a user&#039;s home or public_html directory and the home directory is mounted over NFS. Try setting $rootdir manually, and in particular, while your shell or pwd command may show a path like &amp;quot;/disks/hostname/home/username/public_html/limesurvey&amp;quot;, try using &amp;quot;/home/username/public_html/limesurvey&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==When accessing admin page, the browser keeps running and will eventually fail to show it==&lt;br /&gt;
&lt;br /&gt;
===Symptoms===&lt;br /&gt;
* LimeSurvey installed OK and database was created. But when you access the admin page, the browser keeps running and will eventually fail to show the page.&lt;br /&gt;
* When you check the web server access log, its size has become so big (in some cases, more than 2 GB).&lt;br /&gt;
* Inside the access log, you get this message filling the log.&lt;br /&gt;
&lt;br /&gt;
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /limesurvey/classes/php-gettext/streams.php on line 120&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; line number may be different depending on your LimeSurvey version.&lt;br /&gt;
&lt;br /&gt;
===Fix===&lt;br /&gt;
&lt;br /&gt;
This may be caused by the mbstring.func_overload setting. Check the setting in your php.ini and set as the following.&lt;br /&gt;
&lt;br /&gt;
mbstring.func_overload = 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; This means no function overloading. See PHP manual for this setting: [http://us3.php.net/manual/en/mbstring.overload.php Function Overloading Feature]&lt;br /&gt;
&lt;br /&gt;
==When accessing admin page, the browser reports Fatal error: Call to a member function gT() on a non-object in login_check.php on line 76==&lt;br /&gt;
&lt;br /&gt;
===Symptoms===&lt;br /&gt;
* LimeSurvey installed OK and database was created. But when rdirected to the admin page, the browser displayed the the listed error.&lt;br /&gt;
* $rootdir and $rooturl are correctly set in config.php.&lt;br /&gt;
* The disk path name for limesurvey installation directory includes one of the following characters: ()+&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; Other characters may also induce the same behaviour&lt;br /&gt;
&lt;br /&gt;
===Fix===&lt;br /&gt;
&lt;br /&gt;
Move / rename the limesurvey installation directory so that pathname does not include either the &#039;&#039;&#039;(&#039;&#039;&#039; or &#039;&#039;&#039;)&#039;&#039;&#039; characters&lt;br /&gt;
&lt;br /&gt;
=After Login=&lt;br /&gt;
&lt;br /&gt;
==Any action in admin page will return you to login screen==&lt;br /&gt;
&lt;br /&gt;
This may happen for the following two main reasons :&lt;br /&gt;
*PHP sessions problems&lt;br /&gt;
*UTF8 encoding problems&lt;br /&gt;
*IE (6,7 and 8) problems&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;PHP Sessions :&amp;lt;/u&amp;gt;&lt;br /&gt;
# Update upload_tmp_dir and session.save_path in php.ini&lt;br /&gt;
# Create the configured session and upload directories&lt;br /&gt;
# IIS: Assigned permission to create and modify to IIS guest user account&lt;br /&gt;
# Apache: Make sure your webserver has permissions to write into the configured directory&lt;br /&gt;
# Check if the variable  &amp;quot;session.use_cookies&amp;quot; in php.ini is set to 1.&lt;br /&gt;
# Check the variable &amp;quot;session.auto_start&amp;quot; in php.ini. If it is set to 1, change it to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;UTF8 Encoding : &amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you edit any file (most probably config.php) do not save it as UTF8 to support special language chars! Always save .php files as true ANSI/ISO format. Starting with 1.87 you can set the most important settings inside the application using the &#039;Global settings&#039; dialog (like site name, administrator name, etc.).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;IE Cookies :&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
IE (6,7 and 8) does not support underscore &amp;quot;_&amp;quot; in the server hostname. If it is the case, the cookies are not managed and cookie(s) is(are) not set. So change the server hostname under apache or IIS.&lt;br /&gt;
&lt;br /&gt;
==LimeSurvey and suhosin (&amp;quot;Session has expired&amp;quot;)==&lt;br /&gt;
&lt;br /&gt;
You might, at one point, get a message like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;ERROR&lt;br /&gt;
&lt;br /&gt;
We are sorry but your session has expired.&lt;br /&gt;
&lt;br /&gt;
Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And if you have Suhosin activated on your server, that&#039;s might be the reason why you get this in the middle of a survey.&lt;br /&gt;
&lt;br /&gt;
NB : when your survey is not active, the behaviour might be different, you could be redirected in the middle of a survey to the public list of surveys. The solution is the same.&lt;br /&gt;
&lt;br /&gt;
Suhosin is an advanced protection system for PHP installations. Suhosin default configuration can make trouble to LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
First think to test with suhosin log, set suhosin.log.sapi = 511 and suhosin.simulation = on according with [http://www.hardened-php.net/suhosin/configuration.html suhosin documentation].&lt;br /&gt;
&lt;br /&gt;
The configuration file is usually located in /etc/php5/apache2/conf.d/suhosin.ini but to be sure you can check your phpinfo (Limesurvey administration &amp;gt; Global Settings &amp;gt; Button Show phpinfo &amp;gt; Line : &amp;quot;Additional .ini files parsed&amp;quot;) to get the correct path.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to restart your Apache server for the parameters to be taken into account (service apache2 restart).&lt;br /&gt;
&lt;br /&gt;
When the simulation is on, Suhosin is not blocking anything and the errors are reported into the logs (usually in your syslog : /var/log/syslog). If you appear to get error messages such as &amp;quot;ALERT-SIMULATION - configured POST variable limit exceeded&amp;quot; that&#039;s Suhosin alerting...&lt;br /&gt;
&lt;br /&gt;
This configuration seems to work well with Limesurvey:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;suhosin.memory_limit = 128&lt;br /&gt;
&lt;br /&gt;
suhosin.post.max_value_length = 5000000&lt;br /&gt;
&lt;br /&gt;
suhosin.post.max_vars = 5000&lt;br /&gt;
&lt;br /&gt;
suhosin.request.max_value_length = 5000000&lt;br /&gt;
&lt;br /&gt;
suhosin.request.max_vars = 5000&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With those parameters, you should be able to put the suhosin.simulation back at the &amp;quot;off&amp;quot; value (so that the serveur is protected and limesurvey still works).&lt;br /&gt;
&lt;br /&gt;
The default values of suhosin are not working well with limesurvey. If you really want to secure your serveur tightly you might want to use the simulation mode to tune the setting and find the good values between 1000 and 5000 for the vars and 1000000 and 5000000 for the value_lenghts.&lt;br /&gt;
&lt;br /&gt;
==LimeSurvey and suhosin (&amp;quot;quick translate trouble&amp;quot;)==&lt;br /&gt;
&lt;br /&gt;
You can have some problem with the quick translate module when you are on OpenBSD 5.1 with php-5.3.10.&lt;br /&gt;
&lt;br /&gt;
The symptom is : modification via &amp;quot;Quick translate --&amp;gt; options answer&amp;quot; are not update&lt;br /&gt;
&lt;br /&gt;
You must downgrade your php version to php-5.2.17p8 and use the suhosin tweak proposed above.&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t change the language!==&lt;br /&gt;
&lt;br /&gt;
No matter what language you choose, the interface (admin und user) always is in English language. Normally this is caused by a bug in your PHP version. There is no other fix for this than updating your PHP version.&lt;br /&gt;
&lt;br /&gt;
==Some common errors (IIS focused)==&lt;br /&gt;
&lt;br /&gt;
===Index.php won&#039;t open===&lt;br /&gt;
&lt;br /&gt;
Possible cause: This might happen if you haven&#039;t installed necessary extensions&lt;br /&gt;
* You need to install Multi-byte string, and MSSQL (or MySQL) extensions&lt;br /&gt;
&lt;br /&gt;
Possible cause: ISAPI filter not configured&lt;br /&gt;
* In IIS, for the website (you could do it at the directory level) you must configure it to use php5isapi.dll&lt;br /&gt;
&lt;br /&gt;
===Index.php won&#039;t open and &amp;quot;php.exe -i&amp;quot; gives error messages about missing .dll&#039;s===&lt;br /&gt;
&lt;br /&gt;
This may happen if you install too many extensions&lt;br /&gt;
* If you install all PHP extensions, PHP will fail because not all dependencies were met (e.g. oracle package needs oracle dll&#039;s)&lt;br /&gt;
* Install only the extensions that you need&lt;br /&gt;
* To test, try running php.exe -i from the command line&lt;br /&gt;
&lt;br /&gt;
===Message stating database was missing===&lt;br /&gt;
&lt;br /&gt;
This may happen if you navigate to wrong url&lt;br /&gt;
* Make sure you go to limesurvey/admin/install/index.php instead of limesurvey/index.php !&lt;br /&gt;
&lt;br /&gt;
===Above fixes do not solve the problem===&lt;br /&gt;
&lt;br /&gt;
This may happen if you have not restarted IIS&lt;br /&gt;
* Restart IIS&lt;br /&gt;
&lt;br /&gt;
Things that were easy to forget:&lt;br /&gt;
* .php needs to be associated to php5isapi.dll filter (It did this for me automagically)&lt;br /&gt;
* limesurvey/tmp directory needs writer permission for survey uploads&lt;br /&gt;
* updating doc_root in php.ini and $rootdir in config.php&lt;br /&gt;
&lt;br /&gt;
===Missing files (&amp;quot;No such file or directory&amp;quot;)===&lt;br /&gt;
&lt;br /&gt;
When uploading LimeSurvey to your server it might happen that the connection is interrupted so that some files are not transferred or not transferred completely. Depending on the files you can receive error message at different part of LimeSurvey usage. Normally missing files throw errors like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Warning: require_once(/path/to/your/limesurvey/installation/filename) [function.require-once]: failed to open stream: No such file or directory in /path/to/your/limesurvey/installation/filename on line 12345)&amp;quot; OR&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fatal error: require_once() [function.require]: Failed opening required &#039;require_once(/path/to/your/limesurvey/installation/filename)&#039; (include_path=&#039;.:/x/y/z) in /path/to/your/limesurvey/installation/filename on line 12345&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Delete all uploaded files.&lt;br /&gt;
&lt;br /&gt;
2. Re-upload the files.&lt;br /&gt;
&lt;br /&gt;
(3. If necessary: Re-install by browsing to /limesurveyfolder/admin/install)&lt;br /&gt;
&lt;br /&gt;
==Not able to add or edit subquestions/answers after upgrade==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re not capable of editing or adding a question, ask youre host provider to change the mod_security setting of the domain name. See the forum thread [http://www.limesurvey.org/en/support/forums/1-installation-a-update-issues/46435-not-able-to-add-or-edit-questions-on-new-190-?limit=10 Not Able to Add or Edit Questions on new 1.90] for more info.&lt;br /&gt;
&lt;br /&gt;
==Fancy URLs by removing index.php from the URL path==&lt;br /&gt;
&lt;br /&gt;
If you want to use fancy URLs and so not have /index.php in every URL please edit /application/config/config.php and change&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&#039;showScriptName&#039; =&amp;gt; true,&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&#039;showScriptName&#039; =&amp;gt; false,&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this to work properly you must use an Apache webserver with a properly installed mod_rewrite module.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Installation_-_LimeSurvey_CE&amp;diff=1582</id>
		<title>Installation - LimeSurvey CE</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Installation_-_LimeSurvey_CE&amp;diff=1582"/>
		<updated>2012-09-20T11:09:43Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right;&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Additional pages:{toc}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt; {maketoc title=&amp;quot;On this page:&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Note: These installation instructions are for version 2.0 or later. Older instructions for 1.92 can be found here [[Installation Version 1.92 or older|here]] &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=1. Make sure you can use LimeSurvey on your website=&lt;br /&gt;
&lt;br /&gt;
Make sure your server meets the following additional requirements. Most of these requirements will also be checked during the installation.&lt;br /&gt;
&lt;br /&gt;
Required:&lt;br /&gt;
* Minimum 80 MB disk space&lt;br /&gt;
* MySQL 4.1.0 or later &#039;&#039;&#039;OR&#039;&#039;&#039;    Microsoft SQL Server 2005 or later &#039;&#039;&#039;OR&#039;&#039;&#039;  Postgres 8.1 or later&lt;br /&gt;
* PHP 5.1.2 or later with the following modules/libraries enabled:&lt;br /&gt;
** mbstring (Multibyte String Functions) extension library (see also [http://docs.limesurvey.org/tiki-index.php?page=Installation+FAQ#What_is_this_mbstring_Multibyte_String_Functions_library_ Installation FAQ])&lt;br /&gt;
** PDO database driver for MySQL (pdo_mysql or pdo_mysqli) or Postgres (pdo_pgsql) or MSSQL (pdo_sqlsrv)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; Please note that LimeSurvey 2.x uses different database drivers than 1.x . If you get a message not No DBO driver was found during the installation you will have to contact your webspace provider and ask them to activate one of the aforementioned database driver libraries. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional PHP Extensions:&lt;br /&gt;
* &#039;&#039;&#039;GD-Library&#039;&#039;&#039; &#039;&#039;&#039;with FreeType support&#039;&#039;&#039; installed is needed for captchas or nice charts in statistics - see [http://de3.php.net/manual/en/image.setup.php PHP GD-Library Extension documentation]&lt;br /&gt;
* &#039;&#039;&#039;IMAP&#039;&#039;&#039; (pretty standard) is needed for the [[Email bounce tracking system]] - see [http://www.php.net/manual/en/imap.setup.php PHP IMAP Extension documentation]&lt;br /&gt;
* &#039;&#039;&#039;LDAP&#039;&#039;&#039; installed is needed to import tokens using LDAP - see [http://de.php.net/manual/en/ldap.installation.php PHP LDAP Documentation]&lt;br /&gt;
* &#039;&#039;&#039;Zip&#039;&#039;&#039; (pretty standard) for template upload and import resources Zip archives - see [http://www.php.net/manual/en/zip.setup.php PHP Zip Extension documentation]&lt;br /&gt;
* &#039;&#039;&#039;Zlib&#039;&#039;&#039; (pretty standard) is needed for the [[ComfortUpdate]] - see [http://www.php.net/manual/en/zlib.setup.php PHP Zlib Extension documentation]&lt;br /&gt;
&lt;br /&gt;
In most cases your webspace provider or system administrator will be able to help you out on these optional components.&lt;br /&gt;
&lt;br /&gt;
If you want to try LimeSurvey on your local machine we recommend [http://www.apachefriends.org/en/xampp.html XAMPP] which is an easy to install software package containing a complete web server with Apache, MySQL, PHP and Perl. LimeSurvey will run on XAMPP with no configuration needed.&lt;br /&gt;
&lt;br /&gt;
If you want to run Microsoft&#039;s IIS server take a look at &amp;quot;[[Installation of LimeSurvey on a Windows XP machine]]&amp;quot; and &amp;quot;[[Installation on XP with IIS]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==1.1 Hosting for LimeSurvey==&lt;br /&gt;
&lt;br /&gt;
LimeSurvey should work with most hosting companies which provide PHP and MYSQL. If you want a ready-installed version of LimeSurvey consider using LimeService, else check out our [[LimeSurvey-compatible hosting companies|list of LimeSurvey-compatible hosting companies]].&lt;br /&gt;
&lt;br /&gt;
=2. Download the LimeSurvey package=&lt;br /&gt;
&lt;br /&gt;
[http://www.limesurvey.org/en/download Download] the latest stable LimeSurvey zip package (there are also gzip, bz2 and 7zip packages available for your convenience) and save it to your local disk.&lt;br /&gt;
&lt;br /&gt;
=3. Unpack the LimeSurvey package=&lt;br /&gt;
&lt;br /&gt;
Uncompress the zip file into a dedicated directory/folder using your preferred compression software. When you uncompress the file make sure that you uncompress the directory structure with the files (this is default behavior for most compression programs). The path name for the installation directory should not include &#039;&#039;&#039;(&#039;&#039;&#039; or &#039;&#039;&#039;)&#039;&#039;&#039; characters, but may include the &#039;&#039;&#039;space&#039;&#039;&#039; character&lt;br /&gt;
&lt;br /&gt;
=4. Collect information about your server=&lt;br /&gt;
&lt;br /&gt;
You will need to know the following things to install LimeSurvey on your web server correctly:&lt;br /&gt;
*Your intended website URL where your scripts will reside (e.g: &#039;&#039;http://my.domain.com/limesurvey&#039;&#039;)&lt;br /&gt;
*The physical disk location on your server where your scripts will reside (ie: &#039;&#039;/home/usr/htdocs/limesurvey&#039;&#039;)&lt;br /&gt;
*The IP/net location of your database server (ie: &#039;&#039;localhost&#039;&#039;)&lt;br /&gt;
*If your database server uses a non-standard port find out which port it is.&lt;br /&gt;
*Your username and password for your database server&lt;br /&gt;
*With most providers you can&#039;t let the script create the database but have to do it yourself.  If you are using such a provider please create a database (for example &#039;&#039;limesurvey&#039;&#039;) yourself.&lt;br /&gt;
&lt;br /&gt;
=5. Upload the files to your web server=&lt;br /&gt;
&lt;br /&gt;
Using your FTP program, connect to your web server and create a directory to store your scripts. Then upload the files using the directory structure they are in. Make sure you &#039;&#039;&#039;upload the files in binary mode&#039;&#039;&#039; (check the settings of your FTP program). Please note that uploading in ASCII mode can lead to uncommon errors (e.g. &#039;class not found&#039; error during installation), also images may not be uploaded correctly.&lt;br /&gt;
&lt;br /&gt;
=7. Set Directory permissions=&lt;br /&gt;
&lt;br /&gt;
For the script to work properly it needs certain access to some directories - this applies especially to Linux/*nix systems.&lt;br /&gt;
*The &#039;&#039;&#039;&amp;quot;/limesurvey/tmp&amp;quot;&#039;&#039;&#039; directory and  all its subdiretories are used for imports &amp;amp; uploads and should be set to &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver.&lt;br /&gt;
*The &#039;&#039;&#039;&amp;quot;/limesurvey/upload/&amp;quot;&#039;&#039;&#039; directory and all its subdirectories must also have &#039;&#039;Read &amp;amp; Write&#039;&#039; for your webserver in order to enable picture and media files upload.&lt;br /&gt;
*The other directories can be set to &#039;&#039;Read Only&#039;&#039; or in Linux/Unix. You may wish to set the permissions on each file within the /limesurvey/admin directory to &#039;&#039;Read Only&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Hint:&#039;&#039;&#039; If you are using Linux then depending on your webserver configuration you will have to chmod the rights on the writable folders to 755 or 777. Try 755 first - if it does not work &#039;upgrade&#039; to 777.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=8. Run the installation script=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Go to &amp;quot;http://your.domain.com/limesurvey/admin&amp;quot;&#039;&#039;&#039;. If you configured everything correctly the LimeSurvey installer should be starting - just follow the instructions. You will be asked if to create the database and/or create the tables inside the database. Limesurvey then creates the needed tables in the database.&lt;br /&gt;
&lt;br /&gt;
=9. Connect to the administration script for the first time=&lt;br /&gt;
&lt;br /&gt;
After the installer has finished you are done! Open your browser and enter the URL of your admin.php script. Assuming you used LimeSurvey as the directory name to store the files in, this will be something like &amp;quot;http://your.domain.com/limesurvey/admin/admin.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should get a login screen. The default login credentials (if not changed during in the installation) are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt; User: admin&lt;br /&gt;
&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be prompted to change the default password after you logged in. Have fun!&lt;br /&gt;
&lt;br /&gt;
=10. What if I have problems...=&lt;br /&gt;
&lt;br /&gt;
Like all computer programs, most of the time things will work just like the instructions say, but sometimes they just won&#039;t. There are too many possible reasons for things not going according to plan to describe here. If you have trouble, first check out the [[Installation FAQ]]. If you don&#039;t find your answer there please post your problem and any error messages in the [http://www.limesurvey.org/en/forum LimeSurvey forums] on limesurvey.org or join the [irc://irc.freenode.net/limesurvey|LimeSurvey IRC channel]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&#039;&#039;&#039;[http://www.limesurvey.org/en/community-services/live-chat Direct link to the official LimeSurvey IRC Channel]&#039;&#039;&#039;&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3566</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3566"/>
		<updated>2012-09-20T10:57:14Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use this instruction if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be atuomatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3567</id>
		<title>Upgrading from a previous version</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Upgrading_from_a_previous_version&amp;diff=3567"/>
		<updated>2012-09-20T10:57:04Z</updated>

		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Before you start...=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&#039;color:#FF0000&#039;&amp;gt;... read this because it is very important: &#039;&#039;&#039;Always backup the files and the database of your current installation!!&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this using a database adminstration tool like [http://www.phpmyadmin.net phpMyAdmin] etc. and a file manager! If you don&#039;t know how to do this you should better not proceed but ask someone who knows or use the [[ComfortUpdate]] instead.&lt;br /&gt;
&lt;br /&gt;
=The quick way (for minor version changes)=&lt;br /&gt;
&lt;br /&gt;
You can use this instruction if you are doing a minor upgrade  (for example from 2.00 to 2.01)&lt;br /&gt;
*Backup your files and database (did we already mention that?)&lt;br /&gt;
*Delete all the old files/directory except for&lt;br /&gt;
**/application/config/config.php&lt;br /&gt;
**/upload directory&lt;br /&gt;
*Copy the new files from the new LimeSurvey package to the existing location.&lt;br /&gt;
*&#039;&#039;&#039;After the upgrade: Clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=The thorough way (for big version jumps)=&lt;br /&gt;
&lt;br /&gt;
Unfortunately there are a couple of things to consider, so please scan the following instruction closely.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 2.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the latest version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. For example in Linux tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory.&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or use the according &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file, modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Open http://&amp;lt;yourdomain&amp;gt;/&amp;lt;yourlimesurveydir&amp;gt;/admin in your browser and follow the instructions (you can use the old config.php as reference). The existing database will be atuomatically detected and , if necessary, upgraded after confirmation.&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Check if any special manual checks apply as listed below&lt;br /&gt;
# &#039;&#039;&#039;Now clear your browser cache and cookies!&#039;&#039;&#039;&lt;br /&gt;
# You are done (:biggrin:).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 2.xx&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from version 1.50 or later to any later 1.xx version==&lt;br /&gt;
#[http://www.limesurvey.org/download Download] the desired version of LimeSurvey.&lt;br /&gt;
# Prepare and backup the old installation&lt;br /&gt;
## Backup your installation directory files and SQL-based database just in case.&lt;br /&gt;
### At the command-line level, make a &#039;&#039;&#039;.zip&#039;&#039;&#039; or similar archive of the whole installation directory tree of files. e.g. tar cvzf foo.tgz cps100 will tar and zip the whole of the cps100 directory&lt;br /&gt;
### Using phpMyAdmin or similar to export all tables; or using the &#039;&#039;&#039;Limesurvey Administration&#039;&#039;&#039; button [[File:button-export-sql.png]] to backup the entire database&lt;br /&gt;
## Copy your &#039;&#039;&#039;config.php&#039;&#039;&#039; file ,modified &#039;&#039;&#039;template&#039;&#039;&#039; directories and the /upload directory separately for quick access later.&lt;br /&gt;
# Replace all the installation directory files&lt;br /&gt;
## Delete all old files in the existing installation directory&lt;br /&gt;
## Upload and unpack the new code version into the same installation directory&lt;br /&gt;
## Edit or replace the &#039;&#039;&#039;config.php&#039;&#039;&#039; file:&lt;br /&gt;
### If your previous version was &amp;lt; 1.70: Edit the new &#039;&#039;&#039;config.php&#039;&#039;&#039; to reflect changed settings in the backup &#039;&#039;&#039;config.php&#039;&#039;&#039; file. &#039;&#039;&#039;Do not just overwrite the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your old one!&#039;&#039;&#039;&lt;br /&gt;
### If your previous version was &amp;gt;= 1.70: Simply replace the new &#039;&#039;&#039;config.php&#039;&#039;&#039; with your backup &#039;&#039;&#039;config.php&#039;&#039;&#039; (as the file format has not changed).&lt;br /&gt;
## If your previous version was older than 1.90: Copy any customized templates to /upload/templates - you will also need to rename each template directory whose name matches an existing template in /templates.&lt;br /&gt;
## Copy your /upload directory back to the old location&lt;br /&gt;
## Double check the &#039;&#039;&#039;permissions&#039;&#039;&#039; set on the directories (write access to &#039;&#039;&#039;/tmp&#039;&#039;&#039;, &#039;&#039;&#039;/upload&#039;&#039;&#039; and and their subdirectories is required) as described in [http://docs.limesurvey.org/tiki-index.php?page=Installation&amp;amp;structure;=English+Instructions+for+LimeSurvey#Set_Directory_permissions Installation]&lt;br /&gt;
# Finishing the installation&lt;br /&gt;
## Once you open the URL to your LimeSurvey administration the database tables will be updated after confirmation&lt;br /&gt;
## Remove or rename the &#039;&#039;&#039;/admin/install&#039;&#039;&#039; directory as/if instructed by the installation script&lt;br /&gt;
## Check if any special, manual checks apply as listed below&lt;br /&gt;
# You are done (:biggrin:). If you notice any problems after the upgrade: Clear your browser cache and cookies!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Special checks after an upgrade&#039;&#039;&#039;:&lt;br /&gt;
*&#039;&#039;&#039;from any earlier version to 1.92&#039;&#039;&#039;: The &#039;&#039;&#039;templates&#039;&#039;&#039; have been changed in a lot of places. Please check your customized templates if they are still looking right. If not you will have to edit your templates accordingly (check out the original templates to see what was changed)&amp;lt;br/&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;from a version earlier than v1.53&#039;&#039;&#039;: When upgrading from a version before v1.53 to the latest version, please check the &#039;&#039;&#039;global user rights&#039;&#039;&#039; of each user. There was a new &#039;&#039;&#039;superadmin&#039;&#039;&#039; right introduced in v1.53 that can give a user the same privilege as the master administration account created during the install. The upgrade script is guessing who to give this right to in the older versions.  As this is not perfect, it should be carefully checked.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Upgrading from a version earlier than v1.50 (v1.0 through v1.44)==&lt;br /&gt;
&lt;br /&gt;
Since the data structure and a lot of other things were changed, &#039;&#039;&#039;upgrading from any version previous to v1.50 is NOT possible&#039;&#039;&#039;.  If you have old survey structure files with a *.sql extension the only way to get these into a newer version is to install [http://www.limesurvey.org/en/archived-releases/finish/24-archived-releases/289-limesurvey150zip version 1.50], import the .sql file(s) there, then upgrade that version to the most recent LimeSurvey version. See the also then page [[Transferring an installation]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Upgrade FAQ=&lt;br /&gt;
&lt;br /&gt;
==What is the most actual LimeSurvey version that still supports PHP4?==&lt;br /&gt;
&lt;br /&gt;
The last release offering PHP4 support was version 1.82+.&lt;br /&gt;
&lt;br /&gt;
==Can I upgrade even if I have active surveys?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can. Exceptions may be mentioned in the thorough instructions above. We strongly advise to test your surveys after upgrade to check if your design templates still work alright.&lt;br /&gt;
&lt;br /&gt;
==What is best way to port LimeSurvey *.sql survey structure files to the latest version?==&lt;br /&gt;
&lt;br /&gt;
Install version 1.50, import the file and export the survey structure to the newer .csv format. The latest version still can read the .csv survey structure format.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>