Google Classroom API获取课堂资料

时间:2019-10-26 16:14:51

标签: google-classroom

我正在尝试使用Classroom API从Google Classroom获取Classwork信息。但是,它仅提取文档详细信息。但是材料细节没有显示。

我正在使用PHP代码获取详细信息

    $assignmentResults = $service->courses_courseWork->listCoursesCourseWork($courseId);
  //print_r($assignmentResults); exit;
    if(count($assignmentResults->getCourseWork())>0):
        foreach ($assignmentResults->getCourseWork() as $assignment) {
            //print("<pre>".print_r($assignment,true)."</pre>");exit;
            $arrAssignment[$i]['id'] = $assignment->id;
            $arrAssignment[$i]['title'] = $assignment->title;
            $arrAssignment[$i]['description'] = $assignment->description; 
            $arrAssignment[$i]['materials'] = $this->getMaterials($assignment->materials);
            $arrAssignment[$i]['assignment'] = $this->assignment($assignment->assignment);
            $i++;
        }
    endif;     

查看随附的图像。预期结果在图像上突出显示。

Material enter image description here

0 个答案:

没有答案