DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Simple Survey

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2008-09-28T14:43:30
Classification:simplesurvey
Description:The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ----
Keywords:forEditors, forAdmins, forBeginners, surveys, polls, tests, csv, umfragen, questionaire
Author:Michael Kuzmin
Email:michael.kuzmin@stp-online.de
Info 4:
Language:en

img-1 img-2 EXT: Simple Survey - simplesurvey

EXT: Simple Survey

Extension Key: simplesurvey

Language: en

Keywords: forEditors, forAdmins, forBeginners, surveys, polls, tests, csv, umfragen, questionaire

Copyright 2000-2008, Michael Kuzmin, <michael.kuzmin@stp-online.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

Table of Contents

EXT: Simple Survey 1

`Introduction 4 <#1.1.Introduction|outline>`_

What does it do? 4

Screenshots 4

`Administration 14 <#1.2.Administration|outline>`_

Backend 14

TypoScript 14

CSS 14

Template 15

`Configuration 16 <#1.3.Configuration|outline>`_

Questions and user data 16

Survey 16

`Known problems 19 <#1.4.Known%20problems|outline>`_

`To-Do list 20 <#1.5.To-Do%20list|outline>`_

`ChangeLog 21 <#1.6.ChangeLog|outline>`_

Introduction

What does it do?

  • This extension helps you to create surveys which will be displayed in the frontend. The surveys will be created in the backend and have several options. You can create dependences, save the results to the database, send an email to listed addresses and also to the user which filled out the survey, use one question in several surveys, show a statistic of the results in the frontend and in the backend, define mandatory fields, separate questions and user data, use templates for the survey and the emails, export the results to CSV, ...
  • If you like this extension it would be great if you could support the development with a small donation... michael.kuzmin@stp-online.de

Screenshots

img-3

Backend – question1

img-4

Backend – question2

img-5

Backend – help

img-6

Backend – user data

img-7

Backend – survey (screenshot from version 1.5.4!!!)

img-8

Frontend – overview

img-9

Frontend – survey1

img-10

Frontend – survey2

img-11

Frontend – goodbye

img-12

Frontend - results

img-13 Backend - web->info

Administration

Backend

To create a survey you have to log in to the backend and go to “web”->”list” and create a SysFolder anywhere in your page. Then you can create a new data record “surveys”. In this you can configure your survey. You also have to create some questions in the SysFolder in fact the survey only shows already created questions ;) User data are also stored there, but are not mandatory... If you have finished creating questions and surveys and the page including the plugin has caching enabled, please clear the cache manually! (or disable caching for this page...)

If you want to know the results, you can enable to save the results in the database. Then you can evaluate the results in “web”->”info”. There you have to choose “SimpleSurvey results” in the drop down list and select the SysFolder containing the surveys in the tree.

If you want to create and test your own unit tests you have to install the extensions “oelib” and “phpunit”.

TypoScript

If you use this TS, the settings will overwrite the settings filled in the backend!

plugin.tx_simplesurvey_pi1.results_at_a_time = 10 the number of surveys shown in the list view. Default: 20

plugin.tx_simplesurvey_pi1.maxPages = 3 the number of pages shown in the list view. Default: 5

plugin.tx_simplesurvey_pi1.template = fileadmin/survey/tmpl.html the absolute path from the typo3 folder to the template file

CSS

In the simplesurvey extension directory is a sample CSS-file!

You can style the survey with following CSS-classes:

- in the survey

tx-simplesurvey-pi1

tx-simplesurvey-pi1-notemplate

tx-simplesurvey-pi1-title

tx-simplesurvey-pi1-caption

tx-simplesurvey-pi1-description

tx-simplesurvey-pi1-questiontext

tx-simplesurvey-pi1-help

tx-simplesurvey-pi1-question

tx-simplesurvey-pi1-answer

