<?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=Tacman1123</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=Tacman1123"/>
	<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/Special:Contributions/Tacman1123"/>
	<updated>2026-08-11T03:20:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Report_Writer&amp;diff=2956</id>
		<title>Report Writer</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Report_Writer&amp;diff=2956"/>
		<updated>2012-04-17T15:19:49Z</updated>

		<summary type="html">&lt;p&gt;Tacman1123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When surveys are used for data collection, sometimes people have a need for very specific reports and they&#039;d like integrated with the system.  For example, an advocacy group doing a candidate questionnaire for someone running for political office may want to format the results in a way that can be published on their website.  Or a health survey may want to print out advice that&#039;s specific to the responses.&lt;br /&gt;
&lt;br /&gt;
== Template Engine==&lt;br /&gt;
&lt;br /&gt;
For security reasons, I propose that the reports be written in a template engine, like Twig, is designed for rendering output.  Allowing users to write PHP code is complex and potentially a huge security risk.&lt;br /&gt;
&lt;br /&gt;
== Creating the Report==&lt;br /&gt;
&lt;br /&gt;
I propose that the Report Editor have the same look and feel as the Template Editor, and possibly even use the same permissions, since templates and reports are in fact quite similar.  Reports, in fact, can have their own templates that are independent from the website templates.  From the main page, I propose adding an icon, in this graphic are example of three custom modules, one is Report Writer.&lt;br /&gt;
&lt;br /&gt;
800&lt;br /&gt;
&lt;br /&gt;
The Report Writer module has the template files, and by choosing a survey, the fields from that survey are also listed:&lt;br /&gt;
&lt;br /&gt;
800&lt;br /&gt;
&lt;br /&gt;
== Connecting Reports and Surveys==&lt;br /&gt;
&lt;br /&gt;
Most reports will be specific to a survey, or more generally speaking, specific to data within a survey.  So there needs to be a way to designate which surveys can be used with which reports.  I envision a table of survey_id, report_id (and possibly some permission attributes), that could be done via a checkbox list within the survey configuration.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Reports Within Result Browsing===&lt;br /&gt;
&lt;br /&gt;
Right now, there is an search icon that allows the administrator to view a survey response.  Next to that icon, there could be a dropdown list of all the reports available, with &amp;lt;default&amp;gt; being the current report.&lt;br /&gt;
&lt;br /&gt;
We could also allow multi-page reporting by letting admins check which responses they wanted to see and having the dropdown at the bottom, next to the red x (delete all responses).\&lt;br /&gt;
&lt;br /&gt;
===Viewing A Report Within Individual Response===&lt;br /&gt;
&lt;br /&gt;
On the page with the raw response (action=browse, subaction=id) we could have a dropdown or list of reports associated with this survey.  Choosing one would allow the admin to see the data formatted in that report style.&lt;/div&gt;</summary>
		<author><name>Tacman1123</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Group_Codes_Proposal&amp;diff=1403</id>
		<title>Group Codes Proposal</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Group_Codes_Proposal&amp;diff=1403"/>
		<updated>2012-04-04T15:22:17Z</updated>

		<summary type="html">&lt;p&gt;Tacman1123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
