2017-01-31 42 views
1

嘗試在Google課堂中打開學生提交時出現錯誤。PERMISSION_DENIED嘗試關閉Google課堂中的StudentSubmission

使用下面的代碼:

mService.courses().courseWork().studentSubmissions().turnIn(mCourseWork.getCourseId(),mCourseWork.getId() ,mySubmission.getId(),turnInStudentSubmissionRequest).execute(); 

獲得以下錯誤:

403 Forbidden

{ 
     "code" : 403, 
     "errors" : [ { 
     "domain" : "global", 
     "message" : "@ProjectPermissionDenied The Developer Console project is not permitted to make this request.", 
     "reason" : "forbidden" 
     } ], 
     "message" : "@ProjectPermissionDenied The Developer Console project is not permitted to make this request.", 
     "status" : "PERMISSION_DENIED" 
    } 

回答

1

當修改作業/或學生提交的材料,只有創建這些對象的開發者控制檯項目可以對其進行修改。這意味着只有創建相應課程作業的項目才能修改它們,否則將返回403 PERMISSION_DENIED錯誤。您可以通過檢查Google Classroom課程作業回覆中的associatedWithDeveloper屬性,輕鬆確定課程作業項目是否與發出請求的Developer Console項目相關聯。

+1

創建課程和作業的應用程序只能提交這些作業(我們不能使用其他應用程序或具有其他包名稱的應用程序提交這些作業)。 – ganeshveera