Xoetrope
View

Screenshots •  Videos •  Demos •  Documentation •  Tutorials •  Articles •  Knowledge Base •  Zone


Configuring a survey

Startup properties

A survey application requires some additional configuration that needs to be set up in project's startup.properties file. The example of the survey specific part of the file is shown below.

 
 
Listing 1 - project's startup.properties file
 
 
SurveyName=SampleSurvey
SurveyInputType=Db
SurveyOutputType=File
SurveyOutputFile=responses.xml
FinishPage=ThankYouPage
DefaultQuestionFormat=TemplateQuestion
QuestionsPerPage=5
LifeCycleListener=com.xoetrope.survey.SurveyManager
RestartSurvey=true
Language=en
 
 

The meaning of the properties above is as follows:

  • SurveyName defines a unique name of the Survey. The value of this property is used by the SurveyManager to retrieve survey questions (either from database or local files).
  • SurveyInputType defines where the survey questions should be read from. The property can be set to either File or Db. The File value specifies that the questions will be read from local files stored in the project's lang folder. Name of each file containing survey questions should be in the format [language_code]_[survey_name].xml. The Db value means that the questions should be retrieved from a database whose connection properties are defined in the project's database datasource file.
  • SurveyOutputType indicates a place where the user responses will be stored. The property can take two values: File - responses are saved to the file specified by the SurveyOutputFile. Db - responses are stored in the database.
  • SurveyOutputFile points to a file where the answers given by the user will be saved in case the SurveyOutputType property is set to File.
  • FinishPage specifies the name of a page which will be show when the survey is over (there is no more questions to be asked) Setting this property is optional.
  • DefaultQuestionFormat indicates the component that should be used to render questions and options in the application. There are four possible values of this property: Question, WrapQuestion, KioskQuestion and TemplateQuestion. Each of them will be described later.
  • QuestionsPerPage is the maximum number of questions that can be shown at a time on a single page.
  • LifeCycleListener has to be set to com.xoetrope.survey.SurveyManager in order to properly initialize the survey application (prepare data sources)
  • RestartSurvey can get true/false value specifying whether the SurveyManager should automatically restart an application, after a few seconds delay, when the survey is over.
  • Language is the code of a language that should be selected when the survey application is started. By default this property is set to an en value (English language).

Question Pages

There are four possible ways of rendering questions and possible answers in a survey application.The one that should be used is specified by the DefaultQuestionFormat startup property which can take the following values:

Question
The possible answers are rendered as a set of mutually exclusive checkmarks, mutliple choice checkmarks or free text edit fields, depending on the type of a question. The screenshot below is an example of this type of rendering.

 
 
Question
 
 

 
 

WrapQuestion
Question text is rendered as a single strip wrapped over multiple lines and without using a header. The screenshot of a sample application using this type of rendering is shown below.

 
 
WrapQuestion
 
 

 
 

KioskQuestion
Question text is rendered in a form suitable for kiosk displaying one question at a time. The example is shown below.

 
 
KioskQuestion
 
 

 
 

TemplateQuestion
Questions are rendered using the customizable page templates. More detail description of Question and Page templates can be found here. The screenshot below shows a sample Page Template.

 
 
TemplateQuestion
 
 

 
 

A Welcome Page

A welcome screen, pointed to by the StartClass startup property, is used to present the user with some information about the survey and also allows to choose the language in which the survey is presented. The list of available languages is specified in the lang/LanguageList.properties. The screenshot below shows a sample WelcomePage generated by the SurveyWizard.

 
 
Welcome Page