1 / 30

Building Interactive Surveys with Maintain

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.

inge
Download Presentation

Building Interactive Surveys with Maintain

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building Interactive Surveys with Maintain Mark Derwin and Mark Rawls Information Builders

  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 Chrome • And any smart device: • iPad, iPhone, Droid, Blackberry, etc… • Presentation DOES include code!!

  3. 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.

  4. 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.

  5. Creating the Surveys

  6. 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

  7. Creating Dynamic Surveys with MaintainCreating the AddSurvey Application • The file only has one segment. Select SURINFO. • Click Next >

  8. Creating Dynamic Surveys with MaintainCreating the AddSurvey Application • On Top, select Add, Update and Delete • On Bottom, make Question and Question_Type visible and Changeable. • Click on Validation for Question_Type and select Static List

  9. 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 >

  10. Creating Dynamic Surveys with MaintainCreating the AddSurvey Application • Select Tree for the Navigation Option. • Click Next >

  11. Creating Dynamic Surveys with MaintainCreating the AddSurvey Application • Select your favorite Template. • Click Next >

  12. Creating Dynamic Surveys with MaintainCreating the AddSurvey Application • Click Next > on 5 of 6 • Uncheck Compile and Click Finish

  13. Creating Dynamic Surveys with MaintainCreating the AddSurvey Application • Add new surveys. • Edit questions in existing surveys.

  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 dynamic • Dynamic not recommended. Too many options may get truncated • Use Form.GetHTMLField to retrieve the values from the HTMLTable. • You cannot resort this stack after you create the input field

  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.

  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.

  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.

  18. 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 stack • Use the NEXT command to load data into a stack • The INCLUDE command saves data back to the database

  19. 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

  20. 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 questions • Dynamically create the HTML depending on type • Here we see Input and a radio button for Yes / No

  21. 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.

  22. 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

  23. Creating Dynamic Surveys with MaintainInside the Maintain Development Environment

  24. Creating Dynamic Surveys with MaintainAdding the HTMLTable • The HTMLTable displays the data from STK • Use AlternameRowColor to make the rows look clearer • Remove the border and grid lines • Change the Font and Font size to stand out • Change Overflow to Visible so form scrolls without scrollbars

  25. 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

  26. 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 Name • Add whatever image you want. • Change Form Title property to “Take a Survey”

  27. Creating Dynamic Surveys with MaintainSaving the Data • Perform SaveSurvey when the user clicks the Save Button

  28. Creating Dynamic Surveys with MaintainSaving the Data • Compute the selected survey_name into SaveStk • Next assign the unique Count • Now 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.

  29. Creating Dynamic Surveys with MaintainDisplay

  30. Creating Dynamic Surveys with MaintainDisplay

More Related