唏嘘是什么意思| 畏手畏脚是什么意思| 新生儿什么时候能看见东西| 甲状腺结节是什么病| 大便干结是什么原因| 心脏扩大吃什么药好| 离岸人民币是什么意思| 网球ad是什么意思| tb是什么意思啊| 麻鸭是什么鸭| 高压高低压正常是什么原因| 食之无味什么意思| 男人高冷是什么意思啊| 618是什么| 什么拉车连蹦带跳| 蛰居是什么意思| 氟康唑治什么妇科炎症| 尿酸高不能吃什么水果| 什么叫意象| 结节是什么意思| 蛇的尾巴有什么作用| 黄历冲生肖是什么意思| 越什么越什么的词语| 猫能吃什么水果| 假体是什么| 左肾积水是什么意思| gbs筛查是什么| 女人吃槐花有什么好处| pg在医学是什么意思| 壁立千仞无欲则刚是什么意思| 刺猬为什么叫白仙| 痛经是什么意思| 什么叫会车| 壮丁是什么意思| 小孩缺锌有什么症状| 六味地黄丸有什么功效与作用| 鲤鱼为什么很少人吃| 狗眼看人低是什么意思| 移居改姓始为良是什么意思| 茹字五行属什么| 长期喝奶粉有什么好处| 3885是什么罩杯| 疳积是什么意思| 纤维增殖灶是什么意思| 手麻了是什么原因| 南昌有什么好玩的地方| 夏威夷披萨都有什么配料| 汪星人什么意思| 月经一个月来两次什么原因| 佛龛是什么意思| 肝功能七项是检查什么| 风热感冒吃什么消炎药| 射手座跟什么星座最配| 甲状腺回声不均匀什么意思| 海关是做什么的| 医院医务科是干什么的| 碳水化合物指的是什么| 双重人格是什么意思| 女人戴黄金有什么好处| 小孩子坐飞机需要什么证件| 风景旧曾谙是什么意思| 2岁属什么生肖| rta是什么意思| mers是什么病毒| 为什么新疆人长得像外国人| 好逸恶劳什么意思| 守是什么生肖| 流金岁月什么意思| 咳嗽有黄痰吃什么消炎药| 顾影自怜是什么意思| 柠檬片泡水喝有什么功效和作用| 澈字五行属什么| 男人下面出汗是什么原因| 蛐蛐吃什么| 心跳过缓是什么原因造成的| 成吉思汗是什么族| 烂嘴唇是什么原因引起的| 脖子长痘痘是因为什么原因| 138是什么意思啊| 什么湖什么海| 什么是高血压| 名列前茅的茅是什么意思| ab型rh阳性是什么意思| 今天是什么节气24节气| 什么人不能念阿弥陀佛| 胎停是什么原因引起的| 萝卜炖什么好吃| 吃什么排铅最快| 牙松动了还疼用什么方法处理最好| 白细胞十十是什么意思| 全身痒但是身上什么都没有| 不劳而获是什么意思| 什么是白噪音| 男方派去接亲要说什么| 男性检查男科都查什么| pedro是什么牌子| 素金是什么意思| 后脑勺发热是什么原因| 阴道口瘙痒是什么原因| 郑成功是什么朝代的| 百田森的鞋什么档次| 又当又立是什么意思| 腿痛去医院挂什么科| 五花大绑是什么意思| 在于是什么意思| 暗渡陈仓什么意思| 儿保是什么| 维生素b有什么用| 什么样的孕妇容易翻盘| 其实不然是什么意思| 脚烧热是什么原因| 目是什么意思| 蝎子吃什么| pet-ct主要检查什么| 什么是什么意思| 为什么要冬病夏治| salute什么意思| 颈静脉怒张见于什么病| 什么是转氨酶| 罗汉果可以和什么一起泡水喝| 中医内科主要看什么| 长可以加什么偏旁| 锦囊妙计是什么意思| 七夕什么时候| 是什么词性| 每天流鼻血是什么原因| 腋臭看什么科| 怀不上孕做什么检查| 大拇指有黑色竖纹是什么原因| 保花保果用什么药最好| 腿上的肉疼是什么原因| 满族不吃什么肉| 红肉是什么| 王白读什么| 苡字取名寓意是什么| 辅酶q10什么时间吃最好| 薄荷有什么功效和作用| 什么能减肚子上的脂肪| 嘴巴周围长痘痘是什么原因引起的| 胆固醇高吃什么最好| 火把节在每年农历的什么时间举行| 血糖的单位是什么| 手脚脱皮是什么原因| 下火吃什么药| 孕中期同房要注意什么| 什么食物降尿酸效果好| 支气管哮喘是什么原因引起的| 甲状腺是由什么引起的| 人为什么会得阑尾炎| 行李是什么意思| 拔牙挂什么科| 什么叫根管治疗牙齿| 臭虫怕什么东西| 股骨头坏死有什么好办法治疗吗| 沅字五行属什么| 胃息肉有什么危害| 鱼子酱什么味道| 不治身亡是什么意思| 动脉硬化是什么意思| 诺迪康胶囊治什么病| 桔子什么时候成熟| 幸存者偏差是什么意思| 指甲月牙代表什么| 田野里有什么| 尼姑庵是什么意思| 发烧吃什么水果好| 睡觉打呼噜什么原因| 龟代表什么生肖| 蛔虫属于什么动物| 杜甫被称为什么| 反流性食管炎b级是什么意思| 印度为什么那么热| 飞亚达手表什么档次| 6月17日什么星座| 草字头一个辛读什么| 长的像蛇的鱼是什么鱼| 农历十二月是什么月| 吃什么补蛋白最快| 前列腺钙化是什么原因引起的| 双子男喜欢什么样的女生| 放屁特别多是什么原因| 脂溢性皮炎用什么药膏| 君子兰用什么土最好| 尼泊尔属于什么国家| 什么是继发性肺结核| 脚痛什么原因引起的| 新生儿晚上哭闹不睡觉是什么原因| 胃幽门螺杆菌有什么症状| 炒木耳为什么会炸锅| 睾丸痛吃什么药| 金字旁的字和什么有关| 什么人不能喝绿豆汤| 母亲节送妈妈什么礼物好| 输卵管堵塞是什么原因造成的| 6月份是什么星座的| 水洗真丝是什么面料| 吃什么不长肉还能瘦| 李连杰什么病| 什么是生物制剂药| 咳嗽白痰吃什么药| 壑是什么字| 贪嗔痴是什么意思| amazon是什么意思| 力挺是什么意思| 天花是什么| 黄豆什么时候种| 卵圆孔未闭是什么病| 大佐是什么军衔| 前列腺ca是什么意思| 氨甲环酸又叫什么名| 嘴唇边缘发黑是什么原因| 肚子有硬块是什么原因| 额头冒痘是什么原因| 一代明君功千秋是什么生肖| 结肠炎有什么症状表现| 凤凰是什么生肖| 熬夜有什么坏处| who医学上是什么意思| 孕妇为什么不能参加婚礼| 什么是氙气| 儿童淋巴结肿大挂什么科| 颈椎压迫手麻吃什么药| 现在什么最赚钱| 肝脏彩超能检查出什么| 九个月宝宝吃什么辅食| 肩膀疼应该挂什么科| 乳房胀痛是什么原因| 静脉曲张是什么意思| 四月四号什么星座| 中国地图像什么| 望而生畏是什么意思| 从良是什么意思| 汗为什么是咸的| 猪肉炒什么好吃| 什么头蛇尾| 黑眼圈是什么原因引起的| 苹果不能和什么一起吃| 金牛男喜欢什么类型的女生| 和风什么| 发烧拉肚子是什么原因| 李宁是什么牌子| 非凡是什么意思| 单立人加吉念什么| 男人肾虚吃什么好| 1994年五行属什么| 肝火胃火旺吃什么药| pa环是什么| 低保是什么| 血常规异常是什么意思| 神经酰胺是什么| 陈皮和什么泡水喝最好| 肾痛吃什么药| 水泡型脚气用什么药好| 带状疱疹有什么症状| 副检察长什么级别| 处女座与什么星座最配| 血常规检查什么| 切诺是什么药| 爆炸盐是什么| 为什么嗓子总有痰| 马来西亚说什么语言| 岫岩玉是什么玉| 刘强东开什么车| 肛门跳动是什么原因| 百度