I&#039;d like to propose that we add a group code (or &amp;quot;slug&amp;quot;) to the group table, and that it be used when creating variable names an in the Expression Manager.&lt;br /&gt;
&lt;br /&gt;
== The Problem==&lt;br /&gt;
&lt;br /&gt;
Question groups are a great way to have survey building blocks, either for separate surveys or duplicating a block of questions.  But since we now require unique question codes for each question, it&#039;s a lot of work to manage that.  I propose that question codes be unique within groups, and group codes be unique within surveys.&lt;br /&gt;
&lt;br /&gt;
Group codes could also be used in EM.&lt;br /&gt;
&lt;br /&gt;
== The Database==&lt;br /&gt;
&lt;br /&gt;
group_code (or slug) would be added to groups table, and make into a unique index (survey_id, group_code).  During upgrade, we&#039;d need a method to create a group code, either from the current group id (unique), the current order that the group is in with the survey (also unique, and a bit easier to understand) or the group name (checking for duplicates, etc.).&lt;br /&gt;
&lt;br /&gt;
== How it Helps==&lt;br /&gt;
&lt;br /&gt;
Suppose your survey has to do with children&#039;s names and ages.  Right now, you&#039;d create a group &#039;child1&#039; with name and age questions, called child1_name, child1_age.  For child 2, you export child1, import it as a new group, then change all the values one at a time.  Then change all the conditions one at a time.  Then do it again.&lt;br /&gt;
&lt;br /&gt;
With a unique group code, you&#039;d simply have &#039;name&#039; and &#039;age&#039; as qcodes, and a group_code of &#039;child1&#039;.  Internally this would map to &#039;child1_name&#039;.  Now when you import the &#039;child&#039; group, you simply need to change one thing, the group_code, to child2.  Now you have unique qcodes.&lt;br /&gt;
&lt;br /&gt;
== Expression Manager==&lt;br /&gt;
&lt;br /&gt;
Expression Manager would need to change to reflect that some expressions, especially conditions, are within-group only.  For example, if you only want to ask the &#039;school&#039; question if &#039;age&#039; &amp;gt; 3, you&#039;d need to indicate to EM that &#039;age&#039; means &amp;quot;Age within this group&amp;quot;.  If you wanted a specific access, you&#039;d need a format to say &amp;quot;child1.age&amp;quot;, when you mean &amp;quot;the first one listed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Group codes will also make import and exporting surveys easiers, and I&#039;d like to see group_id dropped from everything except very low-level group edit functions.&lt;/div&gt;</summary>
		<author><name>Tacman1123</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Report_Writer&amp;diff=2957</id>
		<title>Report Writer</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Report_Writer&amp;diff=2957"/>
		<updated>2012-04-02T16:35:08Z</updated>

		<summary type="html">&lt;p&gt;Tacman1123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When surveys are used for data collection, sometimes people have a need for very specific reports and they&#039;d like integrated with the system.  For example, an advocacy group doing a candidate questionnaire for someone running for political office may want to format the results in a way that can be published on their website.  Or a health survey may want to print out advice that&#039;s specific to the responses.&lt;br /&gt;
&lt;br /&gt;
== Template Engine==&lt;br /&gt;
&lt;br /&gt;
For security reasons, I propose that the reports be written in a template engine, like Twig, is designed for rendering output.  Allowing users to write PHP code is complex and potentially a huge security risk.&lt;br /&gt;
&lt;br /&gt;
== Creating the Report==&lt;br /&gt;
&lt;br /&gt;
I propose that the Report Editor have the same look and feel as the Template Editor, and possibly even use the same permissions, since templates and reports are in fact quite similar.  Reports, in fact, can have their own templates that are independent from the website templates.&lt;br /&gt;
&lt;br /&gt;
== Connecting Reports and Surveys==&lt;br /&gt;
&lt;br /&gt;
Most reports will be specific to a survey, or more generally speaking, specific to data within a survey.  So there needs to be a way to designate which surveys can be used with which reports.  I envision a table of survey_id, report_id (and possibly some permission attributes), that could be done via a checkbox list within the survey configuration.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Reports Within Result Browsing===&lt;br /&gt;
&lt;br /&gt;
Right now, there is an search icon that allows the administrator to view a survey response.  Next to that icon, there could be a dropdown list of all the reports available, with &amp;lt;default&amp;gt; being the current report.&lt;br /&gt;
&lt;br /&gt;
We could also allow multi-page reporting by letting admins check which responses they wanted to see and having the dropdown at the bottom, next to the red x (delete all responses).\&lt;br /&gt;
&lt;br /&gt;
===Viewing A Report Within Individual Response===&lt;br /&gt;
&lt;br /&gt;
On the page with the raw response (action=browse, subaction=id) we could have a dropdown or list of reports associated with this survey.  Choosing one would allow the admin to see the data formatted in that report style.&lt;/div&gt;</summary>
		<author><name>Tacman1123</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Database_Storage_Engine_Project&amp;diff=4218</id>
		<title>Database Storage Engine Project</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Database_Storage_Engine_Project&amp;diff=4218"/>
		<updated>2012-03-29T18:02:54Z</updated>

		<summary type="html">&lt;p&gt;Tacman1123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Outline=&lt;br /&gt;
