homework_checker/core/checker.py
def check_homework(self: "Checker", homework_node: dict) -> HomeworkResultDict:
        """Run over all Tasks in a single homework."""
        results: HomeworkResultDict = {}
        current_folder = Path(self._checked_code_folder, homework_node[Tags.FOLDER_TAG])
        log.debug("current_folder: %s", current_folder)
        if not current_folder.exists():
            log.warning("Folder '%s' does not exist. Skiping.", current_folder)
            return results
        deadline_str = homework_node[Tags.DEADLINE_TAG]
        deadline_datetime = datetime.strptime(deadline_str, tools.DATE_PATTERN)
        if datetime.now() > deadline_datetime:
            results[tools.EXPIRED_TAG] = {}
        for idx, task_node in enumerate(homework_node[Tags.TASKS_TAG]):
            task = Task.from_yaml_node(
                task_node=task_node,
                student_hw_folder=current_folder,
                job_file=self._job_file_path,
            )
            if not task:
                continue
            results[tools.add_number_to_name(idx, task.name)] = task.check()
        return results
Run over all Tasks in a single homework.
Run over all Tasks in a single homework.
Run over all Tasks in a single homework .
def check_homework(self: "Checker", homework_node: dict) -> HomeworkResultDict:
        results: HomeworkResultDict = {}
        current_folder = Path(self._checked_code_folder, homework_node[Tags.FOLDER_TAG])
        log.debug("current_folder: %s", current_folder)
        if not current_folder.exists():
            log.warning("Folder '%s' does not exist. Skiping.", current_folder)
            return results
        deadline_str = homework_node[Tags.DEADLINE_TAG]
        deadline_datetime = datetime.strptime(deadline_str, tools.DATE_PATTERN)
        if datetime.now() > deadline_datetime:
            results[tools.EXPIRED_TAG] = {}
        for idx, task_node in enumerate(homework_node[Tags.TASKS_TAG]):
            task = Task.from_yaml_node(
                task_node=task_node,
                student_hw_folder=current_folder,
                job_file=self._job_file_path,
            )
            if not task:
                continue
            results[tools.add_number_to_name(idx, task.name)] = task.check()
        return results
def check_homework ( self : "Checker" , homework_node : dict ) -> HomeworkResultDict : results : HomeworkResultDict = { } current_folder = Path ( self . _checked_code_folder , homework_node [ Tags . FOLDER_TAG ] ) log . debug ( "current_folder: %s" , current_folder ) if not current_folder . exists ( ) : log . warning ( "Folder '%s' does not exist. Skiping." , current_folder ) return results deadline_str = homework_node [ Tags . DEADLINE_TAG ] deadline_datetime = datetime . strptime ( deadline_str , tools . DATE_PATTERN ) if datetime . now ( ) > deadline_datetime : results [ tools . EXPIRED_TAG ] = { } for idx , task_node in enumerate ( homework_node [ Tags . TASKS_TAG ] ) : task = Task . from_yaml_node ( task_node = task_node , student_hw_folder = current_folder , job_file = self . _job_file_path , ) if not task : continue results [ tools . add_number_to_name ( idx , task . name ) ] = task . check ( ) return results
Run over all Tasks in a single homework.
Run over all Tasks in a single homework .
"""Run over all Tasks in a single homework."""
self
"Checker"
homework_node
dict