107 lines
2.7 KiB
Plaintext
107 lines
2.7 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import json,os\n",
|
|
"with open(r\"..\\题库0.3\\problems.json\",\"r\",encoding = \"u8\") as f:\n",
|
|
" database = f.read()\n",
|
|
"pro_dict = json.loads(database)\n",
|
|
"units = [\"第一单元\",\"第二单元\",\"第三单元\",\"第四单元\",\"第五单元\",\"第六单元\",\"第七单元\",\"第八单元\",\"第九单元\"]\n",
|
|
"count1 = [0]*9\n",
|
|
"count2 = [0]*9\n",
|
|
"for id in pro_dict:\n",
|
|
" for u in range(9):\n",
|
|
" unit = units[u]\n",
|
|
" if unit in \"\".join(pro_dict[id][\"tags\"]):\n",
|
|
" count1[u] += 1\n",
|
|
" if len(pro_dict[id][\"objs\"]) > 0:\n",
|
|
" count2[u] += 1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"第一单元 . 总题数: 1766 , 完成对应题数: 1400\n",
|
|
"第二单元 . 总题数: 2495 , 完成对应题数: 2127\n",
|
|
"第三单元 . 总题数: 2079 , 完成对应题数: 395\n",
|
|
"第四单元 . 总题数: 1126 , 完成对应题数: 1032\n",
|
|
"第五单元 . 总题数: 1329 , 完成对应题数: 305\n",
|
|
"第六单元 . 总题数: 1074 , 完成对应题数: 431\n",
|
|
"第七单元 . 总题数: 1338 , 完成对应题数: 953\n",
|
|
"第八单元 . 总题数: 1221 , 完成对应题数: 195\n",
|
|
"第九单元 . 总题数: 252 , 完成对应题数: 101\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"for u in range(len(units)):\n",
|
|
" print(units[u],\". 总题数:\",count1[u],\", 完成对应题数:\",count2[u])\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(12680, 6939)"
|
|
]
|
|
},
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"(sum(count1),sum(count2))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3.8.8 ('base')",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.8.8"
|
|
},
|
|
"orig_nbformat": 4,
|
|
"vscode": {
|
|
"interpreter": {
|
|
"hash": "d311ffef239beb3b8f3764271728f3972d7b090c974f8e972fcdeedf230299ac"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|