From 62aacc07e76d47b83563951f8e52c4f3afbf6bc6 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Mon, 12 Sep 2022 13:47:34 +0800 Subject: [PATCH] 20220912 noon --- 工具/修改题目数据库.ipynb | 6 +- 工具/批量添加题库字段数据.ipynb | 10 +-- 工具/添加关联题目.ipynb | 151 ++++++++++++++++++++++++++++++++ 工具/添加题目到数据库.ipynb | 13 ++- 工具/讲义生成.ipynb | 16 ++-- 题库0.3/Problems.json | 79 ++++++++++++++--- 6 files changed, 245 insertions(+), 30 deletions(-) create mode 100644 工具/添加关联题目.ipynb diff --git a/工具/修改题目数据库.ipynb b/工具/修改题目数据库.ipynb index aaf278f6..b45991cb 100644 --- a/工具/修改题目数据库.ipynb +++ b/工具/修改题目数据库.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -11,7 +11,7 @@ "0" ] }, - "execution_count": 1, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -19,7 +19,7 @@ "source": [ "import os,re,json\n", "# 这里修改题目id, 可以不满6位\n", - "index = \"2692\".zfill(6)\n", + "index = \"5956\".zfill(6)\n", "with open(r\"../题库0.3/Problems.json\",\"r\",encoding = \"utf8\") as f:\n", " database = f.read()\n", "line = '\"id\": \"'+index+'\",'\n", diff --git a/工具/批量添加题库字段数据.ipynb b/工具/批量添加题库字段数据.ipynb index 48796fff..453fbfe1 100644 --- a/工具/批量添加题库字段数据.ipynb +++ b/工具/批量添加题库字段数据.ipynb @@ -2,15 +2,15 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "题号: 005952 , 字段: objs 中已添加数据: K0305001B\n", - "题号: 005956 , 字段: objs 中已添加数据: K0305001B\n" + "题号: 010220 , 字段: objs 中已添加数据: K0306002B\n", + "题号: 010220 , 字段: objs 中已添加数据: K0307003B\n" ] } ], @@ -62,12 +62,12 @@ " #字符串类型字段添加数据\n", " elif field_type == str and data in pro_dict[id][field]:\n", " print(\"题号:\",id,\", 字段:\",field,\"中已有该数据:\",data)\n", - " elif field_type == str and not data in pro_dict[id][field] and not field == \"ans\":\n", + " elif field_type == str and not data in pro_dict[id][field] and not field == \"ans\" and not field == \"space\":\n", " origin_data = pro_dict[id][field]\n", " new_data = trim(origin_data + \"\\n\" + data)\n", " pro_dict[id][field] = new_data\n", " print(\"题号:\",id,\", 字段:\",field,\"中已添加数据:\",data)\n", - " elif field_type == str and not data in pro_dict[id][field] and field == \"ans\":\n", + " elif field_type == str and not data in pro_dict[id][field] and field == \"ans\" or field == \"space\":\n", " pro_dict[id][field] = data\n", " print(\"题号:\",id,\", 字段:\",field,\"中已修改数据:\",data)\n", " \n", diff --git a/工具/添加关联题目.ipynb b/工具/添加关联题目.ipynb new file mode 100644 index 00000000..5be0d6c8 --- /dev/null +++ b/工具/添加关联题目.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "import os,re,json\n", + "\n", + "\"\"\"---设置原题目id与新题目id---\"\"\"\n", + "old_id = \"1387\"\n", + "new_id = \"30015\"\n", + "\"\"\"---设置完毕---\"\"\"\n", + "\n", + "old_id = old_id.zfill(6)\n", + "new_id = new_id.zfill(6)\n", + "\n", + "with open(r\"../题库0.3/Problems.json\",\"r\",encoding = \"utf8\") as f:\n", + " database = f.read()\n", + "\n", + "pro_dict = json.loads(database)\n", + "if new_id in pro_dict:\n", + " print(\"该ID已被使用.\")\n", + "else:\n", + " pro_dict[new_id] = {}\n", + " for field in pro_dict[old_id]:\n", + " if not field == \"id\":\n", + " pro_dict[new_id][field] = pro_dict[old_id][field] if not type(pro_dict[old_id][field]) == list else pro_dict[old_id][field].copy()\n", + " else:\n", + " pro_dict[new_id][field] = new_id\n", + " pro_dict[new_id][\"related\"].append(old_id)\n", + " pro_dict[old_id][\"related\"].append(new_id)\n", + " with open(r\"../题库0.3/Problems.json\",\"w\",encoding = \"utf8\") as f:\n", + " f.write(json.dumps(pro_dict,indent = 4,ensure_ascii= False))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(pro_dict[old_id][field]) == \"list\"" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [], + "source": [ + "a = [1,2]" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(a) == list" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [], + "source": [ + "a.append(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2]" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "b" + ] + }, + { + "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 +} diff --git a/工具/添加题目到数据库.ipynb b/工具/添加题目到数据库.ipynb index 5296e84e..35d4d3d9 100644 --- a/工具/添加题目到数据库.ipynb +++ b/工具/添加题目到数据库.ipynb @@ -7,14 +7,14 @@ "outputs": [], "source": [ "#修改起始id,出处,文件名\n", - "starting_id = 11988\n", + "starting_id = 30016\n", "origin = \"\"\n", - "filename = \"../临时/test3.tex\"" + "filename = \"临时文件/增加题目.tex\"" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -80,6 +80,13 @@ "with open(r\"../题库0.3/Problems.json\",\"w\",encoding = \"utf8\") as f:\n", " f.write(new_database)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/工具/讲义生成.ipynb b/工具/讲义生成.ipynb index 612e0f2c..bc064619 100644 --- a/工具/讲义生成.ipynb +++ b/工具/讲义生成.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -13,9 +13,9 @@ "题块 1 处理完毕.\n", "正在处理题块 2 .\n", "题块 2 处理完毕.\n", - "开始编译教师版本pdf文件: 临时文件/第一轮讲义12待修改_教师_20220912.tex\n", - "0\n", - "开始编译学生版本pdf文件: 临时文件/第一轮讲义12待修改_学生_20220912.tex\n", + "开始编译教师版本pdf文件: 临时文件/11_三角比的定义及直接性质_教师_20220912.tex\n", + "1\n", + "开始编译学生版本pdf文件: 临时文件/11_三角比的定义及直接性质_学生_20220912.tex\n", "0\n" ] } @@ -34,7 +34,7 @@ "\n", "\"\"\"---设置其他预处理替换命令---\"\"\"\n", "#2023届第一轮讲义更换标题\n", - "exec_list = [(\"标题数字待处理\",\"11\"),(\"标题文字待处理\",\"三角比的定义及直接性质预选\")] \n", + "exec_list = [(\"标题数字待处理\",\"11\"),(\"标题文字待处理\",\"三角比的定义及直接性质\")] \n", "enumi_mode = 0\n", "\n", "#2023届测验卷与周末卷\n", @@ -43,14 +43,14 @@ "\"\"\"---其他预处理替换命令结束---\"\"\"\n", "\n", "\"\"\"---设置目标文件名---\"\"\"\n", - "destination_file = \"临时文件/第一轮讲义12待修改\"\n", + "destination_file = \"临时文件/11_三角比的定义及直接性质\"\n", "\"\"\"---设置目标文件名结束---\"\"\"\n", "\n", "\n", "\"\"\"---设置题号数据---\"\"\"\n", "problems = [\n", - "\"4548,3092,3094,3102,6115,3095,3097,3100,6101,6147,6149,3093,5086,3113,3114,3125,8168,6286\",\n", - "\"6126,6138,6145,3105,3107,6129,6138,6163,6166,6177,8170,6190,6214,8385,6288\"\n", + "\"5902,5899,8107,10222,3959,30015,1389,3063,4492,1399,3064,8144,8226,5952,10231,1412,9561,9562,6468,1586,6594\",\n", + "\"8215,10210,3056,10226,8106,5904,9547,10214,10232,5956,30016,4642,10220,8312,6579,10268\"\n", "]\n", "\"\"\"---设置题号数据结束---\"\"\"\n", "\n", diff --git a/题库0.3/Problems.json b/题库0.3/Problems.json index c672a589..202a199f 100644 --- a/题库0.3/Problems.json +++ b/题库0.3/Problems.json @@ -35105,7 +35105,7 @@ }, "001387": { "id": "001387", - "content": "(1) 半径为$5$, 圆心角为$30^\\circ$的扇形的弧长为\\blank{50}. 半径为$5$, 圆心角为$2$的扇形的弧长为\\blank{50}; 这个扇形的圆心角是\\blank{20}角(填入``锐''或``钝'').\\\\ \n(2) 三点十五分时, 时针和分针的夹角的弧度数为\\blank{50}.\\\\ \n(3) 设三角形的三个内角之比为$1:2:3$, 则这个三角形的最大内角为\\blank{50}弧度.", + "content": "(1) 半径为$5$, 圆心角为$30^\\circ$的扇形的弧长为\\blank{50}.\\\\ \n 半径为$5$, 圆心角为$2$的扇形的弧长为\\blank{50}, 这个扇形的圆心角是\\blank{20}角(填入``锐''或``钝'').\\\\ \n(2) 三点十五分时, 时针和分针的夹角的弧度数为\\blank{50}.\\\\ \n(3) 设三角形的三个内角之比为$1:2:3$, 则这个三角形的最大内角为\\blank{50}弧度.", "objs": [ "K0302001B", "K0302002B" @@ -35126,7 +35126,9 @@ "20220625\t王伟叶" ], "same": [], - "related": [], + "related": [ + "030015" + ], "remark": "", "space": "" }, @@ -35158,7 +35160,7 @@ }, "001389": { "id": "001389", - "content": "已知一扇形的周长为$20$, 当扇形的中心角为多大时, 它有最大的面积?", + "content": "已知一扇形的周长为$20$, 当扇形的圆心角为多大时, 它有最大的面积?", "objs": [ "K0302002B" ], @@ -141302,7 +141304,7 @@ }, "005899": { "id": "005899", - "content": "下列四个命题中, 正确的是\\bracket{20}.\n\\onech{终边相同的角的三角函数值相等}{$\\{\\alpha|\\alpha =k\\pi +\\dfrac{\\pi}6,\\ k\\in \\mathbf{Z}\\}\\ne \\{\\beta|\\beta =-k\\pi +\\dfrac{\\pi}6,\\ k\\in \\mathbf{Z}\\}$}{若$\\alpha$是第二象限角, 则$\\sin 2\\alpha <0$}{第四象限的角可表示为$\\{\\alpha|2k\\pi +\\dfrac 32\\pi <\\alpha <2k\\pi ,\\ k\\in \\mathbf{Z}\\}$}", + "content": "下列四个命题中, 正确的是\\bracket{20}.\n\\onech{始边重合, 终边不同的角的三角函数值都不相等}{$\\{\\alpha|\\alpha =k\\pi +\\dfrac{\\pi}6,\\ k\\in \\mathbf{Z}\\}\\ne \\{\\beta|\\beta =-k\\pi +\\dfrac{\\pi}6,\\ k\\in \\mathbf{Z}\\}$}{若$\\alpha$是第二象限角, 则$\\sin 2\\alpha <0$}{第四象限的角可表示为$\\{\\alpha|2k\\pi +\\dfrac 32\\pi <\\alpha <2k\\pi ,\\ k\\in \\mathbf{Z}\\}$}", "objs": [ "K0301002B", "K0303002B" @@ -142555,7 +142557,7 @@ }, "005956": { "id": "005956", - "content": "利用``$1$''的代换证明: $\\tan \\alpha \\cdot \\dfrac{1-\\sin \\alpha}{1+\\cos \\alpha}=\\cot \\alpha \\cdot \\dfrac{1-\\cos \\alpha}{1+\\sin \\alpha}$.", + "content": "证明: $\\tan \\alpha \\cdot \\dfrac{1-\\sin \\alpha}{1+\\cos \\alpha}=\\cot \\alpha \\cdot \\dfrac{1-\\cos \\alpha}{1+\\sin \\alpha}$.", "objs": [ "K0305001B" ], @@ -153541,7 +153543,7 @@ "same": [], "related": [], "remark": "", - "space": "12ex" + "space": "6ex" }, "006469": { "id": "006469", @@ -189396,7 +189398,7 @@ ], "related": [], "remark": "", - "space": "12ex" + "space": "6ex" }, "008107": { "id": "008107", @@ -189420,7 +189422,7 @@ "same": [], "related": [], "remark": "", - "space": "12ex" + "space": "6ex" }, "008108": { "id": "008108", @@ -235270,7 +235272,7 @@ "same": [], "related": [], "remark": "", - "space": "12ex" + "space": "" }, "010211": { "id": "010211", @@ -235478,7 +235480,10 @@ "010220": { "id": "010220", "content": "化简下列各式:\\\\\n(1) $\\cos (90^\\circ +\\alpha)+\\sin (180^\\circ -\\alpha)-\\sin (180^\\circ +\\alpha)+\\sin (-\\alpha)$;\\\\\n(2) $\\dfrac{\\sin (\\pi -\\alpha)}{\\tan (\\pi +\\alpha)}\\cdot \\dfrac{\\cot (\\dfrac\\pi 2-\\alpha)}{\\tan (\\dfrac \\pi 2+\\alpha)}\\cdot \\dfrac{\\cos (-\\alpha)}{\\sin (2\\pi-\\alpha)}$;\\\\\n(3) $\\dfrac{\\sin (\\alpha-\\pi)\\cot (\\alpha-2\\pi )}{\\cos (\\alpha-\\pi )\\tan (\\alpha-2\\pi)}$;\\\\\n(4) $\\dfrac{\\tan (\\pi +\\alpha)\\cos (-\\pi )\\cos (2\\pi -\\alpha)}{\\cot (\\pi -\\alpha)\\sin (3\\pi+\\alpha)}$.", - "objs": [], + "objs": [ + "K0306002B", + "K0307003B" + ], "tags": [ "第三单元" ], @@ -235541,7 +235546,7 @@ "same": [], "related": [], "remark": "", - "space": "12ex" + "space": "6ex" }, "010223": { "id": "010223", @@ -279236,5 +279241,57 @@ "related": [], "remark": "", "space": "" + }, + "030015": { + "id": "030015", + "content": "(1) 半径为$5$, 圆心角为$30^\\circ$的扇形的弧长为\\blank{50}.\\\\ \n 半径为$5$, 圆心角为$2$的扇形的弧长为\\blank{50}, 这个扇形的圆心角是\\blank{20}角(填入``锐''或``钝'').\\\\ \n(2) 三点十五分时, 时针和分针的夹角的弧度数为\\blank{50}.", + "objs": [ + "K0302001B", + "K0302002B" + ], + "tags": [ + "第三单元" + ], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [ + "2016届11班\t0.974\t0.821", + "2016届12班\t0.895\t0.947" + ], + "origin": "2016届创新班作业\t2104-弧度制与任意角[1]_20220912修改", + "edit": [ + "20220912\t王伟叶\t朱敏慧" + ], + "same": [], + "related": [ + "001387" + ], + "remark": "", + "space": "" + }, + "030016": { + "id": "030016", + "content": "证明: $\\dfrac{\\sin^2\\alpha-\\sin^2\\beta}{\\tan^2\\alpha-\\tan^2\\beta}=\\cos^2\\alpha\\cos^2\\beta$.", + "objs": [ + "K0305001B" + ], + "tags": [ + "第三单元" + ], + "genre": "解答题", + "ans": "证明略", + "solution": "", + "duration": -1, + "usages": [], + "origin": "心教材必修第二册教材例题", + "edit": [ + "20220912\t王伟叶\t朱敏慧" + ], + "same": [], + "related": [], + "remark": "", + "space": "12ex" } } \ No newline at end of file