I am newbie to Google App Scripting(GAS). I need to make app for Quiz using Google App Script(GAS). It is possible to make such application in Google App Script.
I have a list of questions, associated options and correct answer in Google Spreadsheet. I have to integrate this question and options in randomize fashion with Google form and generates the response at runtime and store these responses in other google spreadsheet.
It is possible to do this in Google App Scripting(GAS).
I've looked at developing a quiz in the past and I eventually settled on flubaroo.com which has been set up as an open source project even though the source code is now hidden when you download it as an add-on. You can get an older version of the code that doesn't have a lot missing if you insert the script to an old type of Google spreadsheet. It doesn't have the randomised question feature you are after though.
Is it possible with Google Apps Script?
Yes, now it's possible a Google extended the Forms Service as was announced on April, 2017.
Reference
Create quizzes in Google Forms with Apps Script
why you don't use Google Forms ?
you can Add questions , and solutions, and your data will save in the spreadsheet.
In Google App Script , it's possible but , you must make an UI Application , with good interface , with Css.
Put your questions and solutions in your spreadsheet , and take a loop randomised to save a number of the question and show question.
Related
In Sheets I have dates and events that I would like to publish in Docs with the events listed under MONTH - YEAR. The number of events can vary, though usually over 400 events over a 2 year period. Sheets has them all sorted, but I haven't programmed in JavaScript before as I have used Access to do this in the past (But it seems to be overkill to have Access just for this.) It seems that Google App Script is the only way to do it?
A sample of the Sheet is here https://docs.google.com/spreadsheets/d/1IYmdIZU9wEVgSr7l4UWzJE7xXgUEQQOHUVarBHCeWgI/edit?usp=sharing
A sample of the doc that I would like to make is here https://docs.google.com/document/d/1obF-OiRAQG_6WxwiCT5-GkvnjETsdYiMHB2SDGxDeKA/edit?usp=sharing
From the question
It seems that Google App Script is the only way to do it?
Besides Google Apps Script, there are APIs for Google Sheets and Google Docs that you could use with several programming languages. For more details see
https://developers.google.com/docs
https://developers.google.com/sheets
I have been given a task, where there is a group of people in a excel spreadsheet, in which the owner can mark if a person has arrived or not. Which can be done in excel by using VBA All Sorts. But I don't how to implement this in Google Sheets. Is there some workaround to this?
I I have tried looking at the documentation for google-script-apps, and various how-to guides of designing a userform for a Google Sheets document.
I am afraid, that I can't provide some code as I haven't a clue of how to implement VBA All Sorts in Google Sheets.
what you should look into is Google Web Apps. You can create an HTML page with Google Spreadsheet as database. You can create the HTML page with all the options you want and then write/read the data from Google Spreadsheet by calling Javascript functions in the HTML talking to google.script.run.XXXX() Google Apps Script functions.
I have to do a little bit of "crowdsourcing" for my work and it would consist in a very simple web app where a user can register/log in, and then be taken to a page where a picture is shown to a user and submit a number.
I'd like to be able to set up a few rules to choose which picture the user will see (so he won't have to answer twice the same question and also to allow some overlap between users to compare their answers).
We can assume that I have a google sheet with a list of images URLs that can be accessed and that I would like the answers to be populated there.
I figured that this tutorial would be a good start since it handles user creation and management and user can submit ideas :
Creating a CRUD Web App with Google Sheets
That being said I'm a bit clueless, I've tried to look for sample scripts deployed as web app but it's hard to know where to start.
I'll appreciate any help !
Google Apps Script is, basically, a javascript environment with a set of libraries that interact with the Google Apps. For instance, to read or store information from/to Google Sheets or Google Docs. If you know javascript, you can create simple applications there. In addition, you can create plugins for Google Applications if you are interested.
A very simple example
Suppose you wanna display an HTML page. You can create an stand-alone script (an script not-bound to a G suite application) and use the content or the HTML services.
You can create a function that sends a simple message to the browser using the ContentService:
function doGet() {
return ContentService.createTextOutput('Hello, world!');
}
Or you can create a function that sends an HTML file in the same project using the HtmlService:
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
Once you have created the function, you must deploy the script as a web application.
Save the script as a new version doing File > Manage Versions and Save new version.
Then, publish the app using Publish > Deploy as web app and provinding information about the permissions for the application.
After Google publishes the application, it gives you an URL to access the application,
You may check more in a simple tutorial on producing content with Google Apps Script. In addition, you may check the google guide to use the HtmlService to provide templated content, i.e. where the HTML are templates which data is provided by javascript functions and variables.
Getting started with Google Apps Script
To start, you may check some tutorials in the internet:
Google has some tutorials and a series of Youtube videos.
In addition, you may find multiple resources for Google App Scripts that may help you:
Google has a list of sample projects
Tanakeich has a list of resources for taking advantage of Google Apps Script.
Oshliaer has another list of resources.
There are Google Codelab (tutorials) for Apps Scripts. They include a lab for using Google Sheets as a reporting tool and for creating a Hangouts Chat bot with Apps Script
Developing Google Apps Script projects locally
Although Google Apps Script provides a web interface to create your applications (your scripts), a better idea may be to create the software locally, using more-traditional tools for Javascript.
Clasp is a command-line tool to develop locally Google Apps Script projects.
Google has a codelab that teach you how to use clasp.
I've use Google Apps Script before, but haven't bene programming for oabout a year now.
For a new project I would like to know if I should continue using Google Apps script or switch to HTMLService.
So first question is if Google Apps Script still is and well be supported by Google.
Second question is what are the main differences between HTMLService and Google Apps Script that make it worth switching.
If you mean should you use HTMLService or UIService within Google Apps Script, it would probably be best to use HTMLService as UIService is deprecated.
UIService will appear in auto-complete until 30th June, but not after.
https://developers.google.com/apps-script/sunset?utm_campaign=htmlser-1214&utm_source=gadbc&utm_medium=blog
http://googleappsdeveloper.blogspot.co.uk/2014/12/speeding-up-htmlservice.html
https://developers.google.com/apps-script/guides/html/
For first Question: Yes, The Google app script used to make google products as custom like google spread sheet , google docs and we can insert the script into google sites so that we can share output through website.
For second Question: In Google app script the ClassUIApp is deprecated in that place we can using HTML services
https://developers.google.com/apps-script/reference/ui/ui-app
In the beginning Google App Script, all the code was written in one file one with .gs extension which included the code for User Interface, styling and business logic which made it complex as the application moved from small scale to enterprise level.
Also there was a restriction that you have to use the UI components from App Script (UiApp) which was not welcomed by the existing community of web developers as it was limited and needed to be learned and could not offer all the features a programmer may require.
Therefore in order to make it popular among existing community of developers App Script gave the ability of writing HTML pages as part of the project which was very helpful as it is widely used for designing all kinds of UI.
So, as you can see here that Google has made a shift, and hence HTMLservice is the future.
Google Apps Script was design for interact with google apps, so, if you are working with google drive, calendar, maps. You must use apps script, It's is easy and fast to implement.
But if you don't need use Google Apps may be is better use another software because how I told you before, Apps Script was created for interact with Google Apps and works awesome.
Google say: "The HTML service lets you serve web pages that can interact with server-side Apps Script functions. It is particularly useful for building web apps or adding custom user interfaces in Google Docs, Sheets, and Forms. You can even use it to generate the body of an email."
https://developers.google.com/apps-script/guides/html/
The purpose is different, what do you want to do?
Been following updates from Google in regard to GAS for over 6 months now. Google is putting a lot of resource into GAS and I don't think there should be any concern about it being deprecated.
And HTMLService is a class that can be called from inside the script editor so I don't know why one would need to choose one or the other.
Just go into the script editor and press control + space bar at the same time and you'll see all the classes available to you in alphabetical order. Scroll down to H and you'll see HTMLService. I haven't used it yet but it's there to work with.
HTMLService is a service to serve HTML pages through Google Apps Script. You can use HtmlService as a normal web page.
I'm new to Google scripting and have a very basic dashboard put together from all the information available online. The source is a Google spreadsheet of data exported from a database. I'm creating a Dashboard web app and would like to create summary charts on the dashboard due to the amount of information I'm working with. I've contemplated using Pivot Tables but would then lose the functionality of the CategoryFilters. I've seen lots of stuff about Google Visualization online and the Group function, but this doesn't seem to work in Google script. Can anyone advise what to do? Thanks.
Google give API for Google app script and Javascript.
It's really different because in app script you use a script in your google drive, and you use an app script editor.
If you use Google Vizualisation it's only javascript , you can deploy your javascript application in google app engine for example.
Google vizualisation is very interesting if you want to create a dataTable , a map , or others.
I use Google vizualisation for many charts because it's more simple and more dynamic than google app script.