提交版本
This commit is contained in:
@@ -2,7 +2,7 @@ import os
|
||||
# Example usage:
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
import copy
|
||||
LOCAL_USER_DATA_DIR = "data/user/" # only use locally, not for other .py files
|
||||
|
||||
class User:
|
||||
@@ -88,6 +88,19 @@ class User:
|
||||
'course_process_dict': self.course_process_dict
|
||||
}
|
||||
|
||||
def to_json_without_dialog(self):
|
||||
course_dict = copy.deepcopy(self.course_process_dict)
|
||||
for course_id in course_dict.keys():
|
||||
for lep,lid in course_dict[course_id]['lesson_processs']:
|
||||
for chapter_info in lep:
|
||||
chapter_info['dialog']=[]
|
||||
return json.dumps({
|
||||
'user_id': self.user_id,
|
||||
'select_course': self.select_course,
|
||||
'head_icon': self.head_icon,
|
||||
'course_process_dict': course_dict
|
||||
}, indent=1)
|
||||
|
||||
def to_json(self):
|
||||
return json.dumps(self.__json__(), indent=4)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user