我可以通过API获得课程练习信息,但是无论是测验还是单元测试都无法获得。我希望我能够以某种方式破解API以获取所需的信息,即使他们没有明确提到可以使用API访问测验和单元测试信息。这是我尝试的Python代码:
## Get all quizzes and unit exams?
leaves = ['exercises', 'quiz', 'quizzes', 'test', 'test']
for leaf in leaves:
quizzes = []
for unit in unitSlugs:
branch = 'topic/' + unit + leaf
URL = ROOT + branch
R = requests.get(URL, headers=Headers)
quizList = json.loads(R.text)
quizzes.append(quizList)
print(quizzes)
# exercises returns empty list. all other leaves have 404 error.
# 'exercises':
# [[], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
unitSlugs在哪里
['analyzing-categorical-ap',
'quantitative-data-ap',
'summarizing-quantitative-data-ap',
'density-curves-normal-distribution-ap',
'bivariate-data-ap',
'gathering-data-ap',
'probability-ap',
'random-variables-ap',
'sampling-distribution-ap',
'estimating-confidence-ap',
'tests-significance-ap',
'two-sample-inference',
'chi-square-tests',
'inference-slope-linear-regression',
'prepare-for-the-2019-ap-statistics-exam']