Templated question |

|
The templated questions in FeedbackServer is one of the most powerful question types along with the free form question type. Question templates let us create a specific template based on any kind of html, plain text we want, once this templated has been created it will automatically be rendered at runtime using the current answer items available within our templated question.
In order to create a question we first need to setup a template in the Question Templates library.
The template management provides following options to setup :
- Edition Language templates can be different from each language and by selecting the language we can choose for which language we are currently editing the template.
- Template Title we can set the title of template shown when we select the template from the templated question screen.
- Template Header allows us to setup a header which will appear on top of our answers list.
- Template Body allows us to setup the body, this body will be repeated as many times as there are answers available for the question. Each body can have following tags which will be replaced at runtime.
-
- [fs:answeritemlabel] : Will be replaced at runtime by the label text of the answer being setup in the answer settings screen.
- [fs:answeritem] : Will be replaced at runtime by the answer of the question.
- [fs:answerstyle] : Will be replaced by the current answer style of the survey answers styles. Note that the style generated at runtime is a standard html style based text.
- [fs:questionstyle] : Will be replaced by the current answer style of the survey questions styles. Note that the style generated at runtime is a standard html style based text.
- Template Alternating Body is repeated each 2nd answer generated by the question.
- Template Footer allows us to set up a footer after all answers have been generated
Template Question Examples
Using following template FeedbackServer will generate following output for each templated question based on this template :
Template Header
<table style='[answerstyle]'>
Template Body
<tr style= 'background:red'><td>[fs:answeritemlabel]</td><td valign="top">[fs:answeritem]</td></tr>
Template Alternating Body
<tr style='background:yellow'><td valign="top">[fs:answeritemlabel]</td><td>[fs:answeritem]</td></tr>
Template Footer
</table>
This simple HTML table based template will produce the output we can see below. We can of course use any kind of tags, text we want to create our own personalized template, there is really no limitation on how the output can look like.
