From 8a288669083c6b3553933b26ad7ba896f36f6518 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Sat, 27 Jan 2024 15:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=94=E9=A2=98=E7=BA=B8=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=80=E7=A7=8D=E7=9B=B4=E6=8E=A5=E6=8C=87?= =?UTF-8?q?=E5=AE=9Aidlist=E7=9A=84=E6=A8=A1=E5=BC=8F(=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=B7=B3=E8=BF=87=E7=9A=84=E9=A2=98=E7=9B=AE?= =?UTF-8?q?),=20=E5=B9=B6=E6=9B=B4=E6=96=B0=E4=BA=86"=E6=94=B6=E9=9B=86?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AE=B0=E5=BD=95"=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 备课组/24届/答题纸对应.json | 22 ++++++++++++++++++++++ 工具v2/database_tools.py | 16 ++++++++++------ 工具v2/收集使用记录.py | 2 +- 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 备课组/24届/答题纸对应.json diff --git a/备课组/24届/答题纸对应.json b/备课组/24届/答题纸对应.json new file mode 100644 index 00000000..85e03cd0 --- /dev/null +++ b/备课组/24届/答题纸对应.json @@ -0,0 +1,22 @@ +{ + "222816958193777036586": { + "id": "F20240515", + "idlist": [ + "023033", + "040350", + "023034", + "023035", + "023036", + "023037", + "014586", + "023038", + "999999", + "999999", + "999999", + "999999", + "023039", + "023040" + ], + "marks": [4,4,4,4,4,4,5,5,4,4] + } +} \ No newline at end of file diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index a4c35f58..d616e657 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -1498,9 +1498,12 @@ def FindPaper(xiaoxianpid, answersheetpath): #根据小闲的试卷编号和答 grade = "20"+re.findall(r"\d{2}届",dir)[0] pid = anssheetjson[xiaoxianpid]["id"] notesjson = load_dict(os.path.join(dir,"校本材料.json")) - idlist = [] - for part in anssheetjson[xiaoxianpid]["parts"]: - idlist += notesjson["notes"][pid][part].copy() + if not "idlist" in anssheetjson[xiaoxianpid]: + idlist = [] + for part in anssheetjson[xiaoxianpid]["parts"]: + idlist += notesjson["notes"][pid][part].copy() + else: + idlist = anssheetjson[xiaoxianpid]["idlist"] if "marks" in anssheetjson[xiaoxianpid]: marks = anssheetjson[xiaoxianpid]["marks"] else: @@ -1594,9 +1597,10 @@ def CalculateUsages(statsfilepathlist,statsfilename,gradename,threshold,marks,co means_out = [f"{t:.3f}" for t in means] for id in correspondence_dict: cols = correspondence_dict[id] - diffs = "\t".join([means_out[u] for u in cols]) - usages = f"{date}\t{classname}\t{diffs}" - output += f"{id}\n{usages}\n\n\n" + if not len(cols) == 0: + diffs = "\t".join([means_out[u] for u in cols]) + usages = f"{date}\t{classname}\t{diffs}" + output += f"{id}\n{usages}\n\n\n" if validflag: return output else: diff --git a/工具v2/收集使用记录.py b/工具v2/收集使用记录.py index d295d311..fcf897f6 100644 --- a/工具v2/收集使用记录.py +++ b/工具v2/收集使用记录.py @@ -1,4 +1,4 @@ -zipfilepath = r"D:\temp\222817032234165544977_G20260160选择性必修第四章数列复习_高一_数学.zip" +zipfilepath = r"D:\temp\222816958193777036586_基础赋能卷8_高三_数学.zip" # zipfilepath = r"D:\temp\222817041862672707412_控江中学2023学年第一学期高一数学期末考试_高一_数学.zip" date = "20240125" threshold = 0.75 #设置最低提交人数比例