-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f0b8f9
commit e673f8c
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from ..base_check import BaseReportCriterion, answer | ||
from logging import getLogger | ||
|
||
|
||
logger = getLogger('root') | ||
|
||
|
||
class SWTasksCheck(BaseReportCriterion): | ||
label = "Проверка количества задач исследования" | ||
description = "Проверка количества задач исследования" | ||
id = "sw_tasks_check" | ||
priority = True | ||
|
||
def __init__(self, file_info, min_tasks=3, max_tasks=5): | ||
super().__init__(file_info) | ||
|
||
self.min_tasks = min_tasks | ||
self.max_tasks = max_tasks | ||
|
||
def check(self): | ||
self.file.make_chapters('VKR') | ||
for chapter in self.file.chapters: | ||
if "Задачи" in chapter['text']: | ||
if self.min_tasks <= len(chapter['child']) <= self.max_tasks: | ||
return answer(1, "Проверка пройдена!") | ||
feedback = f"Количество задач исследования должно быть в диапазоне [{self.min_tasks};{self.max_tasks}], сейчас их {len(chapter['child'])}" | ||
return answer(0, feedback) | ||
return answer(1, "Проверка пройдена!") |