function createGradedCheckboxQuestionWithAutofeedback() { // Make sure the form is a quiz. var form = FormApp.getActiveForm(); form.setIsQuiz(true); // Make a 10 point question and set feedback on it var item = FormApp.getActiveForm().addCheckboxItem(); item.setTitle("What flavors are in neapolitan ice cream?"); item.setPoints(10); // chocolate, vanilla, and strawberry are the correct answers item.setChoices([ item.createChoice("chocolate", true), item.createChoice("vanilla", true), item.createChoice("rum raisin", false), item.createChoice("strawberry", true), item.createChoice("mint", false) ]); // If the respondent answers correctly, they'll see this feedback when they view //scores. var correctFeedback = FormApp.createFeedback() .setText("You're an ice cream expert!") .build(); item.setFeedbackForCorrect(correctFeedback); // If they respond incorrectly, they'll see this feedback with helpful links to //read more about ice cream. var incorrectFeedback = FormApp.createFeedback() .setText("Sorry, wrong answer") .addLink( "https://en.wikipedia.org/wiki/Neapolitan_ice_cream", "Read more") .build(); item.setFeedbackForIncorrect(incorrectFeedback); }
{ "repeatCell": { "range": { "endRowIndex": 1 }, "cell": { "userEnteredFormat": { "textFormat": { "bold": true } } }, "fields": "userEnteredFormat/textFormat/bold", } }
"fields": "userEnteredFormat/textFormat(bold,italic)"
function getIndexesOfFilteredRows(ssId, sheetId) { var hiddenRows = []; // limit what's returned from the API var fields = "sheets(data(rowMetadata(hiddenByFilter)),properties/sheetId)"; var sheets = Sheets.Spreadsheets.get(ssId, {fields: fields}).sheets; for (var i = 0; i < sheets.length; i++) { if (sheets[i].properties.sheetId == sheetId) { var data = sheets[i].data; var rows = data[0].rowMetadata; for (var j = 0; j < rows.length; j++) { if (rows[j].hiddenByFilter) hiddenRows.push(j); } } } return hiddenRows; }
function setSheetBasicFilter(ssId, BasicFilterSettings) { //requests is an array of batchrequests, here we only use setBasicFilter var requests = [ { "setBasicFilter": { "filter": BasicFilterSettings } } ]; Sheets.Spreadsheets.batchUpdate({'requests': requests}, ssId); }
num_docs_internally_visible, num_docs_externally_visible, num_docs_shared_outside_domain.