Method Description
qaRunner.displayPage()
Output HTML for a form which accepts questionnaire answers.
Syntax
number = qaRunner.displayPage(pageNo, method, action)
Parameters
The 'qaRunner.displayPage' method takes 3 parameters:
Name | Type/Value | Range/Length | Description | pageNo | number | | Required.
The page number of the questionnaire to display.
| method | string | | Optional.
The method to use for posting the resulting form. Default is "post".
| action | string | | Optional.
The action to use for posting the resulting form.
|
Results
The 'qaRunner.displayPage' method returns number:
Type/Value | Range/Length | Description |
number |
  |
The fileID of the answer file, or -1 if uninitialised.
|
Remarks Page numbers can vary as blank pages are excluded, and questions
can be conditionally removed. If the answerFile is not yet initialised,
then this method will return -1. This is not an error condition. Hidden form elements are automatically inserted for
questionFileID ,
answerFileID and
currPage The actual layout of the displayed page relies on a number of
<rb:block> tags being defined. Each block must contain valid
HTML, and can access certain variables to insert form components.
The easiest way to understand this is to read the examples in the
qaRunner.style file. The <rb:block rb:id="qa_page"> tag defines the top-level
page. It MUST contain a form definition, and the Next/Prev/Finish
buttons. These will generally be inserted as:
<form rb:eval="method#qa$Method" rb:eval1="action#qa$Action" rb:eval2="name#qa$PageID">
<rb:eval expr="qa$PrevButton"/>
<rb:eval expr="qa$NextButton"/>
<rb:eval expr="qa$FinishButton"/>
<form>
This block must contain the variable qa$PageBody at the
point where the questions are to be placed. eg:
<rb:eval expr="qa$PageBody"/>
It can also contain:
qa$Name - The name of the questionnaire.
qa$Page - The current page number.
qa$PageID - The current page ID.
qa$PageName - The current page description.
qa$Mandatory - All Error messages for mandatory questions that were not answered.
The <rb:block rb:id="qa_question"> tag defines the layout
of each individual question. It MUST contain the variable
qa$QuestionBody ,
which places the question itself, and can also contain:
qa$Name - The name of the questionnaire.
qa$Page - The current page number.
qa$PageID - The current page ID.
qa$PageName - The current page description.
qa$Type - The type of the current question.
qa$Question - The current question.
qa$QuestionID - The current question ID.
qa$QuestionNum - The current question's Number (Noth that this can vary based on previous answers).
qa$Comment - Comment text associated with the question.
qa$Mandatory - Error message is a mandatory question is not answered.
The <rb:block rb:id="qa_question_none"> tag defines
the layout of the question type "None" - This is exceptiopnal in that
it is used INSTEAD of the <rb:block rb:id="qa_question"> block
rather than being embedded into it as per all other question types
(see below.) The <rb:block rb:id="qa_q_text">,
<rb:block rb:id="qa_q_checkbox">,
<rb:block rb:id="qa_q_radio">,
<rb:block rb:id="qa_q_scale_head">,
<rb:block rb:id="qa_q_scale">,
<rb:block rb:id="qa_q_select">,
<rb:block rb:id="qa_q_multiselect"> and
<rb:block rb:id="qa_q_textarea">
tags define the layout
of each individual question type. All except scale_head MUST contain
the variable qa$Widget , and in the case of the checkbox,
scale_head and radio,
it must also contain qa$OptionText
which places the form-element itself, with its description if appropriate.
Question elements can contain all of the above variables, but
this is unlikely to provide a useful result.
The <rb:block rb:id="qa_q_mandatory">
tag defines how the error text will be formatted if a mandatory
question is not filled. It MUST contain the
qa$Mandatory variable.
|