با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برنامهنویسان میتوانند از Google Classroom API برای تعامل با درسهای Google Classroom استفاده کنند. برنامهای که از API به این روش استفاده میکند، یکپارچهسازی CourseWork نامیده میشود.
این مسیر ادغام معمولاً برای ایجاد و درجه بندی تکالیف با پیوندهایی به منابع خارج از Classroom استفاده می شود. در مقایسه با دکمههای اشتراکگذاری کلاس، دسترسی بیشتری را برای توسعهدهندگان به مدیریت درسها فراهم میکند.
چگونه کار می کند
ویژگی اصلی یکپارچه سازی CourseWork ایجاد و مدیریت تکالیف، اطلاعیه ها و مواد درسی با استفاده از Classroom API است.
یکی از نمونههای سفر مشترک کاربر که با یکپارچهسازی CourseWork فعال میشود، این است که به معلمان اجازه میدهد محتوا را از داخل وبسایت یا برنامه شما کشف، اختصاص دهند و درجهبندی کنند:
یک کاربر معلم وارد وب سایت شما می شود.
معلم محتوایی را پیدا می کند یا ایجاد می کند که می خواهد با کلاس خود به اشتراک بگذارد. معلم روی دکمه ای در وب سایت شما کلیک می کند تا این محتوا را به Google Classroom ارسال کند.
برنامه شما یک درخواست به courses.courseWork.create ارسال می کند. این درخواست حاوی یک شی CourseWork در بدنه خود است که شامل موارد زیر است:
شناسه دوره مقصد
عنوان تکلیف.
شرح متن برای تکلیف.
یک linkMaterial با URL به محتوای انتخاب شده توسط معلم.
به صورت اختیاری، حداکثر امتیاز قابل دستیابی برای محتوای انتخاب شده.
یک تکلیف جدید با پیوست پیوند در Classroom ظاهر می شود. پیوند به URL مشخص شده در درخواست create اشاره دارد. برای مثال شکل 1 را ببینید.
یک ستون جدید برای تکلیف نیز در کتاب نمره Classroom ظاهر میشود که در صورت ارائه، حداکثر امتیاز را نیز شامل میشود.
دانشآموزان تکلیف را دریافت میکنند و روی link Material کلیک میکنند تا URL ارائهشده را در یک برگه جدید باز کنند و محتوای وبسایت شما را مشاهده یا تکمیل کنند. به صورت اختیاری، کنترل هایی را برای دانش آموز فراهم کنید تا تکلیف را تحویل دهد .
در صورت تمایل، درخواستی را برای courses.courseWork.studentSubmissions.modifyAttachments ارسال کنید تا پیوستهایی را به ارسالی دانشجو اضافه کنید، مانند یک فایل Google Drive یا link Material که به کار دانشآموز در وبسایت شما اشاره میکند.
قبل از تصمیم گیری در مورد اینکه آیا یکپارچه سازی CourseWork انتخاب مناسبی برای نیازهای محصول شما است، موارد زیر را در نظر داشته باشید.
شما باید به کاربر اجازه دهید و رضایت او را درخواست کنید. شما از طرف کاربر درخواست های API را انجام می دهید. این بدان معناست که، برای مثال، نمیتوانید در هیچ دوره آموزشی Google Classroom درس ایجاد کنید. شما فقط می توانید دوره هایی را ایجاد کنید که کاربر مجاز تدریس می کند.
شما به راهی نیاز دارید که کاربر بتواند دوره ای را برای دریافت محتوا انتخاب کند. استفاده از courses.list را برای دریافت لیست دروس تدریس شده توسط کاربر در نظر بگیرید، سپس به کاربر اجازه دهید یک یا چند دوره را از لیست انتخاب کند.
وقتی کاربر روی link Material in Classroom کلیک می کند، پیوند در یک برگه جدید باز می شود. با باز شدن URL سرور شما هیچ اطلاعاتی از Classroom دریافت نخواهد کرد.
یک معلم میتواند مستقل از توسعهدهنده، درس را اصلاح یا حذف کند. این بدان معناست که دانش توسعهدهنده از دوره آموزشی ممکن است قدیمی شود. اگر باید از تغییرات در دوره آموزشی آگاه باشید، برای تغییرات دوره آموزشی ، اعلانهای فشاری را تنظیم کنید.
یک معلم میتواند در Classroom UI با پیوندهایی به آدرسهای اینترنتی در وبسایت شما، کار درسی ایجاد کند. دروس ایجاد شده به این روش منحصراً متعلق به معلم است، بنابراین نمیتوانید با استفاده از Classroom API نمرات ارسالی را مشاهده، تغییر دهید یا تنظیم کنید.
تاریخ آخرین بهروزرسانی 2025-08-01 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-01 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# CourseWork integration\n\nDevelopers can use Google Classroom API to interact with coursework in\nGoogle Classroom. An application that uses the API in this way is referred to\nas a *`CourseWork` integration*.\n| **Key Point:** A `CourseWork` integration allows developers to programmatically access and modify the state of Google Classroom announcements, course materials, assignments, and student submissions. Choose this path if you need a low-cost way to push your content into Classroom.\n\nThis integration path is commonly used to create and grade assignments with\nlinks to resources outside of Classroom. It provides more\ndeveloper access to coursework management as compared to [Classroom Share buttons](/workspace/classroom/guides/sharebutton).\n\nHow it works\n------------\n\nThe core feature of a `CourseWork` integration is the creation and management of\nassignments, announcements, and course materials using Classroom API.\n\nOne example of a common user journey enabled by a `CourseWork` integration is to\nallow teachers to discover, assign, and grade content from within your website\nor application:\n\n1. A teacher user signs in to your website.\n2. The teacher finds or creates content that they want to share with their class. The teacher clicks a button on your website to send this content to Google Classroom.\n3. Your application issues a request to [`courses.courseWork.create`](/workspace/classroom/reference/rest/v1/courses.courseWork/create). The request contains a `CourseWork` object in its body that contains:\n - The destination course ID.\n - The title of the assignment.\n - The text description for the assignment.\n - A `link` [`Material`](/workspace/classroom/reference/rest/v1/Material) with the URL to the content selected by the teacher.\n - Optionally, the maximum score attainable for the selected content.\n4. A new assignment appears in Classroom with a link attachment. The link refers to the URL specified in the `create` request. See Figure 1 for an example.\n5. A new column for the assignment also appears in the Classroom gradebook, including the maximum score if provided.\n6. Students receive the assignment and click the `link Material` to open the provided URL in a new tab and view or complete the content on your website. Optionally, provide controls for the student to [turn in the assignment](/workspace/classroom/guides/manage-coursework#manage_student_response_state).\n7. Optionally, issue a request to [`courses.courseWork.studentSubmissions.modifyAttachments`](/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/modifyAttachments) to add attachments to a student submission, such as a Google Drive file or `link\n Material` that points to the student's work on your website.\n8. Optionally, issue a request to [`courses.courseWork.studentSubmissions.patch`](/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/patch) to set the student's grade for the assignment.\n\n**Figure 1.** Teacher view when editing an assignment with `link Material`\ncreated by a `CourseWork` integration.\n\nAlternatively, you could call [`courses.announcements.create`](/workspace/classroom/reference/rest/v1/courses.announcements/create) or\n[`courses.courseWorkMaterials.create`](/workspace/classroom/reference/rest/v1/courses.courseWorkMaterials/create) to create an announcement or course\nmaterial instead of an assignment. See the [Create \\& manage coursework](/workspace/classroom/guides/manage-coursework) and [Set\n\\& update grades](/workspace/classroom/guides/classroom-api/manage-grades) pages for detailed descriptions of the relevant\nClassroom API actions.\n\nConsiderations\n--------------\n\n| **Key Point:** There are some important limitations to a `CourseWork` integration. If these prevent you from realizing your product, consider building a [Google Classroom add-on](/workspace/classroom/add-ons) instead.\n\nKeep the following in mind before deciding if a `CourseWork` integration is the\nright choice for your product needs.\n\n- You need to authorize the user and prompt for their consent. You're making API requests *on the user's behalf* . This means, for example, that you can't create coursework in *any* Google Classroom course; you can only create coursework in courses that the authorized user teaches.\n- You need a way for the user to select a course to receive the content. Consider using [`courses.list`](/workspace/classroom/reference/rest/v1/courses/list) to get a list of the courses taught by the user, then allow the user to select one or more of the courses from the list.\n- When a user clicks a `link Material` in Classroom, the link opens in a new tab. Your server won't receive any information from Classroom when the URL opens.\n- A teacher can modify or delete the coursework independently of the developer. This means that a developer's knowledge of the coursework might become out of date. If you need to be aware of changes in coursework, consider setting up [push notifications](/workspace/classroom/best-practices/push-notifications) for coursework changes.\n- A teacher can create coursework in the Classroom UI with pasted links to URLs on your website. Coursework created in this manner are solely owned by the teacher, so you won't be able to view, modify, or set submission grades using the Classroom API."]]