diff --git a/工具/工具面板.py b/工具/工具面板.py index 2fc7352a..c948ae24 100644 --- a/工具/工具面板.py +++ b/工具/工具面板.py @@ -39,7 +39,9 @@ def run_command1(): call(["python","../文本处理工具/剪贴板文本整理_mathpix.py"]) elif selectedtool == "带圈数字处理": call(["python","../文本处理工具/带圈数字处理.py"]) - LabelTool.config(text = "STEP1命令执行完毕") + elif selectedtool == "试卷答案生成": + call(["python","试卷答案生成.py"]) + LabelTool.config(text = selectedtool+" STEP1命令执行完毕") def run_command2(): selectedtool = commandname.get() @@ -47,11 +49,11 @@ def run_command2(): call(["python","导入关联题目.py"]) elif selectedtool == "修改题目数据库": call(["python","修改结果汇入.py"]) - LabelTool.config(text = "STEP2命令执行完毕") + LabelTool.config(text = selectedtool+ "STEP2命令执行完毕") commandname = StringVar() commandname.set("none") -LabelTool = Label(root, text = "工具选择待定", height = 1, width = 25, anchor=W) +LabelTool = Label(root, text = "工具选择待定", height = 1, width = 40, anchor=W) LabelTool.place(x=420,y=50) button1 = Button(root, text = "运行STEP1", command = run_command1) @@ -77,6 +79,8 @@ MaintainenceMenu.add_command(label = "修改题目", command = lambda: SetButton UseMenu = Menu(menubar, tearoff = False) menubar.add_cascade(label = "使用", menu = UseMenu) UseMenu.add_command(label = "题号选题pdf生成", command = lambda: SetButton("题号选题pdf生成",1,["题号选题pdf生成.py"])) +UseMenu.add_command(label = "试卷答案生成", command = lambda: SetButton("试卷答案生成",1,["试卷答案生成.py"])) + # 设置 其他 菜单项 OtherMenu = Menu(menubar, tearoff = False) diff --git a/工具/批量收录题目.py b/工具/批量收录题目.py index 05c77bff..d2677aee 100644 --- a/工具/批量收录题目.py +++ b/工具/批量收录题目.py @@ -1,7 +1,7 @@ #修改起始id,出处,文件名 -starting_id = 40413 +starting_id = 40414 raworigin = "" -filename = r"C:\Users\weiye\Downloads\test.tex" +filename = r"D:\temp\test.tex" editor = "20230330\t王伟叶" indexed = False diff --git a/工具/批量题号选题pdf生成.ipynb b/工具/批量题号选题pdf生成.ipynb index e5061b9e..c369327f 100644 --- a/工具/批量题号选题pdf生成.ipynb +++ b/工具/批量题号选题pdf生成.ipynb @@ -9,9 +9,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "开始编译教师版本pdf文件: 临时文件/高三二模前易错题_教师用_20230330.tex\n", + "开始编译教师版本pdf文件: 临时文件/2022学年下学期高一高二材料_教师用_20230330.tex\n", "0\n", - "开始编译学生版本pdf文件: 临时文件/高三二模前易错题_学生用_20230330.tex\n", + "开始编译学生版本pdf文件: 临时文件/2022学年下学期高一高二材料_学生用_20230330.tex\n", "0\n" ] } @@ -28,51 +28,47 @@ "\n", "\"\"\"---设置题目列表---\"\"\"\n", "#字典字段为文件名, 之后为内容的题号\n", - "problems_dict = {\n", - "\"函数易错题\":\"000060,000087,000092,000342,000361,000655,000734,000778,000795,001211,001218,001221,001227,001253,001262,001270,001277,001287,001308,001309,001312,001325,001328,001329,001339,001340,001343,001352,002831,002838,002851,002856,002859,002888,002894,002895,002898,002905,002918,002959,002966,002968,002975,003013,003648,003747,003828,003884,004009,004067,004089,004116,004153,004157,004217,004224,004247,004256,004265,004320,004359,004370,004424,004435,004440,004444,004457,004463,004464,004466,004486,004509,004636,004702,004721,004763,005016,005086,005123,005569,005592,005650,005678,007939,007950,009488,009517,009522,009922,010196,010197,010796,010797,010807,010813,010933,010938,010943,010953,010955,011060,011066,011067,011079,011081,011087,011131,011143,011144,011148,011152,011153,011218,011999,012023,012063,012064,012074,012092,012104,012114,012116,012172,012178,012179,012181,012192,012235,012242,012277,012536,012543,012549,012612,012717,012733,012738,012764,012796,012830,012839,012842,012843,012848,012851,012855,012856,012859,012872,012891,012892,012893,012901,012902,012903,012912,012913,012915,013721,013747,013750,013800,013840,013841,013842,013844,014170,014180,014190,014191,014192,014203,014262,021428,021429,030041,030043,030046,030047,030048,030050,030051,030060,030103,030291,030321,030327,030337,030343,030356,030369,030374,030377,030381,030382,030388,030391,030398,030402,030406,030410,030411,030416,030420,030424,030426,030438,030439,030446,030504,030691,031215,031219,031220,031221,031236,031241,031321,031331,031355,031356\",\n", - "\"数列易错题\":\"000320,000321,000322,000403,001741,001769,001781,001783,001788,001809,001810,001839,003210,003219,003239,003253,003281,003283,003298,003309,003310,003312,004128,004352,004472,004476,006717,006760,006793,006911,008456,010773,010777,010787,010942,010964,011059,011090,011109,011388,012067,012073,012094,012112,012116,012181,012202,012220,012239,012540,012547,012715,012729,012735,012920,012933,012965,012969,012972,012979,013007,013921,013925,014092,014532,014538,030072,030281,030426,030473,030478,030496,030499,030502\",\n", - "\"解析几何易错题\":\"000248,000267,000271,000274,000282,000337,000360,000363,000464,000493,000501,000625,000669,000804,000960,002141,002162,002183,002252,002262,002268,002270,002278,002314,002329,002342,002372,002391,002403,002418,002426,002434,002435,003421,003431,003437,003438,003629,003893,004213,004246,004504,004550,008757,008760,008854,008865,008866,008873,008912,008937,008952,008956,009784,009823,010630,010631,010673,010951,010958,010963,011099,011106,011110,011450,012115,012180,012193,012197,012199,012200,012213,012218,012243,012255,012263,012276,012548,012716,012728,012730,012737,012915,013058,013060,013063,013066,013069,013073,013077,013081,013090,013096,013097,013099,013101,013112,013114,013118,013128,013130,013134,013139,013841,013903,013970,013974,013976,013981,013982,013988,013990,013992,013999,014019,014020,014364,014366,014478,014503,014505,030026,030484,030501,031228,031229,031231,031233,031317,031322,031323,031330\",\n", - "\"概率统计易错题\":\"000219,000223,000230,000233,000332,000340,000345,000359,000373,000401,000412,000462,000491,000654,000704,002537,002563,002586,002602,002605,002662,002664,003567,003574,003581,003585,003640,003666,004030,004068,004257,004499,004575,004578,004584,004586,004590,004595,004598,004599,004600,004601,004607,004611,004616,004617,004618,007361,007423,007432,007455,007476,007502,007506,007527,007528,007535,007539,007630,007631,007641,007643,007660,007673,009355,009357,009744,009745,010011,010013,010540,010554,010558,010868,010905,010918,010922,010929,010950,011137,011229,011993,012105,012254,012705,013221,013232,013711,014070,014079,014080,014087,014091,014096,030187,030188,030189,030191,030193,030194,030196,030209,030227,030253,030261,030268,030270,030275,030495,030499,030520,030524,030525,030530,030531,030532,030535,030538,030540,030552,030579,030580,030582,030588,030593,031158,031160,031163,031196,031201,031202,031203,031237,031238,031320,031328\"\n", - "}\n", - "# problems_dict = {\n", - "# \"2024届高二下学期周末卷01\":\"40001:40017\",\n", - "# \"2025届高一下学期周末卷01\":\"40018:40036\",\n", - "# \"2024届高二下学期周末卷02\":\"40037:40056\",\n", - "# \"2025届高一下学期周末卷02\":\"40057:40082\",\n", - "# \"2025届高一下学期周末卷03\":\"40083:40104\",\n", - "# \"2025届高一下学期周末卷03小测\":\"40105:40112\",\n", - "# \"2025届高一下学期周末卷04旧版\":\"40113:40130\",\n", - "# \"2025届高一下学期周末卷04小测\":\"40131:40139\",\n", - "# \"2024届高二下学期周末卷03\":\"40140:40160\",\n", - "# \"2024届高二上学期期末考试\":\"31267:31287\",\n", - "# \"2025届高一上学期期末考试\":\"31288:31308\",\n", - "# \"2024届高二下学期周末卷04\":\"40161:40180\",\n", - "# \"2025届高一下学期周末卷04\":\"40181:40201\",\n", - "# \"2024届高二下学期周末卷05\":\"40202:40225\",\n", - "# \"2025届高一下学期周末卷05\":\"40226:40245\",\n", - "# \"2024届空间向量校本作业\":\"22048:22083\",\n", - "# \"2024届二项式定理校本作业\":\"22084:22105\",\n", - "# \"2025届高一下学期周末卷05小测\":\"40246:40255\",\n", - "# \"2025届高一下学期周末卷06\":\"40256:40273\",\n", - "# \"2025届高一下学期周末卷06小测\":\"40274:40282\",\n", - "# \"2025届高一下学期期中复习一(集合逻辑不等式)\":\"40283:40298\",\n", - "# \"2024届高二下学期周末卷06\":\"40299:40316\",\n", - "# \"2024届高二下学期周末卷07\":\"40317:40335\",\n", - "# \"2025届高一下学期测验01\":\"40336:40349\",\n", - "# \"2025届高一下学期测验02\":\"40350:40367\",\n", - "# \"2025届高一下学期期中复习二(幂指对函数)\":\"40368:40386\",\n", - "# \"2025届高一下学期周末卷02小测\":\"40387:40395\",\n", - "# \"2025届高一下学期周末卷07\":\"40396:40413\"\n", "\n", - "# }\n", + "problems_dict = {\n", + "\"2024届高二下学期周末卷01\":\"40001:40017\",\n", + "\"2025届高一下学期周末卷01\":\"40018:40036\",\n", + "\"2024届高二下学期周末卷02\":\"40037:40056\",\n", + "\"2025届高一下学期周末卷02\":\"40057:40082\",\n", + "\"2025届高一下学期周末卷03\":\"40083:40104\",\n", + "\"2025届高一下学期周末卷03小测\":\"40105:40112\",\n", + "\"2025届高一下学期周末卷04旧版\":\"40113:40130\",\n", + "\"2025届高一下学期周末卷04小测\":\"40131:40139\",\n", + "\"2024届高二下学期周末卷03\":\"40140:40160\",\n", + "\"2024届高二上学期期末考试\":\"31267:31287\",\n", + "\"2025届高一上学期期末考试\":\"31288:31308\",\n", + "\"2024届高二下学期周末卷04\":\"40161:40180\",\n", + "\"2025届高一下学期周末卷04\":\"40181:40201\",\n", + "\"2024届高二下学期周末卷05\":\"40202:40225\",\n", + "\"2025届高一下学期周末卷05\":\"40226:40245\",\n", + "\"2024届空间向量校本作业\":\"22048:22083\",\n", + "\"2024届二项式定理校本作业\":\"22084:22105\",\n", + "\"2025届高一下学期周末卷05小测\":\"40246:40255\",\n", + "\"2025届高一下学期周末卷06\":\"40256:40273\",\n", + "\"2025届高一下学期周末卷06小测\":\"40274:40282\",\n", + "\"2025届高一下学期期中复习一(集合逻辑不等式)\":\"40283:40298\",\n", + "\"2024届高二下学期周末卷06\":\"40299:40316\",\n", + "\"2024届高二下学期周末卷07\":\"40317:40335\",\n", + "\"2025届高一下学期测验01\":\"40336:40349\",\n", + "\"2025届高一下学期测验02\":\"40350:40367\",\n", + "\"2025届高一下学期期中复习二(幂指对函数)\":\"40368:40386\",\n", + "\"2025届高一下学期周末卷02小测\":\"40387:40395\",\n", + "\"2025届高一下学期周末卷07\":\"40396:40413\",\n", + "\"2025届高一下学期周末卷07小测\":\"40414:40421\"\n", + "\n", + "}\n", "\n", "\"\"\"---设置题目列表结束---\"\"\"\n", "\n", "\"\"\"---设置文件保存路径---\"\"\"\n", "#目录和文件的分隔务必用/\n", "directory = \"临时文件/\"\n", - "filename = \"高三二模前易错题\"\n", - "# filename = \"2022学年下学期高一高二材料\"\n", + "# filename = \"高三二模前易错题\"\n", + "filename = \"2022学年下学期高一高二材料\"\n", "\"\"\"---设置文件名结束---\"\"\"\n", "if directory[-1] != \"/\":\n", " directory += \"/\"\n", diff --git a/工具/模板文件/试卷答案模板.txt b/工具/模板文件/试卷答案模板.txt new file mode 100644 index 00000000..6115a9d6 --- /dev/null +++ b/工具/模板文件/试卷答案模板.txt @@ -0,0 +1,77 @@ +\documentclass[10pt,a4paper,twoside]{article} +\usepackage[UTF8, fontset = none, heading = true]{ctex} +\setCJKmainfont[BoldFont=黑体,ItalicFont=楷体]{华文中宋} +\usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs,dsfont,graphicx} +\usepackage{ifthen,indentfirst,enumerate,color,lastpage} +\usepackage{tikz} +\usepackage{multicol} +\usepackage{multirow} +\usepackage{makecell} +\usepackage{longtable} +\usepackage{diagbox} +\usepackage{hyperref} +\usepackage[top=1in, bottom=1in,left=0.8in,right=0.8in]{geometry} +\usepackage{fancyhdr} +\fancyhf{} +\fancyhead[LO]{} +\chead{} +\rhead{--\ \thepage\ of \pageref{LastPage} \ --} +\pagestyle{fancy} +\ctexset{section={ +name={}, +number=\chinese{section}, +}} +\CTEXsetup[format={\bfseries\raggedright}]{section} +\usetikzlibrary{arrows,calc,intersections,patterns,decorations.pathreplacing,3d,angles,quotes,positioning,shapes.geometric} + +\renewcommand{\baselinestretch}{1.5} +\newtheorem{defi}{定义~} +\newtheorem{eg}{例~} +\newtheorem{ex}{~} +\newtheorem{rem}{注~} +\newtheorem{thm}{定理~} +\newtheorem{coro}{推论~} +\newtheorem{axiom}{公理~} +\newtheorem{prop}{性质~} +\newcommand{\blank}[1]{\underline{\hbox to #1pt{}}} +\newcommand{\bracket}[1]{(\hbox to #1pt{})} +\newcommand{\onech}[4]{\par\begin{tabular}{p{.9\linewidth}} +A.~#1\\ +B.~#2\\ +C.~#3\\ +D.~#4 +\end{tabular}} +\newcommand{\twoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.46\linewidth}} +A.~#1& B.~#2\\ +C.~#3& D.~#4 +\end{tabular}} +\newcommand{\vartwoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.46\linewidth}} +(1)~#1& (2)~#2\\ +(3)~#3& (4)~#4 +\end{tabular}} +\newcommand{\fourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}} +A.~#1 &B.~#2& C.~#3& D.~#4 +\end{tabular}} +\newcommand{\varfourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}} +(1)~#1 &(2)~#2& (3)~#3& (4)~#4 +\end{tabular}} + + +% 修改标题处 +\newcommand{\notestitle}{标题文字待处理} + +\begin{document} +\begin{center} +{\bf\large \notestitle} +\end{center} + +\tableofcontents +\newpage + +内容待替换 + + + + + +\end{document} \ No newline at end of file diff --git a/工具/试卷答案生成.ipynb b/工具/试卷答案生成.ipynb index a1cc9de2..ab6c71a4 100644 --- a/工具/试卷答案生成.ipynb +++ b/工具/试卷答案生成.ipynb @@ -2,92 +2,87 @@ "cells": [ { "cell_type": "code", - "execution_count": 3, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "正在生成: 01_集合与逻辑答案\n", - "0\n", - "正在生成: 02_等式与不等式答案\n", - "0\n", - "正在生成: 03_幂指对函数答案\n", - "0\n", - "正在生成: 04_函数的概念与性质答案\n", - "0\n", - "正在生成: 05_函数综合答案\n", - "0\n", - "正在生成: 06_三角与解三角形答案\n", - "0\n", - "正在生成: 07_三角函数答案\n", - "0\n", - "正在生成: 08_平面向量与复数答案\n", - "0\n", - "正在生成: 09_立体几何综合答案\n", - "0\n", - "正在生成: 10_空间向量与应用答案\n" + "正在生成: 周末卷01答案\n", + "正在生成: 周末卷02答案\n", + "正在生成: 周末卷03答案\n", + "正在生成: 周末卷03_暂未使用答案\n", + "正在生成: 周末卷04答案\n", + "正在生成: 周末卷05答案\n", + "正在生成: 周末卷06答案\n", + "正在生成: 周末卷07答案\n", + "正在生成: 周末卷08答案\n", + "正在生成: 周末卷09答案\n", + "正在生成: 周末卷10答案\n", + "正在生成: 周末卷11答案\n", + "正在生成: 周末卷12答案\n", + "正在生成: 周末卷13答案\n", + "正在生成: 周末卷14答案\n", + "正在生成: 国庆卷答案\n", + "编译 临时文件/23届高三上学期周末卷参考答案.tex 中\n", + "0\n" ] } ], "source": [ - "import os,re,json\n", + "import os,re,json,zipfile\n", "\n", - "# filename = r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\09_立体几何综合.tex\"\n", - "filelist = ['C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\01_集合与逻辑.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\02_等式与不等式.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\03_幂指对函数.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\04_函数的概念与性质.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\05_函数综合.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\06_三角与解三角形.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\07_三角函数.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\08_平面向量与复数.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\09_立体几何综合.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\10_空间向量与应用.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\11_直线与圆.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\12_圆锥曲线.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\13_解析几何综合.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\14_等差数列和等比数列.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\15_数列综合.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\16_导数及其应用.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\17_计数原理与二项式定理.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\18_概率与统计.tex',\n", - " 'C:\\\\Users\\\\weiye\\\\Documents\\\\wwy sync\\\\23届\\\\第二轮复习讲义\\\\19_统计.tex']\n", - "pdf_dir = \"临时文件\"\n", + "file_dir = r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\"\n", + "filelist = []\n", + "output_gloss_filename = \"23届高三上学期周末卷参考答案\"\n", + "\n", + "if len(filelist) == 0:\n", + " filelist = [f for f in os.listdir(file_dir) if \".tex\" in f]\n", + "\n", + "\n", + "\n", + "with open(\"../题库0.3/Problems.json\",\"r\",encoding = \"u8\") as f:\n", + " pro_dict = json.loads(f.read())\n", + "\n", + "output_data = \"\"\n", "\n", "for filename in filelist:\n", " outfilename = os.path.split(filename)[1][:-4]+\"答案\"\n", - " print(\"正在生成: \",outfilename)\n", - " with open(filename,\"r\",encoding = \"u8\") as f:\n", + " with open(os.path.join(file_dir,filename),\"r\",encoding = \"u8\") as f:\n", " data = f.read()\n", - " with open(\"../题库0.3/Problems.json\",\"r\",encoding = \"u8\") as f:\n", - " pro_dict = json.loads(f.read())\n", "\n", " ids = re.findall(r\"\\((\\d{6})\\)\",data)\n", + " if len(ids) > 0:\n", + " print(\"正在生成: \",outfilename)\n", + " output_data += (\"\\n\\n\"+r\"\\section{\"+outfilename.replace(\"_\",\"-\")+\"}\\n\\n\")\n", + " output_data += (\"\\n\\n\"+r\"\\begin{enumerate}\"+\"\\n\\n\")\n", + " for id in ids:\n", + " problemset = pro_dict[id]\n", + " content = problemset[\"content\"]\n", + " solution = problemset[\"solution\"]\n", + " answer = \"\\\\textcolor{red}{\" + (problemset[\"ans\"] if problemset[\"ans\"] != \"\" else \"\\\\textcolor{blue}{暂无答案}\") + \"}\"\n", + " output_data += \"\\\\item \" + \"(\"+id+\") \" + content + \"\\n\\n\" + \"答案: \" + answer + \"\\n\\n\" \n", + " output_data += (\"\\n\\n\"+r\"\\end{enumerate}\"+\"\\n\\\\newpage\\n\\n\")\n", "\n", - " output_data = \"\"\n", - " for id in ids:\n", - " problemset = pro_dict[id]\n", - " content = problemset[\"content\"]\n", - " solution = problemset[\"solution\"]\n", - " answer = \"\\\\textcolor{red}{\" + (problemset[\"ans\"] if problemset[\"ans\"] != \"\" else \"\\\\textcolor{blue}{暂无答案}\") + \"}\"\n", - " output_data += \"\\\\item \" + \"(\"+id+\") \" + content + \"\\n\\n\" + \"答案: \" + answer + \"\\n\\n\" \n", + "with open(\"模板文件/试卷答案模板.txt\",\"r\",encoding = \"u8\") as f:\n", + " outlatex = f.read()\n", "\n", - " with open(\"模板文件/日常选题讲义模板.txt\",\"r\",encoding = \"u8\") as f:\n", - " outlatex = f.read()\n", + "outlatex = outlatex.replace(\"内容待替换\",output_data)\n", + "outlatex = outlatex.replace(\"标题文字待处理\",output_gloss_filename.replace(\"_\",\"-\"))\n", "\n", - " outlatex = outlatex.replace(\"待替换1\",output_data)\n", - " outlatex = outlatex.replace(\"标题文字待处理\",outfilename.replace(\"_\",\"-\"))\n", + "outfile = os.path.join(\"临时文件\",output_gloss_filename+\".tex\")\n", + "with open(outfile,\"w\",encoding=\"u8\") as f:\n", + " f.write(outlatex)\n", + "\n", + "outfile = outfile.replace(\"\\\\\",\"/\")\n", + "\n", + "print(\"编译 \"+outfile+\" 中\")\n", + "os.system(\"xelatex -interaction=batchmode -output-directory=临时文件 \" + outfile)\n", + "print(os.system(\"xelatex -interaction=batchmode -output-directory=临时文件 \" + outfile))\n", "\n", - " outfile = os.path.join(\"临时文件\",outfilename+\".tex\")\n", - " with open(outfile,\"w\",encoding=\"u8\") as f:\n", - " f.write(outlatex)\n", "\n", - " outfile = outfile.replace(\"\\\\\",\"/\")\n", "\n", - " os.system(\"xelatex -interaction=batchmode -output-directory=\" + pdf_dir + \" \"+ outfile)\n", - " print(os.system(\"xelatex -interaction=batchmode -output-directory=\" + pdf_dir + \" \"+ outfile))\n", "\n", " " ] @@ -116,7 +111,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.15" + "version": "3.9.15" }, "orig_nbformat": 4, "vscode": { diff --git a/工具/试卷答案生成.py b/工具/试卷答案生成.py new file mode 100644 index 00000000..c36ab690 --- /dev/null +++ b/工具/试卷答案生成.py @@ -0,0 +1,55 @@ +file_dir = r"C:\Users\weiye\Documents\wwy sync\23届\上学期周末卷" +filelist = [] #列表为空默认处理所有讲义 +output_gloss_filename = "23届高三上学期周末卷参考答案" + +import os,re,json + + +if len(filelist) == 0: + filelist = [f for f in os.listdir(file_dir) if ".tex" in f] + + + +with open("../题库0.3/Problems.json","r",encoding = "u8") as f: + pro_dict = json.loads(f.read()) + +output_data = "" + +for filename in filelist: + outfilename = os.path.split(filename)[1][:-4]+"答案" + with open(os.path.join(file_dir,filename),"r",encoding = "u8") as f: + data = f.read() + + ids = re.findall(r"\((\d{6})\)",data) + if len(ids) > 0: + print("正在生成: ",outfilename) + output_data += ("\n\n"+r"\section{"+outfilename.replace("_","-")+"}\n\n") + output_data += ("\n\n"+r"\begin{enumerate}"+"\n\n") + for id in ids: + problemset = pro_dict[id] + content = problemset["content"] + solution = problemset["solution"] + answer = "\\textcolor{red}{" + (problemset["ans"] if problemset["ans"] != "" else "\\textcolor{blue}{暂无答案}") + "}" + output_data += "\\item " + "("+id+") " + content + "\n\n" + "答案: " + answer + "\n\n" + output_data += ("\n\n"+r"\end{enumerate}"+"\n\\newpage\n\n") + +with open("模板文件/试卷答案模板.txt","r",encoding = "u8") as f: + outlatex = f.read() + +outlatex = outlatex.replace("内容待替换",output_data) +outlatex = outlatex.replace("标题文字待处理",output_gloss_filename.replace("_","-")) + +outfile = os.path.join("临时文件",output_gloss_filename+".tex") +with open(outfile,"w",encoding="u8") as f: + f.write(outlatex) + +outfile = outfile.replace("\\","/") + +print("编译 "+outfile+" 中") +os.system("xelatex -interaction=batchmode -output-directory=临时文件 " + outfile) +print(os.system("xelatex -interaction=batchmode -output-directory=临时文件 " + outfile)) + + + + + \ No newline at end of file diff --git a/文档/新人加入流程.md b/文档/新人加入流程.md new file mode 100644 index 00000000..e6c5ada4 --- /dev/null +++ b/文档/新人加入流程.md @@ -0,0 +1,72 @@ +# 新组员环境配置流程 + +## 软件准备(以win10以上windows环境为例) + +1. `git`: `https://www.git-scm.com/` +2. `texlive`: `https://tug.org/texlive/` +3. `vscode`: `https://code.visualstudio.com/` +4. `python`环境: `https://www.anaconda.com/` + +## 软件安装 + +以上四个软件可以按任意顺序安装, 其中`git`, `vscode`安装时间较短, `anaconda`安装时间稍长, `texlive`安装时间最长. + +所有的四个软件全部按照默认选项一路Next即可. + +## 环境配置 + +### 确定自己在Gitlabtest项目里 + +在浏览器里输入`http://wwylss.asuscomm.com:30000/wangweiye/gitlabtest`, 登录(记得邮箱)后如果能打开, 就是在项目里, 否则请及时联系管理员(王伟叶) + +### git环境配置 + +1. 新建一个要用来工作的文件夹, 建议用某盘根目录下的`test01`文件夹. +2. 在该文件夹中按鼠标右键, 选择`Git Bash Here`, 将弹出一个`git`的终端. +3. 在终端中分两行输入以下代码("Your Name"随便起, "Your Email"就是上一步的那个登录用的邮箱, 输入的时候都**不要带双引号**. + +`git config --global user.name "Your Name"` + +`git config --global user.email "Your Email"` + +#### 获得rsa公钥 + +为了以后能用`vscode`不用每次输入密码登录服务器进行同步, 继续在刚才的终端中执行以下两行命令(这里的"comment"可以是前面的那个Email, 也可以是别的标识): +1. `ssh-keygen -t rsa -b 2048 -C "comment"` +2. 不断回车, 选择默认选项. +3. `cat ~/.ssh/id_rsa.pub | clip` + +#### 在服务器上粘贴公钥 + +1. 登录`http://wwylss.asuscomm.com:30000`(如果是按顺序操作的话现在应该已经登录了) +2. 点击右上角的头像, 在弹出下拉列表中选择"Preferences". +3. 在左侧的列表中选择"SSH密钥". +4. 在"密钥(Key)"下的大型矩形框中按`ctrl-v`, 将上一步复制得到的公钥内容粘贴到框里. +5. 点击"添加密钥(Add key)". + +### 开荒vscode + +1. 打开`vscode`(稍等一会儿, 如果右下角跳出中文提示的话可以确认, 之后自动重启`vscode`后菜单会变成中文的). +2. 按`ctrl-shift-x`键, 在左边的"扩展"栏第一行输入`latex workshop`并安装使用人数最多的一个. +3. 按`ctrl-shift-x`键, 在左边的"扩展"栏第一行输入`python`并安装使用人数最多的一个. +4. 安装完毕以后按`ctrl-shift-p`键, 在上方出现的框里输入`jupyter`, 选择`Create: New Jupyter Notebook` +5. 在界面上的第一个输入栏中输入`print(2 ** 16)`, 然后按`ctrl-enter`, 看看得到了什么. + + +### 设置和服务器测试项目的同步 +1. 在文件(File)菜单中选择"打开文件夹", 选择刚才新建的那个空文件夹, 并点击"信任作者". +2. 点击左侧图标的第三个(`git`), 并选择"初始化仓库". +3. 选择菜单中的"查看"-"终端". +4. 在下方的终端中输入`git remote add origin ssh://git@wwylss.asuscomm.com:30001/wangweiye/gitlabtest.git`(一行)并回车, 如果有提示的话输入yes. +5. 随后在终端中输入`git pull origin master`, 随后输入"yes"(以后同步就不用输入了). +6. 点击左侧图标栏的第一个, 不出意外的话, 现在空文件夹已经不空了, 随便编辑一个文件试试. +7. 编辑完成后保存, 这时第三个图标下会有个小蓝圈, 点击第三个图标, 在"更改"下面的文件旁按"+"符号进行暂存. +8. 所有更改的文件都到"暂存的更改"中之后在上方的"消息"中输入任意文字后按"提交"按钮. +9. "提交"按钮变成了"发布Branch", 按"发布Branch"按钮. +10. 这时刷新浏览器上的`gitlab`页面, 看一下文件是不是真的已经修改过了. +11. 以后用7-9的操作后"发布Branch"按钮会被"同步"按钮替代. +12. 可以自由地作一些测试. + +## 和正式项目同步(待续) + +## 具体配置LaTeX环境和Python环境(待续) \ No newline at end of file diff --git a/题库0.3/Problems.json b/题库0.3/Problems.json index 7ab7b090..39b82365 100644 --- a/题库0.3/Problems.json +++ b/题库0.3/Problems.json @@ -456059,5 +456059,157 @@ "related": [], "remark": "", "space": "" + }, + "040414": { + "id": "040414", + "content": "正弦曲线与余弦曲线在区间$[0,2 \\pi]$内的交点的个数是\\blank{50}.", + "objs": [], + "tags": [], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040415": { + "id": "040415", + "content": "函数$f(x)=\\cos (\\pi x)$的单调递增区间是\\blank{50}.", + "objs": [], + "tags": [], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040416": { + "id": "040416", + "content": "函数$y=2 \\cos ^2(2 x+\\dfrac{\\pi}{3})$的最小正周期是\\blank{50}.", + "objs": [], + "tags": [], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040417": { + "id": "040417", + "content": "函数$y=\\sin (2 x-\\dfrac{\\pi}{4})$, $x \\in[0, \\pi]$的单增区间是\\blank{50}.", + "objs": [], + "tags": [], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040418": { + "id": "040418", + "content": "若函数$y=\\sin (2 x+\\varphi)$, $|\\varphi|<\\pi$是偶函数, 则$\\varphi=$\\blank{50}.", + "objs": [], + "tags": [], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040419": { + "id": "040419", + "content": "把函数$y=\\sin (2 x+\\dfrac{\\pi}{4})$的图像向右平移$\\dfrac{\\pi}{8}$个单位, 再把所得图像上各点的横坐标变为原来的$\\dfrac{1}{2}$, 则所得图像的函数是\\blank{50}.", + "objs": [], + "tags": [], + "genre": "填空题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040420": { + "id": "040420", + "content": "已知函数$f(x)=A \\sin (\\dfrac{\\pi}{3} x+\\varphi)$, $x \\in \\mathbf{R}$($A>0$, $0<\\varphi<\\dfrac{\\pi}{2}$). $y=f(x)$的部分图像如图所示. $P, Q$分别为该图像的最高点和最低点, 点$P$的坐标为$(1, A)$.\n\\begin{center}\n\\begin{tikzpicture}[>=latex, scale = 0.6]\n\\draw [->] (-2,0) -- (6,0) node [below] {$x$};\n\\draw [->] (0,-2.5) -- (0,2.5) node [left] {$y$};\n\\draw (0,0) node [below left] {$O$};\n\\draw [domain = -0.5:5.5, samples = 100] plot (\\x,{sqrt(3)*sin(60*\\x+30)});\n\\draw [dashed] (1,{sqrt(3)}) node [above] {$P$} coordinate (P)-- (1,0) node [above left] {$R$} coordinate (R) -- (4,{-sqrt(3)}) node [below] {$Q$} coordinate (Q);\n\\end{tikzpicture}\n\\end{center}\n(1) 求$\\varphi$的值;\\\\\n(2) 若点$R$的坐标为$(1,0)$, $\\angle PRQ=\\dfrac{2 \\pi}{3}$, 求$A$的值.", + "objs": [], + "tags": [], + "genre": "解答题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" + }, + "040421": { + "id": "040421", + "content": "已知函数$y=2 \\cos x \\sin (x+\\dfrac{\\pi}{3})-\\sqrt{3} \\sin ^2 x+\\dfrac{1}{2} \\sin 2 x$.\\\\\n(1) 求函数的最小正周期和单调递减区间;\\\\\n(2) 求函数在区间$[\\dfrac{\\pi}{6}, \\dfrac{2 \\pi}{3}]$上的最大值与最小值.", + "objs": [], + "tags": [], + "genre": "解答题", + "ans": "", + "solution": "", + "duration": -1, + "usages": [], + "origin": "2025届高一下学期周末卷07小测", + "edit": [ + "20230330\t王伟叶" + ], + "same": [], + "related": [], + "remark": "", + "space": "" } } \ No newline at end of file