View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search
Cancel
  • Apple Developer
  • News
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Only search within “”

Quick Links

5 Quick Links

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos
  • About

More Videos

  • About
  • Transcript
  • Code
  • 京津冀三地患者迎医疗共享时代

    百度 而如果是工资的涨幅跑赢CPI、GDP的涨幅,则意味着居民每年的购买能力是不断扩容的。

    The ClassKit framework helps you surface educational activities within your app to teachers through the Schoolwork app. Discover how to provide a richer assignment experience for students and teachers through enhanced metadata properties and progress reporting. We'll also show you how the new ClassKit Catalog APIs decouple management of your content from that of your app and improve overall discoverability.

    Resources

    • ClassKit
      • HD Video
      • SD Video

    Related Videos

    WWDC20

    • What's new in education
  • Search this video…

    Hello and welcome to WWDC.

    Hello, I'm Baskaran. I'm an engineer on the Apple Education team. Today, my coworker Daniel and I would like to update you on the latest changes to ClassKit. First, I'll show you enhancements we have made to ClassKit, enhancements that will enable you to provide rich details about content in your apps.

    Then I will go over some recommended best practices for adopting ClassKit.

    After that, Daniel will introduce you to a new way to report your content using a service called ClassKit Catalog API.

    And finally, he will go over some recommended best practices for adopting ClassKit Catalog API.

    Let me begin with a brief overview of ClassKit. It's a core component of Apple education ecosystem.

    It's a framework that enables you to surface educational content in your apps as activities that teachers can use in assignments for their students. ClassKit enables your app to report progress as students work on their assignments. And most importantly, it does this while protecting the privacy of the students by only reporting progress on assigned activities. For example, if a teacher assigns students to read a chapter from Fun with Science and a student also reads a chapter from Basic Arithmetic, the student and the teacher will see progress only on Fun with Science because that was assigned reading. ClassKit was introduced in 2018. Now it's also available on macOS for creating native and Catalyst apps.

    For more information on ClassKit, check out our 2019 session "What's New in ClassKit" and our 2018 session "Introducing ClassKit." Before I go into the enhancements, let's take a quick look at how content in your app appears as assignable activities in Schoolwork. Your app defines the content and describes it as activities using ClassKit, which can be browsed using Schoolwork.

    With Schoolwork, it's easy to share class materials, get students to a specific activity in an app, collaborate with students and view student progress.

    When you open Schoolwork, you'll land on this view which serves as home base for all content teachers assign to their students.

    You tap on the New Handout button on the top right to create a new handout.

    Let me zoom in to make it easier to see.

    Now, tap on the App Activities to show the app activity chooser.

    The app activity chooser shows ClassKit-enabled apps with App Activities. Here, we see three apps with activities. I'm going to use the Book Reader app as an example for this presentation. Let's look at the activities within Book Reader.

    We see a book, Fun with Science, with activities.

    Let's browse the activities in Fun with Science.

    There are several activities in Fun with Science organized by chapters. Let's see what's in the first chapter titled "Inquiry." This chapter has one activity, Science Investigation. Let's look at that activity.

    At the end of the section on Science Investigation, we see a quiz.

    By the way, did you notice the rich details shown for the activities? We see here a thumbnail, a summary describing the activity, suggested age and suggested completion time and the types of progress reported by the app for the activity. These details help teachers to decide if they want to use this activity in an assignment or not. Now let me show you how we can add these details to activities in our app. Before we do that, let's take a brief look at App Activities.

    An app activity is any assigned content in your app. This could be a chapter in a book, a media stream in a podcast, a test, a quiz and so on.

    They are defined by your app and are structured hierarchically.

    Let's look at our example. We saw a hierarchy of activities in a book titled Fun with Science.

    At the top level of that hierarchy is the book Fun with Science. The children of the book are the chapters in the book, and their children are the sections in the chapters and so on. You may be wondering how we surface these activities in Schoolwork. We use the CLSContext class in ClassKit and create an instance of CLSContext to represent each activity. ClassKit provides a root context for your app called the Main App Context. This is the parent of your activity hierarchy.

    Get the Main App Context...

    create a CLSContext for the topmost activity Fun with Science and add it as a child of the Main App Context.

    Then go down the activity hierarchy...

    create a context for each activity and add it to its parent's context. Now I'm going to use the measurements quiz activity as an example and show you how to add rich details to that activity. As we saw earlier, there are several details here.

    Let me walk you through, in steps, and show you how to add these details to the quiz context. So, first, let me show you how you can add a thumbnail and summary to the quiz context. First, create a context for the activity. In this case, it is a measurements quiz. Then add a summary to the context. You say what the quiz is about. Then add a thumbnail. Remember, ClassKit limits the size of thumbnails to 330 by 330 pixels.

    It will downsize if needed. In this example, we are creating a thumbnail from an image asset, measurements_quiz.jpg. Notice that we are using a function, thumbnailFromImage, to get a thumbnail from a file URL. Let's take a look at this function.

    This function shows you how to create a thumbnail from a file URL in a memory-efficient way using CoreGraphics.

    First create an image source from the file...

    then set some options for creating a thumbnail.

    We are choosing to always create a thumbnail from an image with a maximum size of 330 pixels.

    Then create the thumbnail and return it. This is just one way of creating a thumbnail.

    If UIImage is more readily available to you, you can get its CGImage property and use it as thumbnail. But keep in mind, doing it that way may significantly increase the memory used by your app. Okay. Let's add some more properties to the quiz context. Let's add suggested age and suggested completion time.

    It is very simple to add these properties. They are both expressed as ranges. Let's set the suggested age as nine to 11 years and the suggested completion time as 15 to 20 minutes. Next we will add the type of progress data reported for the quiz activity.

    In this example, we see four kinds of progress data being reported-- percentage of progress, correct/incorrect score for each question...

    the number of hints used by the student when taking the quiz and an overall score. I'm going to show you how to add a couple of these to the quiz context. First, create a capability for reporting progress percent.

    The CLSProgressReportingCapability class has two properties-- "kind" and "details." You set the kind to percent kind and set the details to a descriptive text. Next create a capability to report the number of hints used when taking the quiz. You can see how simple it is to create each reporting capability. Finally, we add these capabilities to the quiz context. In this example, I have set the capability details in English, but these text strings are visible to users, so please localize them at run time based on the current locale. Remember, this is similar to what you have been doing when setting the user visible title of the activity. Okay. Now you know how to add the new properties to your app activities.

    This is how you make your app activities rich. Now I would like to go over some recommended best practices for creating and managing context for your app.

    The newly introduced properties on CLSContext adds valuable metadata that informs the teacher about the rich set of activities in your app.

    So, when you create a context, please create a full-featured context with as much metadata as you can provide.

    If you find context saved by an older version of your app, update any missing properties.

    If your app no longer supports an older context, then delete the context so it does not show in the list of activities supported by your app.

    If your app uses a context provider app extension to create context, please update that app extension as well.

    I'm almost done here, and Daniel is itching to tell you all about the brand-new ClassKit Catalog APIs. However, I want to tell you about a few more enhancements we have added to CLSContext that many of you requested.

    Like a read-only property identifierPath.

    This returns you the full identifierPath of the context. And a new context type "course," and a new context type "custom." Use this in case none of the predefined types is suitable for your app's content. And an optional settable property to give a name to your custom context, your new property to mark a context as a nonassignable activity. Let's see where this property is very useful.

    In our example, we created context for a book. You see the entire book, Fun with Science, is an assignable activity indicated by a plus. But I don't think your teacher would assign that entire book. In fact, as a developer, you did not intend to make a book an assignable activity.

    You were just using a CLSContext for the book as a container to hold its chapters.

    Now, by setting the new isAssignable property of the context to "false," you can make it clear that the book is not an assignable activity. I encourage you to review the updated developer documentation to learn about all the enhancements we have made to ClassKit.

    These are the latest enhancements to ClassKit.

    With that, let me invite Daniel to introduce you to the new and exciting ClassKit Catalog API. Here you go, Daniel. Thanks, Baskaran. Today, we'd like to introduce a new web service called ClassKit Catalog API.

    Our motivation behind this service was to provide an even better experience for our developers who build ClassKit-enabled apps and for the teachers who use them. We built this to help you with several things in mind. First, we wanted to improve your content's discoverability within Schoolwork. Consumers of your app should see the rich repository of content you've made available to them without having to work through each piece first.

    Next, we wanted to give you support to provide an even wider array of ClassKit-enabled content than otherwise possible, using the native approach of CLSContext creation.

    Lastly, we wanted to decouple the management of your content from the management of your application.

    Your content is subject to change, and you should be able to make those modifications without changing your app.

    How do we achieve this? Currently, the CLSContexts are defined natively in your app. As teachers use it, it delegates to ClassKit to generate the necessary contexts that get saved on the teacher's device and eventually on the students' devices too.

    ClassKit Catalog API prescribes a different way to report your content.

    To use this new service, begin by translating your existing CLSContext hierarchy into a JSON structure.

    Next, take the payload and upload it using the ClassKit Catalog API.

    From there, using the data that you've provided, we'll handle the generation of CLSContext on the teacher or students' devices whenever your app is referenced in Schoolwork. Before I move on, it's important to note that ClassKit Catalog API is intended for content you'd like to display publicly in Schoolwork. Private content, such as dynamically generated or user-specific CLSContexts should continue to be reported to ClassKit using the native API.

    We have a new address to which you can make requests: api.classkit-catalog.apple.com.

    This is suffixed with "v1" in order to version our API to support any changes we may introduce in the future.

    The API itself is comprised of two main components, one to manage contexts and one to manage thumbnails.

    Contexts are the fundamental unit that describe your content and that the catalog operates on.

    You can think of them as the CLSContexts that Baskaran presented earlier, but with a couple of more bells and whistles. We'll take a closer look at them a little later.

    Thumbnails are images you associate with your contexts. In the first part of this presentation, we saw how this is done natively using ClassKit.

    Well, with the API, we'll use the thumbnail endpoint, which we'll see later as well. Today, we'll focus on the POST requests. Let's begin by looking at one for contexts.

    Here's an example of a POST request with the required fields you'll be expected to provide. First is a query parameter labeled "environment." It determines whether the changes you make target a development environment or are made live to production.

    We'll see how to take advantage of this a little later. Next, a couple of headers are expected. Content-Type and Authorization.

    Content-Type describes what sort of payload you'll be delivering. For this endpoint, it should be application/json.

    Authorization describes the credential with which you'll authenticate with our service.

    For ClassKit Catalog API, we decided to adopt the use of JSON Web Tokens. This is an industry-standard approach to authentication that's used across several of Apple's web services.

    We'll detail how to generate these tokens later in the presentation.

    The body of this request should contain a JSON-formatted list of contexts to be created or updated.

    These contexts represent the CLSContexts in your application, and in order for your application's capabilities to be properly represented, the entire context tree associated with your ClassKit-enabled app will have to be reported.

    A single context consists of two fields, data and metadata. Let's take a closer look at how these two fields are constructed.

    The data object is comprised of fields taken directly from a CLSContext, including the new fields added to the latest update of ClassKit, which Baskaran mentioned earlier.

    When you create this data object, use the values of the fields from the CLSContext that your app already creates.

    Make sure that they match the contexts your app natively creates, so that your content can be properly represented in the catalog.

    The metadata field is meant to capture info that's not represented in CLSContext.

    It contains three fields.

    Locale, which is meant to distinguish your content between different languages and regions of your application, minimumBundleVersion, which acts as a hit for the client to determine whether this context is supported by a version of your app, and keywords, which represent tags that you believe accurately describes your content. Metadata is a sparse object, but we expect it to grow along with the API.

    That was an example of a POST request for contexts.

    More details on this endpoint, along with the GET and DELETE methods for contexts, will be available in Apple Developer documentation.

    For now, let me highlight a couple of guidelines on the context endpoint. First, there's a limit of 200 contexts per POST request. If you have more, split them up across multiple requests.

    If you do, make sure that the children contexts are submitted after their ancestors. Aside from your main app context, child contexts are considered invalid if their parent does not exist. Lastly, should you decide to delete a context, be aware that any of its descendants will be deleted as well. This is done to ensure the integrity of your app's context hierarchy. Moving on, let's take a look at the POST method to upload a thumbnail.

    Here's an example of one with the fields expected in a request.

    It begins with a thumbnail reference, which is used to associate the thumbnail to one or more contexts.

    This is done by matching against the thumbnail field on a context object.

    The rest of this request should be similar to the first one we saw. For instance, we must also target an environment using the "environment" query parameter...

    provide credentials using the Authorization header, as well as a Content-Type to describe the image being uploaded.

    Unlike our previous POST request, we have the addition of a Content-Length to describe the size of the thumbnail to be uploaded in bytes and a body that consists of the bytes representing the image.

    During the Handout creation flow, this image is used to represent an Activity. So keep that in mind as you decide how best to represent your content.

    That was a look at the POST endpoint for a thumbnail. The corresponding GET and DELETE endpoints are structured similarly, and more details can be found in Apple Developer documentation. Before I move on, let me highlight some guidelines for the thumbnail endpoints. First, use PNG or JPEG to represent your thumbnails.

    Next, format your thumbnails to be 330 by 330 pixels. That's the resolution we'll use for Schoolwork.

    Lastly, upload your contexts first, followed by your thumbnails.

    This is to prevent thumbnails to be orphaned. Upload requests will be rejected if the thumbnail isn't referenced by any context.

    This also means if the last context to reference a thumbnail were to be deleted, then the thumbnail would be deleted too.

    Before I move on, let's talk about how the API would respond when something goes wrong.

    Here is an example of a response you might get back from trying to POST a thumbnail that's reporting an error.

    Aside from an expected HTTP status code, a response reporting an error should also contain a JSON body to provide more details on the problem.

    The ID field provides a unique identifier which we can use to identify and track this error.

    We can tell from the code field that there's a problem with authentication...

    and upon inspecting the message field, we find a human-readable explanation of the problem, as well as the way to resolve it. A full list of error codes and their respective messages will be available in Apple Developer documentation. As for this authentication error, how do we get past this? As promised, let's talk about authentication. We mentioned earlier that authentication in ClassKit Catalog API is handled with the use of JSON Web Tokens, or JWT.

    This is an industry standard that's used across several of Apple's web services.

    To begin, log into the Apple Developer portal and provision a ClassKit Catalog API key for your team.

    This private key will be used to create the JWT used to authenticate with ClassKit Catalog API, and must be provided with all the requests you make as part of the Authorization header we mentioned earlier.

    The JWT consists of three parts, a header, a payload and a signature.

    To form the header and payload, provide the key ID and team ID found in the Apple Developer portal.

    This will associate the credential to your developer team.

    Additionally, generate a UUID to identify this token and two UNIX time stamps, one to represent when the token was issued and one to represent when the token expires.

    What we see here are the raw fields.

    To form the eventual token, these fields will have to be Base64 encoded.

    To complete the JWT, a signature is required, which is generated using encoded header and encoded payload.

    The algorithm to be used to sign this is ECDSASHA256.

    There are plenty of public libraries across programming languages that should make it easy to do so.

    Altogether, the fully formed JWT will look like this.

    This token must be included in the Authorization header and prefixed with the word "Bearer." Now that we have all the pieces, how would you test the content you've uploaded before it's shown to your users? We have two environments to which you can push your content, development and production.

    To test your changes, use the "environment" query parameter to upload your content to development, like we showed earlier in the presentation.

    Once you've done that, open Settings and navigate to the Developer tab on your device that's running a development build of iOS.

    Tap on ClassKit API to see more options.

    Under ClassKit Catalog Environment, select the Development environment.

    Once it's set, ClassKit will change where it pulls data from and display the appropriate content in Schoolwork based on the environment you have chosen.

    Take note that content pushed to development will be available to all ClassKit Apple developers who are also using the Development environment.

    To wrap up, I'd like to highlight some best practices to keep in mind while using the API.

    First and most importantly, as you define new content or remove old content, report this using ClassKit Catalog API. This ensures that your app and its Activities are properly represented in Schoolwork.

    Next, take advantage of locale support provided for contexts.

    Doing so helps your app reach the widest audience possible.

    Lastly, you'll want to provide as much detail as you can in the contexts you report and have thumbnails associated with them. This will provide more detail to users in Schoolwork as well as a more compelling reason for them to assign content from your app. That's all for ClassKit Catalog API. It will be available for ClassKit developers this summer.

    This also concludes our presentation of "What's New in ClassKit." Thanks.

    • 6:25 - Add Thumbnail and Summary to Quiz Context

      // Create a context for quiz
      let quizContext = CLSContext.init(type: CLSContextType.quiz, identifier: "science_Investigation_quiz", title: "Measurements Quiz")
      
      // Add a summary describing this context
      quizContext.summary = "A short quiz to test how much students know about scientific measurements and how to examine and analyze scientific data."
      
      // Add a thumbnail for this context — ClassKit will downsize thumbnails to 330 x 330 px if needed
      let bundle = Bundle.main
      if let resourceURL = bundle.resourceURL {
          let imageURL = resourceURL.appendingPathComponent("measurements_quiz.jpg")
          if let thumbnail = thumbnailFromImage(atURL: imageURL) {
              quizContext.thumbnail = thumbnail
          }
      }
    • 6:52 - thumbnailFromImage

      // Create a thumbnail of maximum dimension 330 x 330 px from an image file
      func thumbnailFromImage(atURL: URL) -> CGImage? {
         if let imageSource = CGImageSourceCreateWithURL(atURL as CFURL, nil) {
             let thumbnailOptions = [kCGImageSourceCreateThumbnailFromImageAlways as String: true,
                                     kCGImageSourceThumbnailMaxPixelSize as String: 330]
             return CGImageSourceCreateThumbnailAtIndex(
                 imageSource, 0, thumbnailOptions as CFDictionary);
         }
         return nil
      }
    • 7:59 - Add suggestedAge and suggestedCompletionTime

      // Add suggested age range appropriate for the content — ages 9 to 11 years
      
      quizContext.suggestedAge = NSRange(9...11)
      
      // Add suggested time to complete this quiz — 15 to 20 minutes
      
      quizContext.suggestedCompletionTime = NSRange(15...20)
    • 8:15 - Add progress reporting capabilities

      // Add progress reporting capabilities
      
      let reportingPercentDetails = "Reports percentage of progress"
      let reportingCapabilityPercent = CLSProgressReportingCapability.init(
              kind: .percent,
              details: reportingPercentDetails)
      
      let reportingQuantityDetails = "Reports number of hints used"
      let reportingCapabilityQuantity = CLSProgressReportingCapability.init(
              kind: .quantity,
              details: reportingQuantityDetails)
      
      quizContext.addProgressReportingCapabilities([reportingCapabilityPercent,
                                             reportingCapabilityQuantity])

