Hiện tại, các nhà phát triển đã có thể sử dụng rộng rãi tiện ích bổ sung của Google Lớp học! Vui lòng xem tài liệu về tiện ích bổ sung để biết thêm thông tin.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Có thể có một số trường hợp bạn muốn người dùng tương tác với sản phẩm của mình bên ngoài iframe. Bạn có thể tải nội dung tệp đính kèm trong một thẻ mới thay vì trong iframe của tiện ích bổ sung Lớp học, miễn là tiện ích bổ sung của bạn tuân thủ các nguyên tắc sau.
Hành vi bắt buộc trong thẻ hoặc cửa sổ mới
Danh sách kiểm tra yêu cầu của tiện ích bổ sung Lớp học chỉ định một số hành vi nhất định khi mở thẻ hoặc cửa sổ mới. Bảng sau đây cung cấp thông tin làm rõ và đề xuất triển khai liên quan đến từng yêu cầu.
Mã nhận dạng
Yêu cầu
Cách gặp gỡ
3.2
Nếu một nhiệm vụ được khởi chạy vào một thẻ hoặc cửa sổ mới từ bất kỳ hành trình nào của iframe, thì nhiệm vụ đó PHẢI cung cấp một thông báo thân thiện với người dùng để quay lại Lớp học.
Trên trang web bên ngoài, hãy thêm một thông báo, biểu ngữ, thông báo dạng nổi hoặc thông báo khác hướng dẫn người dùng quay lại Classroom khi hoàn thành bài tập.
5.1
Khi studentViewUri được khởi chạy, tiện ích bổ sung KHÔNG ĐƯỢC đưa người dùng ra khỏi iframe để hoàn thành một tác vụ.
Lý tưởng nhất là người dùng có thể hoàn tất tất cả các hành trình có liên quan trong iframe. Việc mở thẻ mới có thể khiến người dùng mất phương hướng và làm tăng độ phức tạp khi sử dụng tiện ích bổ sung.
Giữ trải nghiệm người dùng trong iframe để giảm thiểu phiền toái cho người dùng.
5.2
Nếu hoạt động của tiện ích bổ sung bật ra khỏi iframe, thì PHẢI có bản xem trước về tác vụ trong iframe.
Đừng mở trang web bên ngoài ngay khi người dùng nhấp vào thẻ tệp đính kèm. Thay vào đó, hãy cung cấp một khung hiển thị lớp xen kẽ cơ bản trong iframe cho thấy hình ảnh hoặc nội dung mô tả về tác vụ mở trong một thẻ mới. Đưa ra hướng dẫn để giúp người dùng điều hướng và hoàn tất hoạt động một cách thành công.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[],[],null,["# Open content in new tabs\n\nThere may be some situations in which you would prefer users interact with your\nproduct outside of an iframe. You can load attachment content in a new tab\nrather than in a Classroom add-on iframe as long as your\nadd-on conforms to the following guidelines.\n| **Important:** You should adapt your content to work within the iframes if possible. Ease of access and reduced time and effort to reach content are two key benefits of building a Classroom add-on.\n\nRequired behaviors in new tabs or windows\n-----------------------------------------\n\nThe Classroom add-on [requirements checklist](/workspace/classroom/add-ons/requirements) specifies certain\nbehaviors when opening new tabs or windows. The following table provides\nclarifications and implementation suggestions regarding each requirement.\n\n| ID | Requirement | How to meet |\n|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 3.2 | If a task is launched into a new tab or window from any of the iframe journeys, it MUST provide a user-friendly message to return to Classroom. | On the external site, include a message, banner, toast, or other notification instructing the user to return to Classroom when finished with the task. |\n| 5.1 | When the `studentViewUri` is launched, the add-on SHOULD NOT pop the user out of the iframe to complete a task. | Ideally, users are able to complete all relevant journeys within the iframe. Opening new tabs can disorient users and adds to the complexity of using the add-on. Keep the user experience within the iframe to provide the least user friction. |\n| 5.2 | If the add-on activity pops out of the iframe there MUST be a preview about the task in the iframe. | Don't open the external site immediately when the user clicks the attachment card. Instead, provide a basic interstitial view in the iframe showing an image or description of the task that opens in a new tab. Include instructions to help users successfully navigate and complete the activity. |"]]