浏览可汗学院主题树

时间:2017-08-22 14:06:47

标签: javascript json google-apps-script oauth khan-academy

我正在尝试使用Google App Scripts访问Khan Academy服务器并计算掌握特定主题所需的技能数量。例如,我希望能够检索掌握代数1所需的技能数量。如何使用'topictree'来做到这一点?我已经成功访问​​了Khan Academy服务器,并且打印出topictree的内容没有问题 - 我只需要知道存储所需技能的信息。谢谢!

function listExercises() {
  var service = getKhanAcademyService();
  if (service.hasAccess()) {

    var response = service.fetch('https://www.khanacademy.org/api/v1/topictree');
    Logger.log(response);

    //----Here I would like to navigate to a specific topic (like Algebra 1) 
    in the topic tree and retrieve how many skills are required to master it-- //

  } else {
    var authorizationUrl = service.authorize();
    Logger.log('Please visit the following URL and then re-run the script: ' + authorizationUrl);
  }
}

0 个答案:

没有答案