Developer Footer

  • Videos
  • WWDC20
  • What's new in ClassKit
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • App Extensions
    • App Store
    • Audio & Video
    • Augmented Reality
    • Design
    • Distribution
    • Education
    • Fonts
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning
    • Open Source
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Tutorials
    • Downloads
    • Forums
    • Videos
    Open Menu Close Menu
    • Support Articles
    • Contact Us
    • Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Get the Apple Developer app.
    Copyright ? 2025 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines
    煮沸除氯是什么意思 一什么不什么 拌嘴是什么意思 肾挂什么科室 哺乳期头痛可以吃什么药
    中药什么时候喝效果最好 芒果什么人不能吃 田螺小子是什么意思 改名字需要什么手续 8.9是什么星座
    10月28号是什么星座 意有所指是什么意思 什么是护理学 肉鸽是什么意思 叉烧肉是什么肉
    杭州菜属于什么菜系 art是什么 肾主什么 pp材质是什么意思 结石什么原因引起的
    烩是什么意思hcv8jop6ns5r.cn 回光返照什么意思hcv8jop6ns0r.cn 日本料理都有什么菜clwhiglsz.com 拔罐起水泡是什么原因hcv8jop7ns3r.cn 建议随诊是什么意思hcv9jop7ns0r.cn
    打扰了是什么意思hcv9jop0ns6r.cn 肛门里面痒是什么原因hcv8jop7ns0r.cn 开火上下结构念什么travellingsim.com 注音是什么hcv9jop6ns8r.cn 一什么陆地hcv7jop7ns0r.cn
    安乃近是什么药clwhiglsz.com 黑豆有什么功效和作用shenchushe.com 剖腹产可以吃什么水果hcv8jop0ns7r.cn 高危行为是什么意思hcv9jop3ns0r.cn 女人左手麻要注意什么hcv9jop6ns3r.cn
    血糖高不能吃什么sscsqa.com 冰岛为什么不让随便去hcv8jop3ns9r.cn vs什么意思hcv9jop0ns9r.cn 吐司是什么意思hcv9jop1ns4r.cn 上梁不正下梁歪是什么意思cl108k.com
    百度