From a0e2e96accaa528789259062d1a4c18b7b4ec4d7 Mon Sep 17 00:00:00 2001 From: Mars Liu Date: Mon, 22 Nov 2021 21:55:11 +0800 Subject: [PATCH] fixed odd orders --- .../login.json" | 6 ++++++ .../2.\347\231\273\345\275\225PostgreSQL/login.md" | 0 .../paged.md" | 4 ++-- src/tree.py | 13 +------------ 4 files changed, 9 insertions(+), 14 deletions(-) create mode 100644 "data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.json" create mode 100644 "data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.md" diff --git "a/data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.json" "b/data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.json" new file mode 100644 index 0000000..a43082f --- /dev/null +++ "b/data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.json" @@ -0,0 +1,6 @@ +{ + "type": "code_options", + "author": "刘鑫", + "source": "grant.md", + "notebook_enable": false +} \ No newline at end of file diff --git "a/data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.md" "b/data/1.PostgreSQL\345\210\235\351\230\266/2.PostgreSQL\347\232\204\345\256\211\350\243\205/2.\347\231\273\345\275\225PostgreSQL/login.md" new file mode 100644 index 0000000..e69de29 diff --git "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/4.\345\210\206\351\241\265\346\237\245\350\257\242/paged.md" "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/4.\345\210\206\351\241\265\346\237\245\350\257\242/paged.md" index 559ec87..49ff1f9 100644 --- "a/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/4.\345\210\206\351\241\265\346\237\245\350\257\242/paged.md" +++ "b/data/2.PostgreSQL\344\270\255\351\230\266/2.\346\234\215\345\212\241\347\253\257\347\274\226\347\250\213/4.\345\210\206\351\241\265\346\237\245\350\257\242/paged.md" @@ -1,6 +1,6 @@ # 分页 -我们有如下表: +我们有如下订单表: ```postgresql create table orders @@ -13,7 +13,7 @@ create table orders ); ``` -现在希望查询指定的某一天内的数据,并按每一百条一页查询,那么正确的语句应该是: +现在开发人员希望查询指定的某一天内的数据,并按每一百条一页查询,那么正确的语句应该是: ## 答案 diff --git a/src/tree.py b/src/tree.py index 156e547..9dc5fe2 100644 --- a/src/tree.py +++ b/src/tree.py @@ -107,17 +107,6 @@ class TreeWalker: full_path = os.path.join(chapter_path, f"{index + 1}.{section_title}") if os.path.isdir(full_path): self.ensure_exercises(full_path) - # TODO 四级知识点的处理仅为 Java 技能树的临时处理而设定,未来java技能树上线前会删掉这部分代码,将四级节点 - # 合并到三级节点 - for idx, [num, sub_section_title] in self.sort_dir_list([p for p in os.listdir(full_path) - if os.path.isdir(os.path.join(full_path, p))]): - order = idx + 1 - ensure_path = os.path.join(full_path, f"{order}.{sub_section_title}") - forth_full_path = os.path.join(full_path, f"{num}.{sub_section_title}") - if ensure_path != forth_full_path: - os.rename(forth_full_path, ensure_path) - if os.path.isdir(ensure_path): - self.ensure_exercises(forth_full_path) tree_path = os.path.join(self.root, "tree.json") dump_json(tree_path, self.tree, exist_ok=True, override=True) @@ -310,6 +299,6 @@ class TreeWalker: full_name = os.path.join(section_path, e) logger.info(full_name) exercise = load_json(full_name) - if "exercise_id" not in exercise: + if not exercise.get("exercise_id"): exercise["exercise_id"] = uuid.uuid4().hex dump_json(full_name, exercise, exist_ok=True, override=True) -- GitLab