【发布时间】:2020-01-14 10:21:15
【问题描述】:
我正在开发一个使用 AppScript 将数据上传到 Google Classroom 的应用程序。我经常使用两种方法:
/*
*@description adding grade to the submission
*@param courseId {string} id of clasroom in which there is coursework that we are intrested in
*@param courseWorkId {string} id of coursework in which there is submission that we are intrested in
*@param submId {string} submission id of submission to which we want to set mark*/
function setMark(courseId, courseWorkId, submIdd, mark) {
var maark = parseFloat(mark) || 0
if (maark < 0) {
maark = 0
}
var studentSubmissionRes = {
'assignedGrade': maark,
'draftGrade': maark
}
var extra = {
'updateMask': 'assignedGrade,draftGrade'
};
Classroom.Courses.CourseWork.StudentSubmissions.patch(studentSubmissionRes,
courseId, courseWorkId, submIdd, extra)
}
/**
*@description addind link to the submission
*@param fileUrl {string} url of file we want to add to submission
*@param courseId {string} id of clasroom in which there is coursework that we are intrested in
*@param courseWorkId {string} id of coursework in which there is submission that we are intrested in
*@param submId {string} submission id of submission to which we want to add the link
*/
function setLinkTosubmission(fileUrl, courseId, courseWorkId, submId) {
var request = ModifyAttachmentsRequest = {
'addAttachments': [{
'link': {
'url': fileUrl
}
}]
}
Classroom.Courses.CourseWork.StudentSubmissions.modifyAttachments(request, courseId, courseWorkId, submId)
}
它们都可以工作,但我想提高性能和批量请求以添加链接或评分,这在 Google Sheets API 中是可能的,但我找不到这样做的方法。
另外,是否可以一次批量更新多个文档中的文本?
【问题讨论】:
标签: google-apps-script google-classroom