Get KA exercise hierarchy

廉价感情. 提交于 2020-01-02 12:45:07

问题


Is there a way to get a json with the whole exercise tree using the API, like this (array or object)?

Math
    "Early Math"...
    ...
    "Algebra II"
       "Advanced Functions"
           "Determine the domain of funs"
           ...
           "Compare features of funs"
...

Tnx.


回答1:


The topictree endpoint has all of this information, and you can use the kind filter to show exercises (and topics). http://www.khanacademy.org/api/v1/topictree?kind=Exercise

You can also load individual topics to navigate the entire tree (not just videos and exercises). For example, this URL gets direct information about the "combining-functions" topic:

http://www.khanacademy.org/api/v1/topic/combining-functions?format=pretty

From there, you can see that there's a child article with ID "xd2620963". You can load JSON information about that article using the /api/v1/articles endpoint (which unfortunately isn't documented):

http://www.khanacademy.org/api/v1/articles/xd2620963?format=pretty

Or, with many topics, they will have child topics that you can navigate to.

(That format=pretty at the end just makes the JSON response a little more human-readable; you should leave it off when accessing the JSON programmatically.)



来源:https://stackoverflow.com/questions/34231475/get-ka-exercise-hierarchy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!