Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

556 overview in tasks #591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/main/check_packs/pack_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
['pres_empty_slide'],
['theme_in_pres_check'],
['verify_git_link'],
['overview_in_tasks'],
]
BASE_REPORT_CRITERION = [
["simple_check"],
Expand Down
1 change: 1 addition & 0 deletions app/main/checks/presentation_checks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
from .find_theme_in_pres import FindThemeInPres
from .verify_git_link import PresVerifyGitLinkCheck
from .empty_slide_check import PresEmptySlideCheck
from .overview_in_tasks import OverviewInTasks
25 changes: 25 additions & 0 deletions app/main/checks/presentation_checks/overview_in_tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from app.utils.get_text_from_slides import get_text_from_slides
from app.nlp.stemming import Stemming
from ..base_check import BasePresCriterion, answer, morph

class OverviewInTasks(BasePresCriterion):
label = "Проверка наличия обзора в числе задач"
description = 'В числе задач должен присутсвовать обзор/анализ предметной области'
id = 'overview_in_tasks'

def __init__(self, file_info, goal_and_tasks='Цель и задачи', keywords=['обзор', 'анализ']):
super().__init__(file_info)
self.goal_and_tasks = goal_and_tasks
self.keywords = [morph.parse(word)[0].normal_form for word in keywords]

def check(self):
goal_and_tasks = get_text_from_slides(self.file, self.goal_and_tasks)
if goal_and_tasks == "":
return answer(False, 'Слайда "Цель и задачи" не существует')
stemming = Stemming()
stemming.parse_text(goal_and_tasks, True)
for filtered_doc in stemming.filtered_docs:
for word in filtered_doc:
if word in self.keywords:
return answer(True, 'Пройдена!')
return answer(False, 'В списке задач требуется наличие обзора!')
Loading