The code
widget allows survey programmers (SPs) to insert customized Perl code into a survey page, and thereby change the basic functionality of IntelliSurvey. Use this only in special circumstances where it is necessary to accomplish tasks that cannot normally be performed with standard IntelliSurvey functions.
Note: SPs can use the code
widget to override nearly any standard behavior, or even to write custom software applications. This requires significant programming experience, however, and such use is beyond the scope of this documentation. Certain security restrictions also apply to the use of the code
widget.
Syntax
code: <<END #Perl code here END
Tags
The following tags are commonly used with the code
widget.
Tag |
Input |
Description |
---|---|---|
|
y/n |
When set to "y", applies the code to every form/page of the survey. Set to "n" to only run the code on the form where the widget is featured. |
|
Perl code |
Specifies the starting point of special Perl code and a label that identifies where the Perl expression ends. (The Perl expression ends at the next instance of the label you specify.) The |
|
Any text |
Allows a single line programming comment to be placed inline within a widget. |
|
Accepts 'y' or 'n' |
Execute the widget function on page load (yes), rather than page submit (no). |
|
String |
Acceptable values are: |
|
Filename |
The |
|
Perl code |
The |
|
Accepts 'y' or 'n' |
Specifies whether to include a question, list or group in the Excel output file that is generated by the translation tool. If you use the |
|
Element ID |
A class is a set of source code that can be reused repeatedly throughout a survey. The |
Phase
The 'phase' can be one of 'setdata', 'validate', or 'action'. When loading a page, the phases are executed in that order. The 'setdata' phase should be used when data needs to be set; the 'validate' phase should be used when field responses need to be validated; and the 'action' phase should be used when handling logic after data setting and validation (e.g., sending email, redirecting to another page). The phases can be specified to run when the page is loading ('onload:
y
', the default) or when the page is being submitted ('onload:
n
').
Comments
0 comments
Please sign in to leave a comment.