diff --git a/src/GamCommands.txt b/src/GamCommands.txt index fe0c4603..5b3d5e85 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -7352,11 +7352,11 @@ gam print filters [labelidsonly] [todrive *] # Users - Forms gam create form - title [description ] [isquiz [] + title [description ] [isquiz []] [] [drivefilename ] [] [(csv [todrive *]) | returnidonly] gam update form - [title ] [description ] [isquiz [] + [title ] [description ] [isquiz []] [] gam print forms [todrive *] (addcsvdata )* diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 606656ac..e3961557 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,3 +1,10 @@ +7.02.06 + +Added option `` to `gam create|update form` that allows for +creation/modification of all fields in a form. `` is a list of form update requests. + +* See: https://developers.google.com/forms/api/reference/rest/v1/forms/batchUpdate + 7.02.05 Updated `gam [] show shareddriveacls ... formatjson` to not display this line diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 94931c2c..4b063399 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.02.05' +__version__ = '7.02.06' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' #pylint: disable=wrong-import-position @@ -71984,7 +71984,8 @@ def updateFormRequestUpdateMasks(ubody): v['updateMask'] = ','.join(v['updateMask']) break -# gam create form title [description ] [isquiz []] +# gam create form +# title [description ] [isquiz []] [] # [drivefilename ] [] # [(csv [todrive *]) | returnidonly] def createForm(users): @@ -72003,6 +72004,9 @@ def createForm(users): updateFormInfoRequest(myarg, getString(Cmd.OB_STRING, minLen=0), ubody) elif myarg == 'isquiz': updateFormSettingsRequest('isQuiz', getBoolean(), ubody) + elif myarg == 'json': + jsonData = getJSON([]) + ubody['requests'].extend(jsonData.get('requests', [])) elif myarg == 'drivefilename': body['name'] = getString(Cmd.OB_DRIVE_FILE_NAME) elif getDriveFileParentAttribute(myarg, parentParms): @@ -72065,7 +72069,8 @@ def createForm(users): if csvPF: csvPF.writeCSVfile('Forms') -# gam update form [title ] [description ] [isquiz [Boolean>] +# gam update form +# [title ] [description ] [isquiz [Boolean>]] [] def updateForm(users): ubody = {'includeFormInResponse': False, 'requests': []} fileIdEntity = getDriveFileEntity() @@ -72077,6 +72082,9 @@ def updateForm(users): updateFormInfoRequest(myarg, getString(Cmd.OB_STRING, minLen=0), ubody) elif myarg == 'isquiz': updateFormSettingsRequest('isQuiz', getBoolean(), ubody) + elif myarg == 'json': + jsonData = getJSON([]) + ubody['requests'].extend(jsonData.get('requests', [])) else: unknownArgumentExit() updateFormRequestUpdateMasks(ubody)