tx-simplesurvey-pi1-error ( this is not a class, it's an id! )

tx-simplesurvey-pi1-uploaderror

tx-simplesurvey-pi1-submit

- user data area in the survey

tx-simplesurvey-pi1-userdata

tx-simplesurvey-pi1-userdata-title

tx-simplesurvey-pi1-userdata-answer

- result view

tx-simplesurvey-pi1-results-not-allowed

tx-simplesurvey-pi1-result-header-questions

tx-simplesurvey-pi1-result-question

tx-simplesurvey-pi1-result-percent

tx-simplesurvey-pi1-result-answer

tx-simplesurvey-pi1-result-noanswer

tx-simplesurvey-pi1-result-userdata

tx-simplesurvey-pi1-overall-points

Template

The following lines are copied from the default_template.html and shows a sample of a template. You can change the order, delete unneeded markers or even add own CSS-classes or hard coded text!

###TITLE### The survey title will be inserted here.

###CAPTION### The caption will be inserted here, if available!

###DESCRIPTION### The description appears here...

<!--###QUESTIONS### start--> Begin of question loop. It will be repeated as long as a question is available!

###QUESTIONTEXT### The numeration of each question gets here with a continuously number!

###QUESTION### The question of the current question loop.

<!--###ANSWERS### start--> Begin of answer loop. It will be repeated as long as an answer is available!

###ANSWER### The answer of the current answer loop.

<!--###ANSWERS### end--> End of answer loop.

<!--###QUESTIONS### end--> End of question loop .

###USERDATA### All user data fields are inserted here!

###ERROR### The error message appears here, if a mandatory field is not filled out.

###SUBMIT### The submit button gets here.

Configuration

CREATE A SURVEY AND FOLLOW THIS MANUAL STEP BY STEP FOR EACH FIELD TO UNDERSTAND WHAT IT DOES!

Questions and user data

First you can set the type to one of the usual form fields (text, text area, radio button, ...).

In the next field you have to insert the question...

Next you can define if the field should be a mandatory field - else it can be left blank in the survey. Madatory fields will be marked with a "*" (not in static text and upload field).

If you choosed the type “selectorbox”, you now can specify the size of it. If you leave the default value (0) or set a 1, it will be a drop down box – if you set a value from 2-9 it will be that size.

In the answer field you can set the answers:

DropDown, Radio, Checkbox: Each line will be one answer, if one line starts with @ this line will be set as default selected/checked. If you set more than one @ value in the DropDown or Radio, the last one will be marked. If you don't set a @ value in the DropDown, the first value it marked.

Text, Textarea: If one line starts with @ this line will be inserted as default. If you don't write a @ sign, this content will be inserted in the text/textarea tag! This can be used to set the size or a class (cols="30" rows="20")... Here is an example:

@This is the first line of the textarea

cols=”30”

rows=”20”

@This is the second line of the standard text. Both lines will be inserted by default.

Static text: Insert ANY text you want! You can also use HTML-Tags like <b> <i> ... This is useful if you want to insert a small explanation or an image. Also you can insert JS-scripts etc.

Upload: When you insert a upload field, you an specify the maximum file size in bytes. It is marked with an @! For example @100000 will limit the file size to 100kb. Next you have to specify the allowed file types! Here you simply insert the valid MIME-Types separated by a line break. For example text/plain will limit the file types to simple txt-files. A list of valid MIME-Types can be found here: http://de.selfhtml.org/diverses/mimetypen.htm

Example for text/pdf/word files which are smaller than 100kb:

@100000

text/plain

application/pdf

applicaton/msword

Mandatory rules are only available when you use drop down or radio button. Each line contains one answer-text, which should be mandatory be selected/choosed. Because in a DropDown-field and in Radio Buttons you can only select one answer, one answer in a line is allowed! The mandatory-field will fail if an answer is choosen, which is not listed in this field!

If you use checkbox as a mandatory field, all checkboxes must be checked in the frontend!

In the field tooltip information you can insert an information text which will be displayed when the user clicks on the “?” near the current question. If it is blank the “?” will be hidden. (not available in static text!)

Choose, if the question should be displayed in frontend or not (only questions / not in static text and file upload).

Survey

You can set a title,

a caption

and a description.

Then you can add questions to the survey (you have to create the questions first and then insert them here).

Now you can create dependences.

" question2 > question1 = Yes;Maybe " without quotes means that the question with the id 2 only appears if the question with the id 1 is " Yes " or " Maybe ". Multiple answers are separated by a ; One dependence per line! "userdata" instead of "question" for the user data fields!

Here you can activate the pointing system where each question can get a number of points.

If the previous checkbox is checked you can insert the pointing-rules in the field “Allocate points”.

question1 = Berlin > 5 ” without quotes means that the user gets 5 points if he answers the question with the id 1 with “ Berlin ”. Multiple answers are separated by a ; Both answers will get 5 points... One point per line! If a question is not listed here, it will be ignored in the pointing system. Here a simple example:

->question1: What a number has PI?

question1 = 3.14 > 5

question1 = 3.1 > 4

question1 = 3 > 2

If a user types in 3.14 he gets 5 points. If he types in 4 he will get 0 points because it is not listed! You can also set negative values!

In the next two checkboxes, which are only shown if the pointing system is activated, you can define if the number of possible points are shown after a question...

...and if the user will get an overview of his attained points when he finished the survey (in the results and the email).

In the next field you can set the text of the numeration. For example "Question #:" (without quotes) will be shown as "Question 1:" etc. So the # will be replaced by the current question number. If no # is found, the number will be placed at the end. Uncheck the box if you don't need numeration of questions.

In the next field you can set a title for the submit button.

In the template field you can set your own html-template for the look of the survey. Else the default-template.html will be taken - take a look at the Template chapter if you want to see, how to set up your own template!

In the field "Mandatory field error text" you can set a short text which will appear, if a mandatory field is not filled.

In this field you can choose if the survey results should be available in the frontend or not.

Here you can say that questions which are not anymore in the survey, will not be displayed in the results.

In the "Survey result to following e-mails"-field you can add mails where the result of the survey will be sent to. Separate the mails by a simple linebreak - each line should only contain one email!

In the next four fields you can enter the mail subject...

...the senders mail...

...the sender name...

...and optional a HTML-template file. Use ###CONTENT### in the HTML- file if you want to fill in the survey result there. If a template is selected, the next field will be ignored!

And finally the content of the email. Use ###CONTENT### in the text if you want to fill in the survey result there.

If you want to save the results to the database you can check this field. (Needed if you want to evaluate the survey results in the backend!)

The target-page is the page where the user will be sent to, when he submits the form. This should only be a page id (123) or a website (http://www.yourpage.com)! If it's blank he will get to the same page without the form but a good bye text (see next point)...

The "goodbye text" will be shown if you filled out a survey and no target page is defined (use ###CONTENT### in the text if you want the user to show the result again)!

Next you can add some userdata-fields - this can be for example the users lastname, his email, company, etc. (to use this, the user data fields have to be created like the questions).

If you have set a user data field with the users e-mail you can send him an affirmation-mail by checking this box.

...and if the box is checked you have to set the field, where the mail will be filled in (e.g. the e-mail field) by the user.

In the next three fields you have to insert the mail subject (Thanks for filling the survey!)

and the senders mail (survey@yourcompany.com)

and the senders name if you want to send a mail to the user or/and yourself. These three fields will apply to the emails in the “receipt mails field” and the affirmation email.

In the Mail-Template field you can upload a HTML-file for the user- mail. Use ###CONTENT### in the HTML-file if you want to fill in the survey result there. If a template is selected, the next field will be ignored!

Now you can set the content of the mail which will be send to the user - use ###CONTENT### in the text if you want to fill in the survey result there.

Known problems

Caching must be disabled for the page including the plugin or you have to clear the cache after every change in a survey (in some cases)!

If you have found a bug or got ideas for new features, please send me an email! Michael.kuzmin@stp-online.de

To-Do list

Search for bugs (Add some Unit Tests), cleanup code, add new functions/make old ones better.

Add support for multiple pages surveys.

ChangeLog

1.8.1: Fixed a bug in the Backend result view (Web->Info)!

1.8.0: Added mandatory field support for DropDown, RadioButton and CheckBoxes. HTML-templates for the mails. Protect uploaded files with a md5-folder and a index.php file in there. Changed the renaming of uploaded files. Uploaded files are visible to the user when finished the survey. A single result can be viewed in the backend. Added option not to show the numeration of questions. Size of selectorbox can be changed. Updated to the new manual.

1.7.2: Fixed an error with fullQuoteString!

1.7.1: Important security fix. Please update!

1.7.0: View the results in the Backend using Web->Info! Export the answers to CSV. Fixed a critical JS-Bug with the dependences - please update! Added more information in the db when a file is uploaded.

1.6.0: Added the function to show a single survey instead of the whole list on a page. Changed the plugin options - please update the path in the options or the old one will be used! Fixed a JS-Error when a dependence with a question which is not in the survey was defined.

1.5.4: Fixed a bug when using special characters as standard text. Updated screenshots in the manual.

1.5.3: Added help icons in the backend. Small fix in the pointing system. Some small fixes.

1.5.2: Please update! Bug in text field when you have more than one line in the "answers"! Changed the way of reading out the answers of the text-field and area (read the manual)!

1.5.1: Fixed a bug with the checkbox when upload failed. Fixed a bug when nothing is inserted in the answers(checkbox, radiobutton, dropdown). Removed the title of the static text in the frontend. Fixed a bug with the tooltip when using ' " < > . Fixed a bug where under userdata the upload- and static text-field could appear several times. Changed the structure in the backend. Fixed a bug with the textarea.

1.5.0: Fixed an error checking the mandatory fields! An error was shown when no upload field was available. The form will only be send when the upload file (if any) is valid (size, type, no error). The uploaded file will be send with the mail. The help tooltip will now be shown in the user datas, too. Some fixes for the static text (no help icon, no questiontext). Made some changes in the sample-css. Some small fixes.

1.4.0: Added two more types: Upload field and static text. Separated the mails for the admin and the user. Added the possibility for a help tooltip for each question. Fixed a bug where the textarea answer is shown twice. Removed some TypoScript options!

1.3.1: Changed E-Mail check. Added ability to make Unit Tests! Added a sample CSS-file.

1.3.0: Added a pointing system. Added a option to hide deleted question in the results. Fixed some bugs. Added more flexibility in customizing the look (CSS).

1.2.5: Two small bugfixes. Restructure in the backend. JavaScript code cleanup.

1.2.4: Fixed the bug with the dependences and some small bugs! New screenshots in the manual. JavaScript code cleanup.

1.2.3: Fixed a bug in the dependences (not all questions were hidden). Fix: Only shown questions will be saved in the DB. Added the field senders name to the survey and removed it from the xml-file! Made the manual better to read.

1.2.2: Sorting in listview fixed. Added the option not to show the survey results in frontend. Added the option not to show single questions in the frontend. Changed the results view. Removed the userdata from the results (privacy!).

1.2.1: Show results for each survey. Fixed the manual...

1.2.0: Changed the database structure – old surveys get lost! Fixed a bug with the checkboxes. Added a manual...

1.1.1: Bugfixes in the dependences. Changed the template - take a look at the new default_template.html!

1.1.0: Fixed a bug with the text area. Added the abbility of dependences - read the readme.txt!

1.0.5: Added some fields, questions now have to be in the same folder as the survey.

1.0.4: Fixed a bug with sending mails.

1.0.3: Added some help to the readme.txt

1.0.2: Last version doesnt work beause of an syntax-error... Sorry

1.0.1: Some fixes for customizing and language-handling

1.0.0: Initial release.

21