提交 ee801ad4 编写于 作者: M Mars Liu

fixed strcutre errors

上级 82cb5562
......@@ -2,6 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "HelloWorld.md",
"exercise_id":"1190bb7834904da0b1f20915960714d5",
"exercise_id": "1190bb7834904da0b1f20915960714d5",
"notebook_enable": true
}
\ No newline at end of file
{
"keywords": [],
"keywords": ["class", "类", "面向对象", "oo"],
"children": [],
"node_id": "java-0593e0b9c9f74799a204d697f0db488b",
"export": [
......
{
"node_id": "java-3ea06f6d049d4c079a88747ffd0cc51e",
"keywords": [],
"keywords": ["字节流", "bytestream"],
"children": [],
"export": [
"bytestream.json"
......
{
"node_id": "java-046d129404f14676af135da42fea658b",
"keywords": [],
"keywords": ["文件", "文件类", "file"],
"children": [],
"export": [
"file.json"
......
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "app.md",
"exercise_id": "f83bb3ca8a7d4070a5cdb850c8745d43"
"exercise_id": "f83bb3ca8a7d4070a5cdb850c8745d43",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "comment.md",
"exercise_id":"a666420ebe28430dab8ad4bd99306dfb"
"exercise_id": "a666420ebe28430dab8ad4bd99306dfb",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "keyword.md",
"exercise_id": "57b6f2510fde488486f73ab8597370c6"
"exercise_id": "57b6f2510fde488486f73ab8597370c6",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "swap.md",
"exercise_id":"accd5c6fca914d69990826e6123de37e"
"exercise_id": "accd5c6fca914d69990826e6123de37e",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "vars.md",
"exercise_id":"f990d6473c1c4b0c8947c27681c8f476"
"exercise_id": "f990d6473c1c4b0c8947c27681c8f476",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "solidity.md",
"exercise_id":"45bc14d503364f999f98e5d2faad2fec"
"exercise_id": "45bc14d503364f999f98e5d2faad2fec",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "scope.md",
"exercise_id":"009d35ca11a24baa809d0eeb5e2f66e2"
"exercise_id": "009d35ca11a24baa809d0eeb5e2f66e2",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "find.md",
"exercise_id":"61cca0fdecc34b00b173f4edc575ce48"
"exercise_id": "61cca0fdecc34b00b173f4edc575ce48",
"notebook_enable": true
}
\ No newline at end of file
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "max.md",
"exercise_id":"5025886554e5470e82710ed84735e419"
"exercise_id": "5025886554e5470e82710ed84735e419",
"notebook_enable": true
}
\ No newline at end of file
{
"node_id": "java-98b609c0de1544bf955cd3e1996224f7",
"keywords": [],
"keywords": ["集合", "legacy"],
"children": [
{
"属性映射": {
......
{
"node_id": "java-af0bf70f564b4ac68a7fadda69d55086",
"keywords": [],
"keywords": ["集合", "collection"],
"children": [
{
"集合接口与实现分离": {
......
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "ifelse.md",
"notebook_enable": false
"notebook_enable": false,
"exercise_id": "6feafab76cba4d91a083c1dc0b14a80b"
}
\ No newline at end of file
{
"node_id": "java-20cad95081b4475aaac1c1ebf7af0253",
"keywords": [],
"keywords": ["容器", "collection", "方法"],
"children": [],
"export": [
"Collection.json"
......
......@@ -2,5 +2,6 @@
"type": "code_options",
"author": "ccat",
"source": "junit.md",
"notebook_enable": false
"notebook_enable": false,
"exercise_id": "38a9581c24d9427598c83112d0af0c34"
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "group_by.md",
"notebook_enable": true,
"exercise_id": "a2249d4d426c403da4382c62e64f37e5"
}
\ No newline at end of file
......@@ -433,7 +433,10 @@
{
"Java集合框架": {
"node_id": "java-af0bf70f564b4ac68a7fadda69d55086",
"keywords": [],
"keywords": [
"集合",
"collection"
],
"children": [
{
"集合接口与实现分离": {
......@@ -561,7 +564,10 @@
{
"遗留的集合": {
"node_id": "java-98b609c0de1544bf955cd3e1996224f7",
"keywords": [],
"keywords": [
"集合",
"legacy"
],
"children": [
{
"属性映射": {
......@@ -1037,7 +1043,12 @@
{
"类和面向对象": {
"node_id": "java-0593e0b9c9f74799a204d697f0db488b",
"keywords": [],
"keywords": [
"class",
"类",
"面向对象",
"oo"
],
"children": []
}
},
......@@ -1085,14 +1096,21 @@
{
"字节流": {
"node_id": "java-3ea06f6d049d4c079a88747ffd0cc51e",
"keywords": [],
"keywords": [
"字节流",
"bytestream"
],
"children": []
}
},
{
"File类": {
"node_id": "java-046d129404f14676af135da42fea658b",
"keywords": [],
"keywords": [
"文件",
"文件类",
"file"
],
"children": []
}
}
......@@ -2028,7 +2046,11 @@
{
"Collection的功能方法": {
"node_id": "java-20cad95081b4475aaac1c1ebf7af0253",
"keywords": [],
"keywords": [
"容器",
"collection",
"方法"
],
"children": []
}
},
......
......@@ -326,8 +326,12 @@ class TreeWalker:
def ensure_exercises_meta(self, meta_path, source):
_, mfile = os.path.split(meta_path)
meta = None
if os.path.exists(meta_path):
meta = load_json(meta_path)
with open(meta_path) as f:
content = f.read()
if content:
meta = json.loads(content)
if "exercise_id" not in meta:
meta["exercise_id"] = uuid.uuid4().hex
if "notebook_enable" not in meta:
......@@ -338,7 +342,7 @@ class TreeWalker:
meta["author"] = user_name()
if "type" not in meta:
meta["type"] = "code_options"
else:
if meta is None:
meta = {
"type": "code_options",
"author": user_name(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册