Defining Answer Sets
To define answer sets, use the Answer Set (RC_ANSWER_SET) component.
This section lists prerequisites and discusses how to create answer sets and derive answers from queries.
Page Name |
Definition Name |
Usage |
---|---|---|
RC_ANSWER_MAIN |
Establish valid answers to single selection or multiple selection questions. |
|
RC_SQL_ANSWER_SCP |
Perform a simple query that generates a list of values to copy into a static answer set. |
|
Question page |
RC_ANSWER_QUESTION |
View the questions that use a specified answer set. |
For dynamic answer sets, define the PeopleCode functions that generate the answers and the rules that determine which PeopleCode function to use.
Use the Answer Set page (RC_ANSWER_MAIN) to establish valid answers to single selection or multiple selection questions.
Navigation
Image: Answer Set page
This example illustrates the fields and controls on the Answer Set page.
![Answer Set page](img/i-42c12a96n-76c3.png)
Answer Set Detail
Field or Control |
Definition |
---|---|
Status |
Select Active or Inactive. This value determines whether the answer set is available to use in a script. You cannot change the status to Inactive after an answer set is used in a script. |
Static Answer |
Select this option to use a fixed list of answers. If you use static answers, you use the script structure on the Script Tree page to determine the next step after a respondent selects an answer. |
Dynamic Answer |
Select this option to derive the list of answers at runtime. If you use dynamic answers, you use rules to determine the next step after the respondent selects an answer. |
Answer Choices
On the Answer Details tab, list the available answer choices.
Field or Control |
Definition |
---|---|
Default |
Select this check box for the default answer at runtime. Select for one answer only. |
Enabled |
Select to make the answer available in scripts. |
Value |
Enter the answer. |
Score |
Enter the score for the answer. A factor based on the weight of the question is applied to the score to determine the final score for the question. The system adds the final scores of all questions in the script to determine the final score for the script. |
Derive Answers |
Click to access the Derive Answer page and generate an answer set based on a query. |
Rules
Select the Rules Detail tab.
Field or Control |
Definition |
---|---|
Default |
Select to always use a specified PeopleCode function to derive answers, then enter a function name but not a rule name. (If you use a default function, you don't need to use rules to select from possible functions.) If you select this check box, do not create additional rows of data, because the system always uses the default function. |
Function Name |
Enter the PeopleCode function that provides the list of answers. |
Rule Name |
To use different PeopleCode programs for different conditions, select the rule that defines the conditions under which the associated PeopleCode program is used. |
Use the Derive Answers page (RC_SQL_ANSWER_SCP) to perform a simple query that generates a list of values to copy into a static answer set.
Navigation
Click the Derive Answers button on the Answer Set page.
Image: Derive Answers page
This example illustrates the fields and controls on the Derive Answers page.
![Derive Answers page](img/i-42c12a96n-76f2.png)
Field or Control |
Definition |
---|---|
Record Name |
Enter the record to query. |
Answer Field |
Enter the field whose values appear in the answer set—that is, the field that corresponds to the Select clause of a SQL statement. |
Filter Information
The filter information corresponds to the Where clause in a SQL statement. If you include multiple rows of data (multiple clauses), the system handles them as if they are joined by the And operator.
Field or Control |
Definition |
---|---|
Field Name |
Enter the field that the system evaluates to determine which rows of data to include in the answer set. |
Field Operations |
Enter the operator for evaluating the data in the field. The following comparison operators are available: equals, does not equal, is less than, is less than or equal to, is greater than, is greater than or equal to. |
Bind String 1 |
Enter the constant to compare with the field value. |
Derived Answers
This group box displays the values that meet the filter criteria.
Field or Control |
Definition |
---|---|
Select |
Select to mark the values to include in the static answer set. |
Apply |
Click to return to the Answer Set page and build a new list of static answers using the selected values. The system deletes existing entries in the list of static answers. |