Selaa lähdekoodia

adjust source

莺声燕语 5 kuukautta sitten
vanhempi
commit
186436cc53
2 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 5 2
      structure/danti_structure.py
  2. 1 1
      structure/structure_main.py

+ 5 - 2
structure/danti_structure.py

@@ -87,12 +87,15 @@ def single_parse(one_item, item_type, wordid, source="zxhx", subject="数学"):
                                                  if not i.replace(":", "").strip()]):  # 空选项中:被当成了内容
             return "存在选项为空,请补充完整"
         new_item_struct["answer_type"] = "选择题"
-    elif source in ["xue_guan", "teacher"] and subject not in ["数学", "物理"]:  # 拆小题
+    elif ("数学" in subject or "物理" in subject) and source in ["school", "teacher", "xue_guan"]:
+        pass
+    # elif source in ["xue_guan", "teacher"] and subject not in ["数学", "物理"]:  # 校本、教师、学管端不拆小题
+    else:
         new_item_struct = get_slave(new_item_struct, new_item_struct["stem"], new_item_struct["parse"], new_item_struct["key"])
 
     new_item_struct = wash_after([new_item_struct], subject)[0]
     # 换行符替换
-    # convert_huanhang(new_item_struct)
+    convert_huanhang(new_item_struct)
     # new_item_struct["stem"] = new_item_struct["stem"].strip().replace("\n\n", "\n").replace("\n", "<br/>")  # 2020/4/10 gai
     # new_item_struct["key"] = new_item_struct["key"].strip().replace("\n\n", "\n").replace("\n", "<br/>")
     # new_item_struct["parse"] = new_item_struct["parse"].strip().replace("\n\n", "\n").replace("\n", "<br/>")

+ 1 - 1
structure/structure_main.py

@@ -37,7 +37,7 @@ class WordParseStructure:
         self.subject = subject
 
     def __call__(self):
-        if self.source in ["school"]: #  "school" "xue_guan", "teacher"
+        if self.source in ["school", "qtk"]: #  "school" "xue_guan", "teacher"
             res = self.structure_combine_DL()
             if not res[0]:
                 return self.structure()