How to build a decision support app with Google Apps Script (forms with subquestions)?

心已入冬 提交于 2020-01-06 14:45:03

问题


I want to create an app which helps newbie employers to take some simple decisions. So, using their answers to a form, the app asks new questions based on previous responses, something similar to a decision tree. Is Google Form a good alternative to implement this? (something like this suggested here, but with more questions:

Are there alternatives based on Google Apps Script?


回答1:


What you need is a Google Form with a lot of questions, whose answers redirect to different pages in the Form.

You can also use Google Apps Script Forms Service to create Forms through code (and you can use previous responses in old Forms to generate new content for new Forms dynamically).

A typical example of this would be:

  1. Create a Google Form with several questions with redirects based on answers (decision trees).
  2. Have the responses to that form go to a response Spreadsheet.
  3. Run a script on the response Spreadsheet to generate new content using the Forms Service within Google Apps Script (or do this manually; both work).
  4. Send out the new Form to employees by email (you can use Gmail Service to accomplish this) or however you prefer.

--> and repeat the process as needed.

At my work, I use Google Forms with redirects and scripts on the response Spreadsheets in order to process faculty requests using Google Apps Script, so this is definitely possible!


However, it should be noted that Google Apps Script cannot be used to dynamically generate content for Forms while the user is filling it out. See my question here.




回答2:


I don't feel like typing a mass of code here, but there are two ways of accomplishing this (both of which would require a lot of script code):

  1. You could potentially accomplish this by making a web app that automatically dumps the responses into a spreadsheet (limited space) or a document (which doesn't have to be human-readable). This won't give you the same UI, but it would work, assuming you are familiar with making web apps in the first place.
  2. You could make a multi-page form that you could write some code to direct the person upon selection of whatever choice they make to go to the correct page. This other question may serve of use if you want to go this route (it likely will be a bit easier).


来源:https://stackoverflow.com/questions/19760361/how-to-build-a-decision-support-app-with-google-apps-script-forms-with-subquest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!