Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pavanSaberjack/GoogleAppScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Step 1:

  • Create a Google Spreahsheet : My question set needs to have Aptitude and Technical questions, you can create number of sheets using '+' icon. For my case sheets are enough and name them as shown in the image below

Adding sheets

  • Questions should be added in the format , in aptitude and programming sheets

question list format

  • To enable script editor goto Tools -> Script Editor which will open editor and all the script files will be of extension .gs

Enable script editor

  • Script editor will look like Script editor view

- Now you can start using project, name the project (Question creator)  Basic testing of app script 

function myfunction() { Logger.log('My start project'); }

Selecting test function

After saving : you can select the function as shown above and run. For checking logs you can go to View -> Logs

  • If any authorization required it prompt the user for permission and will handle itself.

Step 2:

  • Now you need to have two files Code.gs(default file created which you can rename) and Index.HTML which can be added from New-> HTML file in Script editor

  • Copy paste the code from the Github

  • Select function startQuestionPaperSetup and run the script, if you goto your spreadsheet tab you will see out as shown below.

HTML prompt output

  • Once you provide a Google Doc url which is created in your Gdrive, you should be able to see the output.

Explanation:

  • App Script will present user with custom dialogue using HTML file (Index.html) 

var htmlOutput = HtmlService.createHtmlOutputFromFile('Index').setWidth(300).setHeight(250); SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Question Paper Generator');

  • Once user hits the submit button it will call the method userDidClickSubmit using script google.script.run.userDidClickSubmit with the params you want to receive from the user.

function userDidClickSubmit(noOfSets, noOfQuestions, url) { }

  • You can use prompt to get inputs but only limitation with Prompt is that it allows one input box at a time. Check out more details in the link 

Step3:

  • To make the script available in Spreadsheet tab so that user don't have to go to script editor to everytime  Go to Tools -> Macros -> Import

Check macro tab

  • Select the function which will be the entry point to the script and press Add Function

Selecting macro to run

  • Then it will be available in the macros list

Accessing the macro

  • You can create a keyboard shortcut using Manage macros

Managing macros

Feedbacks are most welcome

About

Generating question papers on to Google Doc from a Google Spreadsheet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors