-
Meet ClassKit for file-based apps
The ClassKit framework can help surface educational activities within your app to teachers using the Schoolwork app. Discover how you can provide teachers with greater insights into student learning by adopting the latest file-based API to report student progress data within your app. We'll also show you how to use ClassKit to report out different data types, and how to test your implementation in developer mode.
Ressources
-
Rechercher dans cette vidéo…
-
-
7:25 - openFile()
func openFile() async throws { // Your existing code for opening a file goes here. let activity = await try CLSDataStore.shared.fetchActivity(for: fileURL) activity.start() await try CLSDataStore.shared.save() } -
8:07 - closeFile()
func closeFile() async throws { let activity = await try CLSDataStore.shared.fetchActivity(for: fileURL) let wordCount = activity.primaryActivityItem as? CLSQuantityItem ?? CLSQuantityItem(identifier: "total_word_count", title: "Word Count") wordCount.quantity = currentDocumentWordCount() activity.primaryActivityItem = wordCount activity.progress = progress() activity.stop() await try CLSDataStore.shared.save() } -
8:48 - closeFile()2
func closeFile() async throws { let activity = await try CLSDataStore.shared.fetchActivity(for: fileURL) let wordCount = activity.primaryActivityItem as? CLSQuantityItem ?? CLSQuantityItem(identifier: "total_word_count", title: "Word Count") wordCount.quantity = currentDocumentWordCount() activity.primaryActivityItem = wordCount activity.progress = progress() activity.stop() await try CLSDataStore.shared.save() } -
11:20 - openFile() BreakPointHit
func openFile() async throws { // Your existing code for opening a file goes here. let activity = await try CLSDataStore.shared.fetchActivity(for: fileURL) activity.start() await try CLSDataStore.shared.save() } -
11:55 - closeFile() BreakPointhit
func closeFile() async throws { let activity = await try CLSDataStore.shared.fetchActivity(for: fileURL) let wordCount = activity.primaryActivityItem as? CLSQuantityItem ?? CLSQuantityItem(identifier: "total_word_count", title: "Word Count") wordCount.quantity = currentDocumentWordCount() activity.primaryActivityItem = wordCount activity.progress = progress() activity.stop() await try CLSDataStore.shared.save() }
-