&lt;br /&gt;
The project is focused around the Google Summer Of Code of 2010. Maarten [[(UserPage ttielu|ttielu]]) and Pieter-Jan [[(UserPage MrP|MrP]]) are the students assigned to the project.&lt;br /&gt;
&lt;br /&gt;
The project is based on the DB Storage Engine proposal found at [[Project ideas for GSOC 2010]].&lt;br /&gt;
&lt;br /&gt;
= Design and implementation=&lt;br /&gt;
&lt;br /&gt;
A basic domain model of the problem can be found in [http://www.mediafire.com/?mytzjeggien this] pdf file.&lt;br /&gt;
&lt;br /&gt;
This domain model can be used to build multiple databases. One would be to see the objects as tables. For the inheritance there would have to be some analysis to see how they should be mapped to the database. Here it would be important to use a low amount of joins. This structure has the disadvantage that when querying all information of a certain user, loads of joins might be required (depending on the complexity of the survey). On the other hand, queries about all answers on a single question can be very efficient. On top of that, tables are small.&lt;br /&gt;
&lt;br /&gt;
Another example could be to remove the QuestionDependency and make one table per section. This would allow a more flat database structure, which reduces the number of joins necessary to retrieve all data from a single user. This could however create large tables and removes the possibility to loop over one question. This question will have to be placed into a new section and the loop will have to go over that section.&lt;br /&gt;
&lt;br /&gt;
To allow these multiple database formats, we plan on using a [http://en.wikipedia.org/wiki/Factory_pattern factory pattern]. A DatabaseLayoutFactory can be used to choose the layout for a survey and in this way make it possible to add new database layouts for future use (for example a database which duplicates the data in both structures to get fast retrieval of both types of query).&lt;br /&gt;
&lt;br /&gt;
Our plan would be to model the presented database models in detail and then implement at least one of them. Also we would want to model an API for the database (and of course implement that).&lt;br /&gt;
&lt;br /&gt;
After creation of the survey, questions will be more or less static. To build upon this, it would be a good idea to store/cache the questions in a more static form, like a generated html-form, after creation of the survey.&lt;br /&gt;
&lt;br /&gt;
== Database layouts==&lt;br /&gt;
&lt;br /&gt;
=== Flat database===&lt;br /&gt;
&lt;br /&gt;
A flat database would exist of a single table containing all answers to all questions.&lt;br /&gt;
&lt;br /&gt;
Properties of this layout are:&lt;br /&gt;
* easy to export&lt;br /&gt;
* fast database operations&lt;br /&gt;
* hard to implement loops, branching &amp;amp; conditioning (introduce maximums on looping and have loads of NULL values OR use TEXT/BLOB fields containing sub structures =&amp;gt; slow and unsearchable with quick operations)&lt;br /&gt;
* not suited for exotic question types (upload picture, matrix questions, multiple answer, multiple type questions, ...)&lt;br /&gt;
* database column limits might be hit&lt;br /&gt;
* best for simple surveys with huge amounts of answer data&lt;br /&gt;
&lt;br /&gt;
=== Multitable database===&lt;br /&gt;
&lt;br /&gt;
A multitable database would exist of multiple tables each containing the answers of a single question or questiontype.&lt;br /&gt;
&lt;br /&gt;
Properties of this layout are:&lt;br /&gt;
* more difficult to export&lt;br /&gt;
* slower database operations (joins)&lt;br /&gt;
* supports all sorts of branching, conditioning, loops, ... including future features&lt;br /&gt;
* can support pictures, matrix questions, ... easily&lt;br /&gt;
* no problems with database column limits&lt;br /&gt;
* better for complex surveys with smaller amounts of replies&lt;br /&gt;
&lt;br /&gt;
=== Hybrid database (section flat)===&lt;br /&gt;
&lt;br /&gt;
The section flat model is a mix of the previous two models. In stead of mapping all answers in one table, we would map all answers to one section in one table. This allows the more advanced features (like looping, ...) to be handled between sections while still having a fast export of the different sections.&lt;br /&gt;
&lt;br /&gt;
Properties of this layout are:&lt;br /&gt;
* easy to export&lt;br /&gt;
* fast database operations for simple surveys, operations for surveys with loads of loops, branching, ... will need joins (to handle the dependencies)&lt;br /&gt;
* database column limit only for really long sections (but they could be split in multiple sections, solving the problem)&lt;br /&gt;
* can support multiple question types (might result in using more columns, like in case of matrix questions)&lt;br /&gt;
* results in looping over sections instead of looping over questions in sections (hence if there is a loop over one question, there will be a section containing only this question; multiple questions in the same loop can be grouped in one section)&lt;br /&gt;
&lt;br /&gt;
=== Layout mock-ups===&lt;br /&gt;
&lt;br /&gt;
Mock-ups for the database layouts can be found in [http://www.mediafire.com/?nwjwy2c34mw this] pdf file.&lt;br /&gt;
&lt;br /&gt;
The survey used is:&lt;br /&gt;
&lt;br /&gt;
1) how many children do you have? &#039;&#039;&#039;int&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
loop: amount of children {&lt;br /&gt;
&lt;br /&gt;
2.1) give the name of you i&#039;th child &#039;&#039;&#039;string&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2.2) what is the age of your i&#039;th child &#039;&#039;&#039;int&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
3) What kind of ice cream do you like? (multiple choice)&lt;br /&gt;
&lt;br /&gt;
3.1) I don&#039;t like ice cream&lt;br /&gt;
&lt;br /&gt;
3.2) vanilla&lt;br /&gt;
&lt;br /&gt;
3.3) strawberry&lt;br /&gt;
&lt;br /&gt;
3.4) chocolate&lt;br /&gt;
&lt;br /&gt;
3.5) other: 3e) &#039;&#039;&#039;string&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
4) what do you eat? (multiple answer: checkboxes)&lt;br /&gt;
&lt;br /&gt;
4.1) candy&lt;br /&gt;
&lt;br /&gt;
4.2) cookies&lt;br /&gt;
&lt;br /&gt;
4.3) fruit&lt;br /&gt;
&lt;br /&gt;
= Action Plan=&lt;br /&gt;
&lt;br /&gt;
(To be specified more in detail later)&lt;br /&gt;
&lt;br /&gt;
== Outline==&lt;br /&gt;
&lt;br /&gt;
Main deliverables:&lt;br /&gt;
*Database design for flat database&lt;br /&gt;
*Database design for multitable database&lt;br /&gt;
*Database design for section-flat database&lt;br /&gt;
*Class diagram for the database system&lt;br /&gt;
*API and documentation with the database system - keep support for metadata in mind.&lt;br /&gt;
*Implementation of the database system with at least one database layout (more if spare time is found)&lt;br /&gt;
&lt;br /&gt;
== Milestones==&lt;br /&gt;
&lt;br /&gt;
The first series of milestones is slightly smaller since both Maarten and Pieter-Jan have exams in the month of June.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Milestone||Deadline&lt;br /&gt;
|-&lt;br /&gt;
|[[Database Storage Engine Project M1 Database Design||Database designs]]||26th of June&lt;br /&gt;
|-&lt;br /&gt;
|[[Database Storage Engine Project M2 API||API]]||30th of June&lt;br /&gt;
|-&lt;br /&gt;
|[[Database Storage Engine Project M3 Class diagram||Class diagram]]||7th of July&lt;br /&gt;
|-&lt;br /&gt;
|[[Database Storage Engine Project M4 Basic implementation||Implement basic classes]]||14th of July&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second series of milestones contains the biggest part of the implementation and testing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Milestone||Deadline&lt;br /&gt;
|-&lt;br /&gt;
|Test Prototype||31st of July&lt;br /&gt;
|-&lt;br /&gt;
|Finish and test Section Flat plugin||4th of August&lt;br /&gt;
|-&lt;br /&gt;
|Implement and test question types||9th of August&lt;br /&gt;
|-&lt;br /&gt;
|Test and debug the global project||16th of August&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Meeting log=&lt;br /&gt;
&lt;br /&gt;
The meeting log can be found here: [[Database Storage Engine Project Meeting Log]]&lt;/div&gt;</summary>
		<author><name>Tacman1123</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=3371</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=3371"/>
		<updated>2012-02-01T11:43:23Z</updated>

		<summary type="html">&lt;p&gt;Tacman1123: &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;
==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;
|Mandatory||.mandatory||&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input_error|| &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;
== 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 for the current questionm for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&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;
==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;/div&gt;</summary>
		<author><name>Tacman1123</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=RemoteControl&amp;diff=2914</id>
		<title>RemoteControl</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=RemoteControl&amp;diff=2914"/>
		<updated>2011-01-15T17:25:10Z</updated>

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