소스 검색

判断题更新

莺声燕语 2 년 전
부모
커밋
c7578bd638
4개의 변경된 파일17개의 추가작업 그리고 13개의 파일을 삭제
  1. 4 4
      configs.py
  2. 6 6
      structure/dati2slave.py
  3. 1 1
      structure/structure_main.py
  4. 6 2
      utils/ruku_opera.py

+ 4 - 4
configs.py

@@ -88,7 +88,7 @@ class TestingCfg140:  # testing
     old_img_ip = "http://192.168.1.140:8800/ser_static"
     mathpix_ip = "http://192.168.1.208:8001/segment/formula/"
     kps_phy_ip = "http://192.168.1.86:11088/phy_mark_and_connect"
-    repeat_ip = "http://192.168.1.192:10818/api/repeat/subject"
+    repeat_ip = "http://192.168.1.192:8866/api/repeat/subject"
     # callback_url_taskcheck = "http://zsytk3api.testing.xueping.com/v1/interior-api/record"
     callback_url_taskcheck = "http://zsytk3api.dev.xueping.com/v1/interior-api/record"
 
@@ -109,7 +109,7 @@ class TestingCfg:  # testing
     old_img_ip = "http://192.168.1.140:8800/ser_static"
     mathpix_ip = "http://192.168.1.208:8001/segment/formula/"
     kps_phy_ip = "http://192.168.1.86:11088/phy_mark_and_connect"
-    repeat_ip = "http://192.168.1.192:10818/api/repeat/subject"
+    repeat_ip = "http://192.168.1.192:8866/api/repeat/subject"
     # callback_url_taskcheck = "http://zsytk3api.testing.xueping.com/v1/interior-api/record"
     callback_url_taskcheck = "http://zsytk3api.dev.xueping.com/v1/interior-api/record"
 
@@ -130,7 +130,7 @@ class ProductionCfg:  # production
     old_img_ip = "http://82.156.255.225:11086/ser_static"
     mathpix_ip = "http://10.19.1.11:7080/segment/formula/"
     kps_phy_ip = "http:/49.232.72.198:11088/phy_mark_and_connect"
-    repeat_ip = "http://82.156.68.22:8888/api/repeat/subject"
+    repeat_ip = "http://10.19.1.18:8866/api/repeat/subject"
     callback_url_taskcheck = "http://api.tk.zhixinhuixue.com/v1/interior-api/record"
 
 
@@ -150,7 +150,7 @@ class ProductionCfg175:  # production
     old_img_ip = "http://82.156.255.225:11086/ser_static"
     mathpix_ip = "http://10.19.1.11:7080/segment/formula/"
     kps_phy_ip = "http:/49.232.72.198:11088/phy_mark_and_connect"
-    repeat_ip = "http://82.156.68.22:8888/api/repeat/subject"
+    repeat_ip = "http://10.19.1.18:8866/api/repeat/subject"
     callback_url_taskcheck = "http://api.tk.zhixinhuixue.com/v1/interior-api/record"
 
 

+ 6 - 6
structure/dati2slave.py

@@ -123,12 +123,12 @@ def get_slave(one_item, con, parse, ans, parse_split=1):
             one_item["answer_type"] = "选择题"
             if 'options' not in one_item:
                 one_item["options"] = []
-        elif re.search("[((]\s+[))][\s\n]*$", one_item["stem"]):
+        elif re.search("[((]\s+[))][\s\n]*$", one_item["stem"]) or one_item["type"] == "判断题":
             one_item["answer_type"] = "判断题"
-            if re.match("【?(对|正确|T)】?$", one_item["key"].strip()):
-                one_item["key"] = "A"
-            elif re.match("【?(错误?的?|F)】?$", one_item["key"].strip()):
-                one_item["key"] = "B"
+            if re.match("【?(对的?|正确的?|[T√])】?$", one_item["key"].strip()):
+                one_item["key"] = "正确"
+            elif re.match("【?(错误?的?|不对的?|不正确的?|[F×])】?$", one_item["key"].strip()):
+                one_item["key"] = "错误"
         elif re.search("[横划画]线处填写", one_item["stem"]) and "com_stem" in one_item:
             one_item["answer_type"] = "填空题"
             if "com_stem" in one_item:
@@ -217,7 +217,7 @@ def split2little_con(con_list, ans_list, parse_list, one_item):
                 if blank_num > 0:
                     one_slave["blank_num"] = blank_num
                     one_slave["answer_type"] = "填空题"
-                elif re.search("[((]\s+[))]\s*$", s):
+                elif re.search("[((]\s+[))]\s*$|判断.*?正误", s):
                     one_slave["answer_type"] = "判断题"
                 elif re.search("[横划画]线处填写", s):
                     one_slave["answer_type"] = "填空题"

+ 1 - 1
structure/structure_main.py

@@ -216,7 +216,7 @@ if __name__ == '__main__':
     #    6239991e6ca622396925f66b     624cf82d12cd45a7836f3430  626b4b1f81b582c0470d01b0
     # 627b64b0814132f0d7b12589    627b622981b582c0470d020e
     # 6294326cf84c0e279ac6484e.html   62903acaf84c0e279ac647fb
-    path2 = r"C:\Users\Python\Desktop\62be6bbf6c6aff22793464f5.html"
+    path2 = r"C:\Users\Python\Desktop\62d8eaaa6c6aff2279346c1e.html"
     # path2 = r"F:\zwj\Text_Structure\accept_files\62aae86a765759d85567a475.html"
     html = open(path2, "r", encoding="utf-8").read()
     # html = json.loads(html)  621845626ca622396925f55c

+ 6 - 2
utils/ruku_opera.py

@@ -47,7 +47,7 @@ class Ruku():
         self.wordid = wordid
         self.callback_url = callback_info["callback_url"]
         self.source = callback_info["source"]
-        self.subject = subject
+        self.subject = subject  # items_list[0]["period"] + items_list[0]["subject"]
         self.callback_code = 0
         self.callback_err = ""
         self.ltx2url = {}  # latex 映射 线上可访问url
@@ -459,6 +459,9 @@ class Ruku():
         将小问答案没拆出来的部分放入公共解析字段中
         :return:
         """
+        # 此阶段将每个题可能的报错信息去掉
+        if "errmsgs" in one_items and one_items["errmsgs"]:
+            one_items["errmsgs"] = ""
         # 将小问答案没拆出来的部分放入公共解析字段中
         if "slave" in one_items and one_items["slave"]:
             if one_items["key"] and all(
@@ -607,10 +610,11 @@ class Ruku():
 
     def repeat_check(self, id, one_items, repeat_time):
         t22 = time.time()
+        # print(one_items)
         chachong_item_dict = {"topic_id": id + 1,
                               "subject_id": subject_id[self.subject],
                               "topic_type_id": one_items["checkType"]["id"],
-                              "content": one_items["stem"].strip(), }
+                              "content": one_items["stem"]}
         if "options" in one_items:
             chachong_item_dict["options"] = one_items["options"]
         if "slave" in one_items: