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

fixed strcutre errors

上级 82cb5562
{
"type": "code_options",
"author": "ccat",
"source": "HelloWorld.md",
"exercise_id":"1190bb7834904da0b1f20915960714d5",
"notebook_enable": true
"type": "code_options",
"author": "ccat",
"source": "HelloWorld.md",
"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
{
"type": "code_options",
"author": "ccat",
"source": "comment.md",
"exercise_id":"a666420ebe28430dab8ad4bd99306dfb"
"type": "code_options",
"author": "ccat",
"source": "comment.md",
"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
{
"type": "code_options",
"author": "ccat",
"source": "swap.md",
"exercise_id":"accd5c6fca914d69990826e6123de37e"
"type": "code_options",
"author": "ccat",
"source": "swap.md",
"exercise_id": "accd5c6fca914d69990826e6123de37e",
"notebook_enable": true
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "vars.md",
"exercise_id":"f990d6473c1c4b0c8947c27681c8f476"
"type": "code_options",
"author": "ccat",
"source": "vars.md",
"exercise_id": "f990d6473c1c4b0c8947c27681c8f476",
"notebook_enable": true
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "solidity.md",
"exercise_id":"45bc14d503364f999f98e5d2faad2fec"
"type": "code_options",
"author": "ccat",
"source": "solidity.md",
"exercise_id": "45bc14d503364f999f98e5d2faad2fec",
"notebook_enable": true
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "scope.md",
"exercise_id":"009d35ca11a24baa809d0eeb5e2f66e2"
"type": "code_options",
"author": "ccat",
"source": "scope.md",
"exercise_id": "009d35ca11a24baa809d0eeb5e2f66e2",
"notebook_enable": true
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "find.md",
"exercise_id":"61cca0fdecc34b00b173f4edc575ce48"
"type": "code_options",
"author": "ccat",
"source": "find.md",
"exercise_id": "61cca0fdecc34b00b173f4edc575ce48",
"notebook_enable": true
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "max.md",
"exercise_id":"5025886554e5470e82710ed84735e419"
"type": "code_options",
"author": "ccat",
"source": "max.md",
"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": [
{
"集合接口与实现分离": {
......
{
"type": "code_options",
"author": "lostrex",
"source": "hashset.md",
"exercise_id": "",
"notebook_enable": false
"type": "code_options",
"author": "lostrex",
"source": "hashset.md",
"exercise_id": "",
"notebook_enable": false
}
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "ifelse.md",
"notebook_enable": false
"type": "code_options",
"author": "ccat",
"source": "ifelse.md",
"notebook_enable": false,
"exercise_id": "6feafab76cba4d91a083c1dc0b14a80b"
}
\ No newline at end of file
{
"node_id": "java-20cad95081b4475aaac1c1ebf7af0253",
"keywords": [],
"keywords": ["容器", "collection", "方法"],
"children": [],
"export": [
"Collection.json"
......
{
"type": "code_options",
"author": "ccat",
"source": "junit.md",
"notebook_enable": false
"type": "code_options",
"author": "ccat",
"source": "junit.md",
"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,26 +326,30 @@ 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)
if "exercise_id" not in meta:
meta["exercise_id"] = uuid.uuid4().hex
if "notebook_enable" not in meta:
meta["notebook_enable"] = self.default_notebook()
if "source" not in meta:
meta["source"] = source
if "author" not in meta:
meta["author"] = user_name()
if "type" not in meta:
meta["type"] = "code_options"
else:
meta = {
"type": "code_options",
"author": user_name(),
"source": source,
"notebook_enable": self.default_notebook(),
"exercise_id": uuid.uuid4().hex
}
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:
meta["notebook_enable"] = self.default_notebook()
if "source" not in meta:
meta["source"] = source
if "author" not in meta:
meta["author"] = user_name()
if "type" not in meta:
meta["type"] = "code_options"
if meta is None:
meta = {
"type": "code_options",
"author": user_name(),
"source": source,
"notebook_enable": self.default_notebook(),
"exercise_id": uuid.uuid4().hex
}
dump_json(meta_path, meta, True, True)
def default_notebook(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册