CoursesCourseWork
class CoursesCourseWork extends Resource (View source)
The "courseWork" collection of methods.
Typical usage is:
$classroomService = new Google\Service\Classroom(...);
$courseWork = $classroomService->courses_courseWork;
Methods
Creates course work. The resulting course work (and corresponding student
submissions) are associated with the Developer Console project of the OAuth
client ID used to make the
request. Classroom API requests to modify course work and student submissions
must be made with an OAuth client ID from the associated Developer Console
project. This method returns the following error codes: PERMISSION_DENIED
if the requesting user is not permitted to access the requested course,
create course work in the requested course, share a Drive attachment, or for
access errors. INVALID_ARGUMENT
if the request is malformed.
NOT_FOUND
if the requested course does not exist. FAILED_PRECONDITION
for the following request error: * AttachmentNotVisible (courseWork.create)
Deletes a course work. This request must be made by the Developer Console
project of the OAuth client
ID used to create the
corresponding course work item. This method returns the following error
codes: PERMISSION_DENIED
if the requesting developer project did not
create the corresponding course work, if the requesting user is not permitted
to delete the requested course or for access errors. FAILED_PRECONDITION
if the requested course work has already been deleted. * NOT_FOUND
if no
course exists with the requested ID. (courseWork.delete)
Returns course work. This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to access the
requested course or course work, or for access errors. INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if the requested course or course
work does not exist. (courseWork.get)
Gets metadata for Classroom add-ons in the context of a specific post. To
maintain the integrity of its own data and permissions model, an add-on
should call this to validate query parameters and the requesting user's role
whenever the add-on is opened in an
iframe. This method returns the following error
codes: PERMISSION_DENIED
for access errors. INVALID_ARGUMENT
if the
request is malformed. * NOT_FOUND
if one of the identified resources does
not exist. (courseWork.getAddOnContext)
Returns a list of course work that the requester is permitted to view. Course
students may only view PUBLISHED
course work. Course teachers and domain
administrators may view all course work. This method returns the following
error codes: PERMISSION_DENIED
if the requesting user is not permitted to
access the requested course or for access errors. INVALID_ARGUMENT
if the
request is malformed. * NOT_FOUND
if the requested course does not exist.
Modifies assignee mode and options of a coursework. Only a teacher of the
course that contains the coursework may call this method. This method returns
the following error codes: PERMISSION_DENIED
if the requesting user is
not permitted to access the requested course or course work or for access
errors. INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if
the requested course or course work does not exist.
Updates one or more fields of a course work. See
google.classroom.v1.CourseWork for details of which fields may be updated and
who may change them. This request must be made by the Developer Console
project of the OAuth client
ID used to create the
corresponding course work item. This method returns the following error
codes: PERMISSION_DENIED
if the requesting developer project did not
create the corresponding course work, if the user is not permitted to make
the requested modification to the student submission, or for access errors.
INVALID_ARGUMENT
if the request is malformed. FAILED_PRECONDITION
if
the requested course work has already been deleted. NOT_FOUND
if the
requested course or course work does not exist. (courseWork.patch)
Details
CourseWork
create(string $courseId, CourseWork $postBody, array $optParams = [])
Creates course work. The resulting course work (and corresponding student
submissions) are associated with the Developer Console project of the OAuth
client ID used to make the
request. Classroom API requests to modify course work and student submissions
must be made with an OAuth client ID from the associated Developer Console
project. This method returns the following error codes: PERMISSION_DENIED
if the requesting user is not permitted to access the requested course,
create course work in the requested course, share a Drive attachment, or for
access errors. INVALID_ARGUMENT
if the request is malformed.
NOT_FOUND
if the requested course does not exist. FAILED_PRECONDITION
for the following request error: * AttachmentNotVisible (courseWork.create)
ClassroomEmpty
delete(string $courseId, string $id, array $optParams = [])
Deletes a course work. This request must be made by the Developer Console
project of the OAuth client
ID used to create the
corresponding course work item. This method returns the following error
codes: PERMISSION_DENIED
if the requesting developer project did not
create the corresponding course work, if the requesting user is not permitted
to delete the requested course or for access errors. FAILED_PRECONDITION
if the requested course work has already been deleted. * NOT_FOUND
if no
course exists with the requested ID. (courseWork.delete)
CourseWork
get(string $courseId, string $id, array $optParams = [])
Returns course work. This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to access the
requested course or course work, or for access errors. INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if the requested course or course
work does not exist. (courseWork.get)
AddOnContext
getAddOnContext(string $courseId, string $itemId, array $optParams = [])
Gets metadata for Classroom add-ons in the context of a specific post. To
maintain the integrity of its own data and permissions model, an add-on
should call this to validate query parameters and the requesting user's role
whenever the add-on is opened in an
iframe. This method returns the following error
codes: PERMISSION_DENIED
for access errors. INVALID_ARGUMENT
if the
request is malformed. * NOT_FOUND
if one of the identified resources does
not exist. (courseWork.getAddOnContext)
ListCourseWorkResponse
listCoursesCourseWork(string $courseId, array $optParams = [])
Returns a list of course work that the requester is permitted to view. Course
students may only view PUBLISHED
course work. Course teachers and domain
administrators may view all course work. This method returns the following
error codes: PERMISSION_DENIED
if the requesting user is not permitted to
access the requested course or for access errors. INVALID_ARGUMENT
if the
request is malformed. * NOT_FOUND
if the requested course does not exist.
(courseWork.listCoursesCourseWork)
CourseWork
modifyAssignees(string $courseId, string $id, ModifyCourseWorkAssigneesRequest $postBody, array $optParams = [])
Modifies assignee mode and options of a coursework. Only a teacher of the
course that contains the coursework may call this method. This method returns
the following error codes: PERMISSION_DENIED
if the requesting user is
not permitted to access the requested course or course work or for access
errors. INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if
the requested course or course work does not exist.
(courseWork.modifyAssignees)
CourseWork
patch(string $courseId, string $id, CourseWork $postBody, array $optParams = [])
Updates one or more fields of a course work. See
google.classroom.v1.CourseWork for details of which fields may be updated and
who may change them. This request must be made by the Developer Console
project of the OAuth client
ID used to create the
corresponding course work item. This method returns the following error
codes: PERMISSION_DENIED
if the requesting developer project did not
create the corresponding course work, if the user is not permitted to make
the requested modification to the student submission, or for access errors.
INVALID_ARGUMENT
if the request is malformed. FAILED_PRECONDITION
if
the requested course work has already been deleted. NOT_FOUND
if the
requested course or course work does not exist. (courseWork.patch)