SSI Script
Top  Previous  Next

SSI Script is a scripting language that you can use within SSI Web. You can use SSI Script to write small sections of customized code that will enhance your web survey.

Where can SSI Script be Used?  
Displaying Responses to Previous Questions  
Functions  
Unverified Perl  



Where can SSI Script be Used?

SSI Script can be used in the following areas:

·Skip Logic - In Skip Logic skips are executed if the SSI Script that you provide evaluates to true. If, for example, the expression:  
 
((Q1 + 3) > Q2) And (Q5 < 8)  
 
evaluates to true then the skip is taken. Note that no beginning and ending [% %] SSI Script tags should be used when specifying SSI Script within Skip Logic.  
 
·List Building - Constructed lists are created by using SSI Script List Functions. For example:  
 
AIC(Q1)  
INSERT(5, ColorList)  
 
Note that no beginning and ending [% %] SSI Script tags should be used when specifying SSI Script within List Building.  
 
·Inline – Inline scripting involves inserting sections of SSI Script into your text or HTML. To enter a section of SSI Script into your text it must be wrapped by [% and %]. For example the following text could be entered into the header of a question:  
 
Why do you spend [% (PhoneHours / TotalHours) * 100 %] percent of   
your time at work on the phone?  
 
SSI Script is processed/executed on the server before it is sent down to the respondent's browser. The script between [% and %] is executed and the result is inserted into its place. If the respondent had answered 18 for the question PhoneHours and 40 for the question TotalHours, then the above text would be displayed to the respondent as:  
 
Why do you spend 45 percent of your time at work on the phone?  
 
·Question Settings – You can enter SSI Script in some question settings . For example, the Total setting in a Constant Sum question accepts the answer to a previous question. So, if [% Q1 %] were entered into the Totals field, then the respondent's answer to Q1 would be used as the total required for the Constant Sum question. Note that beginning and ending [% %] SSI Script tags are needed when specifying SSI Script within question setting fields.  
 
·Quota Control – You can enter SSI Script in the qualification logic that indicates whether a respondent qualifies to count toward a Cell Limit. Note that beginning and ending [% %] SSI Script tags should not be used when specifying SSI Script within quota control qualification logic.  
 
We admit that it might be confusing to remember when [% %] tags are needed or not when adding SSI Scripting to your questionnaire--or whether SSI Scripting is permitted at all in specific areas. Fortunately, SSI Web will give you an error message if your syntax is incorrect. When in doubt, just try using SSI Script and then click the "Check" checklogic icon to have SSI Web check your syntax. For example, it may tell you that the "[" character is not valid (which indicates that the tags are not needed). If you see the pencil "Pencil" icon next to a field in SSI Web, that is an indicator that SSI Scripting is permitted for that field.



Comments


You might find it useful to add comments to your SSI Script. To add a comment, use a single quote character prior to the comment text. For example:

'Here I'm adding the items that were chosen  
AIC(Q1)  
 
or  
 
[% 4 + Q1 'Here we are adding 4 to the answer to Q1 %]  

Everything after the single quote on the same line (except for the closing "%]" ) is a comment and is ignored when the SSI Script is executed.