提交 7f19beeb 编写于 作者: M Mars Liu

fixed dup eid

上级 fd4275b0
......@@ -3,5 +3,5 @@
"author": "ccat",
"source": "counter.md",
"notebook_enable": false,
"exercise_id": "c1b604a5d2364a969361cd5fbb4ed3f8"
"exercise_id": "7c2c7b59b6294c1e8c5c46f48ea00a4f"
}
\ No newline at end of file
......@@ -303,6 +303,9 @@ class TreeWalker:
for e in config.get("export", []):
full_name = os.path.join(section_path, e)
exercise = load_json(full_name)
if "exercise_id" not in exercise:
exercise["exercise_id"] = uuid.uuid4().hex
if "exercise_id" not in exercise or exercise.get("exercise_id") in id_set:
eid = uuid.uuid4().hex
exercise["exercise_id"] = eid
dump_json(full_name, exercise, True, True)
else:
id_set.add(exercise["exercise_id"])
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册