OTN's Servlet-based Surveys

Part 2 - Using the Survey Application

August 1999
Oracle8i

To build surveys and gather response data, OTN uses the Survey Application. The steps are:

  1. Installing the Survey Application
  2. Designing a Survey
  3. Responding to a Survey
The figure below shows the flow and interaction for defining and responding to surveys.  

Definition and Response

 
Definition
Response
  1. Connect to the Survey Definition servlet (SD) and log in.
  2. Use wizards to define a survey.
  3. When you finish, the servlet writes your specifications to the survey structure tables in the database.
  1. Connect to the Survey Response servlet (SR) and specify a survey to respond to.
  2. The servlet reads data from the survey structure tables.
  3. The servlet generates a dynamic HTML form.
  4. Submit your answers. The servlet writes the data to the user response tables.

Designing a Survey

The Survey Application uses objects to represent a real-world survey: a Survey object contains Question objects. Each Question presents the question text and a ChoiceGroup object consisting of one or more Choice objects that represent user responses.

Survey Objects

To design a survey, use the Survey Design servlet and follow these steps:

  1. Log in.
  2. Define ChoiceGroups. Use existing Choices or create Choices as needed.
  3. Define Questions. For each Question, specify question text, choose a ChoiceGroup of appropriate responses, then decide how to present the choices to the user: as radio buttons, check boxes, a list, or a text field for a freeform response.
  4. Define Survey attributes such as fonts, colors, and header and footer text.
The following steps show how to create a simple one-question survey. To create a real survey, add more questions. The Survey Design servlet uses the same interface to create and edit surveys, so it's easy to change, customize, and maintain them.

To log in:

  1. Connect to the Survey Design servlet. From your browser, enter a URL like the following, but replace hostMachine with the name of the machine that is hosting the servlet.

  2. http://hostMachine:8888/servlet/SDServlet.SDSessionServlet
  3. Log in. Choose a name from the list of existing users or type a name and create a new user, then click Go to display the Survey Application page.
To define a ChoiceGroup:
  1. The Survey Application page displays a list of options. Click Choice Groups to display the Create or Edit Choice Groups page.
  2. Click the link to create a new Choice Group, which displays the Choice Group Details page.
  3. In the Choice Group Name field, type cgColors.
  4. In the New Choice field, type red, then click Add to Choice Group to add it to the list of choices.
  5. Repeat the previous step to add the color names green and blue to the list of choices.
  6. Click Create Choice Group to commit the group and its choices.
To define a Question:
  1. Click Questions to display the Create or Edit Question page.
  2. Click the link to create a new Question, which displays the Create a New Question page.
  3. In the Name field, type qColor. The name identifies the Question.
  4. In the Label field, type What is your favorite color? The label text appears in the survey.
  5. To answer this question, the user chooses one item from a ChoiceGroup. To specify this, click One of Many.
  6. In the corresponding Question Format box, choose RadioGroup.
  7. In the corresponding Choice Group box, choose cgColors.
  8. In the corresponding Default Value box, choose red.
  9. Click Create Question to commit your specifications.
To define Survey attributes:
  1. Click Surveys to display the Create or Edit Survey page.
  2. Click the link to create a Survey, which displays the Create New Survey page. This page contains a wizard that presents several panels where you define survey attributes. The first panel is the Enter Survey Details panel.
  3. In the Survey Name field, type SimpleSurvey.
  4. In the Submit Button Text field, type Submit.
  5. In the Survey Title field, type A Very Simple Survey.
  6. In the Header field, type Please answer the following question.
  7. In the Footer field, type Thank you for responding to this survey.
  8. Click the right-arrow at the bottom of the panel to display the Select Questions for Survey panel.
  9. From the Available Questions list, choose qColor, then click the double right-arrow to add it to the Survey Contents list.
  10. Click the Check Mark icon at the bottom of the panel to commit the definitions and display the Completed Survey Definition panel.
  11. Click Preview to display the survey, then click Finish to save it to the database.

Responding to a Survey

Load the survey, answer the questions, then save your responses to the database.
  1. Connect to the Survey Response servlet. From your browser, enter a URL in the following form:
  2. http://<machineName>:<webServicePort>/servlet/SRServlet.SRSessionServlet?<parameters>
    There are three servlet parameters, all mandatory:
     
    • SURVEY_ID - Survey ID number.
    • USER_ID - User ID (number or string) of the person responding to the survey.
    • RETURN_PAGE - URL of a page to display after survey responses are stored.


    •  
    Examples:
    http://scott-pc:8888/servlet/SRServlet.SRSessionServlet?SURVEY_ID=30&USER_ID=30&RETURN_PAGE=
    http://Scott-PC:8888/servlet/SRServlet.SRSessionServlet?SURVEY_ID=30&USER_ID=rhall&RETURN_PAGE=
  3. Answer the survey questions.
  4. Click Submit to store your responses in the database.

Installing the Survey Application

Using the Survey Application

Analyzing Survey Results

How it Works


Questions or comments? Post a message in OTN's Sample Code discussion forum or send email to the author.

Case Study: OTN's Servlet-based Surveys
Author: Robert Hall, Oracle Corporation
Date: August 1999

This document is provided for information purposes only and the information herein is subject to change without notice. Please report any errors herein to Oracle Corporation. Oracle Corporation does not provide any warranties covering and specifically disclaims any liability in connection with this document.
Oracle is a registered trademark and Enabling the Information Age is a trademark or registered trademark of Oracle Corporation. All other company and product names mentioned are used for identification purposes only and may be trademarks of their respective owners.

Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
USA

Worldwide Inquiries:
+1.650.506.7200
Copyright © Oracle Corporation 1999
All Rights Reserved


E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy