Object: question

Description

For each fact whose value is entered by the user, you need to define how the question is asked of the user. If the knowledgebase is run on the web, you can use HTML formatting in your prompt and menu choices.

KnowledgeWright implements three basic methods. They are:
    1. Fill-in-the-blank
    2. Select one item from a menu
    3. Select multiple items from a menu

For menus, you have the option of have separate text for display purposes and for use in rules and tables. This is useful if you want to include HTML formatting in your menu choices (perhaps using an image), or if your choices have many words in them.

Question Properties

All questions share the following properties:

Property Name Description Default Value Required
id The name of this object. See Object Names for details. <none> yes
path The folder this object is located in. See Folders for details. / yes
description A text description (comment)--not used during reasoning. <none> no
prompt The text used to ask the user for a value. The prompt may contain other object names.   yes
question_type Type of question: fill_in_the_blank, menu_single_choice, menu_multiple_choices, menu_single_choice_display_separate, or menu_multiple_choices_display_separate (the latter two are for advanced users).   yes
question_style The HTML style in which the question is presented to the user. 'listbox' is a box containing the list of choices. 'checkbox_radio' is radio buttons for single choice, and checkboxes for multiple choice. listbox yes
ask_also The list of related questions to ask when asking this question. It is a convenient way to group related questions together. Note, if the questions in the ask_also list use object names in their prompts, the values of those objects must be already known or the question will not be asked.   no
default The default answer for the question.   no

The following properties apply only to fill-in-the-blank questions:  

Property Name Description Default Value Required
answer_type The type of the value: text, number, date or boolean. Dates are entered as YYYY-MM-DD. Boolean is entered as 'true' or 'false'. text yes
length The maximum length of the fact value. 20 yes

The following property applies only to menu questions if question_type is one of menu_single_choice or menu_multiple_choices:

Property Name Description Default Value Required
choices The menu choices the user selects from. <none> yes

The following property applies only to menu questions if question_type is one of menu_single_choice_display_separate or menu_multiple_choices_display_separate:

Property Name Description Default Value Required
rule-display_choices A table containing the text value to be used in rules (conditions), and the text value to be displayed to the user. This is especially useful when your menu choice is long or contains HTML attributes or images. <none> yes

Fill-in-the-Blank Questions

Fill in the blank questions allow the user to type in a value. For example:

id
error_code
path
/
prompt
What error code was displayed or 'none'?
question_type
fill_in_the_blank
length
5
default
none
ask_also
    

Menu Questions

There are two types of menus. Single choice means that the fact can have only one value. Multiple choices means that the fact can have zero or more values. Single choice questions might have values like 'yes' and 'no', whereas a multiple choice question might ask what pets do you have and could have values like 'dogs', 'cats', 'fish', 'birds' and 'horses'.

For example:

id
env_ver
path
/
prompt
Environment and Version
question_type
menu_single_choice
question_style
checkbox_radio
choices
    
Windows 98
Windows NT
Windows 2000
Linux
default
  
ask_also
   

 

If you want to use separate values for display and the rules, your question might look like this:

id
env_ver
path
/
prompt
Environment and Version
question_type
menu_single_choice
question_style
listbox
rule-display_choices
    
rule_text
display_text
win98
Windows 98
winnt
Windows NT 4.0
win2k
Windows 2000
linux
Linux
default
  
ask_also
   

 

The user will see 'Windows 98', 'Windows NT 4.0', etc. as menu choices, whereas, your rule conditions will read:

env_ver = win98 or env_ver = win2k

Grouping Question with ask_also

In order to reduce the number of interactions with the user, KnowledgeWright supports the concept of related questions. Entirely optional, they allow you to specify what questions should be asked together. It lets you 'group' facts together, so all the questions for a particular hypothesis can be gathered at one time.

Here is how related facts are added to a question:

id
env_ver
path
/
prompt
Environment and Version
question_type
menu_single_choice
question_style
checkbox_radio
choices
    
Windows 98
Windows NT
Windows 2000
Linux
default
 
ask_also
memory_size
processor_type

 

This says that 'memory_size' and 'processor_type' are related to 'env_ver'. When the rules are executed, if KnowledgeWright is going to ask the user for env_ver, it will also ask for the other two questions as well. However, if the other two questions use object names in their prompts, and the values for those objects are not know, that question will not be asked.


Copyright ©1996-2002 Amzi! inc. All Rights Reserved. Amzi!, KnowledgeWright and WebLS are registered trademarks and Subscription Plus and Logic Server are trademarks of Amzi! inc.