Skip to content

config и params - убрать params, возможно общие и специфические поля score, header, footer тоже решить где они будут храниться в едином месте #56

@tatyderb

Description

@tatyderb

Имхо надо избавиться от дополнительного словаря
Step:
self.id = 0 # step_id, use in update and delete, filled by create method
self.name = 'text' # todo: various types (text, question, video, task)
self.lesson_id = 0 # todo: lesson_id, should be filled, need for create and update requests
self.position = 0 # step position in lesson, from 1
self.text = ''
self.step_type = StepType.TEXT
self.config = {} <--- вот тут конфигурация началась
self.score = Step.Cost.DEFAULT

StepTask:
def init(self, lang):
super().init()
# self.cost = Step.Cost.DEFAULT_TASK
self.text = ''
self.code = ''
self.name = 'code'
self.test_cases = []
self.samples_count = Step.DEAFAULT_TST_NUM
self.header = ''
self.footer = ''
self.lang = lang

    self.generate = ''
    self.checker = ''
    self.solve = ''

    self.params = {
        'name': None,
        'repo': None,
        'statement': None,
        # 'checker': '',
        # 'solution': '',
        # 'generate': '',
        'tests': None,
        'visible_tst_num': None,
        'score': Step.Cost.DEFAULT_TASK,
        'lang': None,
        'header': None,
        'footer': None
    }
   Почему этот словарь по сути дублирует self.config?

StepTaskinline
elif mode == InputState.Config:
d = parse_config(text)
self.config.update(d) <--- пишет в config
print(f'config = {self.config}')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions