大家好,这让我发疯了,希望您能帮忙
我正在尝试使用patch()将草稿成绩分配给作业,但是不断收到错误(补丁)未知参数:'draftGrade'
这是我在laravel PHP中创建的代码
$this->client->setAccessToken($_SESSION['access_token']);
$service = new \Google_Service_Classroom($this->client);
$courseId = '17531696064';
$courseWorkId = '29297231820';
$id = 'CgwI9aG3lwkQzI-Bkm0';
$post_body = new \Google_Service_Classroom_StudentSubmission(array(
'updateMask' => 'draftGrade',
));
$opt_params = array(
'draftGrade' => 90,
);
$list = $service->courses_courseWork_studentSubmissions->patch($courseId, $courseWorkId, $id, $post_body, $opt_params);
我也使用了以下内容,但仍然不满意。
$list = $service->courses_courseWork_studentSubmissions->patch(17531696064,
29297231820,
'CgwI9aG3lwkQzI-Bkm0',
new \Google_Service_Classroom_StudentSubmission(array('updateMask' => 'draftGrade')),
array ('resource' =>['draftGrade' => 90] ));
任何帮助都会很棒。
答案 0 :(得分:1)
您做错了两件事之一:-