קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מפתחים יכולים להשתמש ב-Google Classroom API כדי ליצור אינטראקציה עם חומרי לימוד ב-Google Classroom. אפליקציה שמשתמשת ב-API בצורה הזו נקראת CourseWork שילוב.
השילוב הזה משמש בדרך כלל ליצירה ולמתן ציונים למטלות עם קישורים למקורות מידע מחוץ ל-Classroom. הוא מספק גישה רחבה יותר למפתחים לניהול עבודות בהשוואה ל
לחצני השיתוף ב-Classroom.
איך זה עובד
התכונה העיקרית של CourseWork שילוב היא יצירה וניהול של מטלות, הודעות וחומרי לימוד באמצעות Classroom API.
דוגמה לתהליך נפוץ שעוברים משתמשים בעקבות שילוב של CourseWork היא האפשרות לאנשי חינוך לגלות תוכן, להקצות אותו ולתת לו ציון מתוך האתר או האפליקציה שלכם:
משתמש עם הרשאת מורה מתחבר לאתר שלכם.
המורה מוצא/ת או יוצר/ת תוכן שהוא/היא רוצה לשתף עם הכיתה. המורה לוחץ על כפתור באתר שלכם כדי לשלוח את התוכן הזה אל Google Classroom.
האפליקציה שלך שולחת בקשה אל courses.courseWork.create. הבקשה מכילה אובייקט CourseWork בגוף שלה, שמכיל:
מזהה הקורס של היעד.
שם המטלה.
תיאור המטלה.
linkMaterial עם כתובת ה-URL של התוכן שנבחר על ידי המורה.
אפשרות נוספת: הציון המקסימלי שאפשר לקבל על התוכן שנבחר.
מטלה חדשה מופיעה ב-Classroom עם קישור מצורף.
הקישור מתייחס לכתובת ה-URL שצוינה בבקשת create. דוגמה מופיעה באיור 1.
עמודה חדשה של המטלה מופיעה גם בגיליון הציונים ב-Classroom, כולל הציון המקסימלי אם הוא צוין.
התלמידים מקבלים את המטלה ולוחצים על הסמל link Material כדי לפתוח את כתובת ה-URL שסיפקתם בכרטיסייה חדשה ולצפות בתוכן באתר שלכם או להשלים אותו.
אופציונלי: מספקים לתלמידים אמצעי בקרה להגשת המטלה.
לפני שמחליטים אם שילוב של CourseWork הוא הבחירה הנכונה לצרכים של המוצר, כדאי לקחת בחשבון את הנקודות הבאות.
צריך לתת הרשאה למשתמש ולבקש את הסכמתו. אתם שולחים בקשות ל-API בשם המשתמש. לדוגמה, לא תוכלו ליצור מטלות בכל קורס ב-Google Classroom, אלא רק בקורסים שבהם המשתמש המורשה מלמד.
צריך לאפשר למשתמש לבחור קורס כדי לקבל את התוכן.
אפשר להשתמש ב-courses.list כדי לקבל רשימה של הקורסים שהמשתמש מלמד, ואז לאפשר למשתמש לבחור קורס אחד או יותר מהרשימה.
כשמשתמש לוחץ על link Material ב-Classroom, הקישור נפתח בכרטיסייה חדשה. השרת לא יקבל מידע מ-Classroom כשהכתובת תפתח.
מורים יכולים לשנות או למחוק את חומרי הלימוד בלי קשר למפתח. המשמעות היא שהידע של מפתח מסוים בנושאים שנלמדים בקורס עלול להיות לא עדכני. אם חשוב לכם לדעת על שינויים בחומר הלימוד, כדאי להגדיר התראות פוש לגבי שינויים בחומר הלימוד.
מורים יכולים ליצור חומרי לימוד בממשק המשתמש של Classroom באמצעות קישורים שהודבקו לכתובות URL באתר שלכם. הבעלות על עבודות שנוצרו בדרך הזו היא של המורה בלבד, ולכן לא תוכלו להציג, לשנות או להגדיר ציונים לעבודות באמצעות Classroom API.
[null,null,["עדכון אחרון: 2025-08-01 (שעון UTC)."],[],[],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."]]