Building Interactive Surveys with Maintain

30
Building Interactive Surveys with Maintain Mark Derwin and Mark Rawls Information Builders Copyright 2011, Information Builders. Slide 1

description

Building Interactive Surveys with Maintain. Mark Derwin and Mark Rawls Information Builders. Creating Dynamic Surveys with Maintain Overview. These days, after every meal, service call or session you are asked to take a survey. - PowerPoint PPT Presentation

Transcript of Building Interactive Surveys with Maintain

Page 1: Building Interactive Surveys  with Maintain

Building Interactive Surveys with Maintain

Mark Derwin and Mark Rawls Information Builders

Copyright 2011, Information Builders. Slide 1

Page 2: Building Interactive Surveys  with Maintain

Copyright 2007, Information Builders. Slide 2

Creating Dynamic Surveys with MaintainOverview

These days, after every meal, service call or session you are asked to take a survey.

Most of these surveys follow a template of rating service, value and content.

The Maintain language is perfect for creating these surveys.Create databases to dynamically build the forms.Once deployed, users can access them from any browser:

IE, Firefox, Safari, Opera or ChromeAnd any smart device:

iPad, iPhone, Droid, Blackberry, etc…Presentation DOES include code!!

Page 3: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainLive Demo

Ask audience to call out up to 5 questions.Select answers from drop down list.Run the builder and show the created survey.

Copyright 2007, Information Builders. Slide 3

Page 4: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainInput and Output Files

The survey builder uses one file to contain the survey questions and another file to save the output.

Your structure can vary for your site.

Copyright 2007, Information Builders. Slide 4

Page 5: Building Interactive Surveys  with Maintain

Creating the Surveys

Copyright 2007, Information Builders. Slide 5

Page 6: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

We can create an application using Update Assist to allow any user to create a survey.

Highlight the Survey.mas file and select Update Assist

Copyright 2007, Information Builders. Slide 6

Page 7: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

The file only has one segment. Select SURINFO.Click Next >

Copyright 2007, Information Builders. Slide 7

Page 8: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

On Top, select Add, Update and DeleteOn Bottom, make Question and Question_Type visible and

Changeable.Click on Validation for Question_Type and select Static List

Copyright 2007, Information Builders. Slide 8

Page 9: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

Enter: Input, YesNo, Range, and Range1to5 You can create other answer types as well.

Click OK and Next >

Copyright 2007, Information Builders. Slide 9

Page 10: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

Select Tree for the Navigation Option.Click Next >

Copyright 2007, Information Builders. Slide 10

Page 11: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

Select your favorite Template.Click Next >

Copyright 2007, Information Builders. Slide 11

Page 12: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

Click Next > on 5 of 6Uncheck Compile and Click Finish

Copyright 2007, Information Builders. Slide 12

Page 13: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainCreating the AddSurvey Application

Add new surveys.Edit questions in existing surveys.

Copyright 2007, Information Builders. Slide 13

Page 14: Building Interactive Surveys  with Maintain

Copyright 2007, Information Builders. Slide 14

Creating Dynamic Surveys with MaintainAdding HTML to HTMLTable

Add a Radio Button to an HTMLTable to allow the user to make a selection

Use HTML Tags Input Type: Radio Value: Retrieve and Display

Values can be blank, static or dynamicDynamic not recommended. Too many options may

get truncatedUse Form.GetHTMLField to retrieve the values from the

HTMLTable.You cannot resort this stack after you create the input field

Page 15: Building Interactive Surveys  with Maintain

Copyright 2007, Information Builders. Slide 15

Creating Dynamic Surveys with MaintainAdding HTML to HTMLTable

In this example we are adding a Yes / No radio button to a column of a stack. AnswerType contains the HTML code. Answer contains the value selected.

Page 16: Building Interactive Surveys  with Maintain

Copyright 2007, Information Builders. Slide 16

Creating Dynamic Surveys with MaintainAdding HTML to HTMLTable

The HTML table has 2 columns: AnswerType and Answer. Set the Content Type of AnswerType to 1-HTML Make the width 20.

Page 17: Building Interactive Surveys  with Maintain

Copyright 2007, Information Builders. Slide 17

Creating Dynamic Surveys with MaintainAdding HTML to HTMLTable

At runtime the HTML is displayed as the Radio Button. Kicking off the SaveData Case saves and can display the data.

Page 18: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainUsing Stacks

All input and output to / from a Maintain application is done with Stacks.

Load a stack from a database and display it on the form.Columns are database fields and rows are database values.Save the data back to the database.Use the INFER command to create a stackUse the NEXT command to load data into a stackThe INCLUDE command saves data back to the database

Copyright 2007, Information Builders. Slide 18

Page 19: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainLoading the Survey List

Maintain code: Set up 3 stacks to display survey list and save answers Use Exec to get a unique list of surveys

DST works great Set up and show the winform

Copyright 2007, Information Builders. Slide 19

Page 20: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainLoading the Questions / Question Types

When the user selects a survey name perform buildsurvey Load all the questions and question_types into STK Loop through all the questionsDynamically create the HTML depending on typeHere we see Input and a radio button for Yes / No

Copyright 2007, Information Builders. Slide 20

Page 21: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainLoading the Questions / Question Types

Here we see a radio button range and drop list for 1 through 5.By concatenating the counter to the object name, we create a

unique name.

Copyright 2007, Information Builders. Slide 21

Page 22: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainAdding a Save Button

Finally we add a button to the bottom of the stack.We add an IWCTrigger to SaveSurvey so clicking it passes

control back to the Maintain code and saves the data.Note: We can also add check boxes with similar code

Copyright 2007, Information Builders. Slide 22

Page 23: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainInside the Maintain Development Environment

Copyright 2007, Information Builders. Slide 23

Page 24: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainAdding the HTMLTable

The HTMLTable displays the data from STKUse AlternameRowColor to make the rows look clearerRemove the border and grid linesChange the Font and Font size to stand outChange Overflow to Visible so form scrolls without scrollbars

Copyright 2007, Information Builders. Slide 24

Page 25: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainAdding the HTMLTable

Add columns Question_No, Question and AnswerType from STK Rename Question_No to No and make QUESTION width 50 & mixed case Double click on AnswerType Change the Title to Answer, Width to 45 and Content type to 1-HTML

Copyright 2007, Information Builders. Slide 25

Page 26: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainFinishing the Form

Add a Combobox to display ShowStk.Survey_Name When the user makes a selection, perform BuildSurvey

Drag Tname onto the form and rename it NameAdd whatever image you want.Change Form Title property to “Take a Survey”

Copyright 2007, Information Builders. Slide 26

Page 27: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainSaving the Data

Perform SaveSurvey when the user clicks the Save Button

Copyright 2007, Information Builders. Slide 27

Page 28: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainSaving the Data

Compute the selected survey_name into SaveStkNext assign the unique CountNow loop through the amount of questions and get the

answers.The GetHTMLField command is used to retrieve values.Save all the information to the Database If save fails, bump up the Count and do it again.When done, Exit or display a Thank you screen.

Copyright 2007, Information Builders. Slide 28

Page 29: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainDisplay

Copyright 2007, Information Builders. Slide 29

Page 30: Building Interactive Surveys  with Maintain

Creating Dynamic Surveys with MaintainDisplay

Copyright 2007, Information Builders. Slide 30