Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 导航Khan学院主题树_Javascript_Json_Google Apps Script_Oauth_Khan Academy - Fatal编程技术网

Javascript 导航Khan学院主题树

Javascript 导航Khan学院主题树,javascript,json,google-apps-script,oauth,khan-academy,Javascript,Json,Google Apps Script,Oauth,Khan Academy,我正在尝试使用谷歌应用程序脚本访问Khan Academy服务器,并计算掌握给定主题所需的技能数量。例如,我希望能够获得掌握代数1所需的技能数量。我如何使用“topictree”实现这一点?我已经成功访问了Khan Academy服务器,打印出主题树的内容没有问题——我只需要知道所需技能的信息存储在哪里。谢谢 function listExercises() { var service = getKhanAcademyService(); if (service.hasAccess())

我正在尝试使用谷歌应用程序脚本访问Khan Academy服务器,并计算掌握给定主题所需的技能数量。例如,我希望能够获得掌握代数1所需的技能数量。我如何使用“topictree”实现这一点?我已经成功访问了Khan Academy服务器,打印出主题树的内容没有问题——我只需要知道所需技能的信息存储在哪里。谢谢

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);
  }
}