diff --git a/core/src/utils/file/yaml_utils.py b/core/src/utils/file/yaml_utils.py index 4276146..a1dca7b 100644 --- a/core/src/utils/file/yaml_utils.py +++ b/core/src/utils/file/yaml_utils.py @@ -7,3 +7,14 @@ def parse_yaml(path: Union[Path, str]) -> Any: with open(path) as file: return yaml.safe_load(file) + + +def read_yaml_field_content(yaml_file: Path, field_name: str) -> Any: + if not yaml_file.exists(): + raise ValueError(f'{field_name} does not exist.') + + parsed_yaml_file = parse_yaml(yaml_file) + if parsed_yaml_file is None: + raise ValueError(f'`{yaml_file} is empty.') + + return parsed_yaml_file.get(field_name) diff --git a/jba/README.md b/jba/README.md index 996be5c..355390a 100644 --- a/jba/README.md +++ b/jba/README.md @@ -26,29 +26,40 @@ docker run hyperstyle-analysis-prod: poetry run prepare_course_data [ar - `data_path` — Path to .csv file with collected data. The file must contain the following columns: `task_id`, `course_id`, `submission_datetime`, `status`, `task_type`, `user_id`, `task_name` (see [an example](tests/resources/processing/all_data.csv) in the tests). - `course_id` — Course id to analyze. -- `course_sources_path` — Path to course sources to extract course structure (see [an example](tests/resources/processing/course_example) in the tests). +- `course_sources_path` — Path to course sources to extract course structure. After this step you will get a new file with `courseId` suffix. This file will contain all data from the `data_path` file, but only for the course with the course id `course_id`. -Also, an additional file with the course structure will be generated, e.g. for the [course](tests/resources/processing/course_example) from the test folder with the following structure: +Also, an additional file with the course structure will be generated, e.g. for the [course](tests/resources/processing/prepare_course_data/course_with_section) from the test folder with the following structure: ```text -- course_root --- course-info.yaml --- course-remote-info.yaml --- section ---- section-info.yaml ---- section-remote-info.yaml ---- lesson ----- lesson-info.yaml ----- lesson-remote-info.yaml ----- task1 ------ task-info.yaml ------ task-remote-info.yaml ----- task2 ------ task-info.yaml ------ task-remote-info.yaml +course-info.yaml +course-remote-info.yaml +section/ +├── section-info.yaml +├── section-remote-info.yaml +└── lesson/ + ├── lesson-info.yaml + ├── lesson-remote-info.yaml + ├── task1/ + │ ├── task-info.yaml + │ ├── task-remote-info.yaml + │ ├── src/ + │ │ └── ... + │ └── task.md + ├── task2/ + │ ├── task-info.yaml + │ ├── task-remote-info.yaml + │ ├── task.md + │ └── src/ + │ └── ... + └── task3/ + ├── task-info.yaml + ├── task-remote-info.yaml + ├── task.md + └── src/ + └── ... ``` -the [following](tests/resources/processing/course_1_structure_expected.csv) file will be generated. +the [following](tests/resources/processing/prepare_course_data/expected_course_with_section.csv) file will be generated. 2. [data_processing.py](src/processing/data_processing.py) allows you to process data from the previous step: - Merge course data with task info diff --git a/jba/src/models/edu_columns.py b/jba/src/models/edu_columns.py index 244863e..ffd2529 100644 --- a/jba/src/models/edu_columns.py +++ b/jba/src/models/edu_columns.py @@ -1,5 +1,12 @@ from enum import Enum, unique +from jba.src.models.edu_structure import EduStructureType + +ID_COLUMN_POSTFIX = 'id' +NAME_COLUMN_POSTFIX = 'name' +NUMBER_COLUMN_POSTFIX = 'number' +AMOUNT_COLUMN_POSTFIX = 'amount' + @unique class EduColumnName(Enum): @@ -12,21 +19,21 @@ class EduColumnName(Enum): CODE_SNIPPETS = 'code_snippets' UUID = 'uuid' - TASK_ID = 'task_id' - TASK_GLOBAL_NUMBER = 'task_global_number' - TASK_NAME = 'task_name' - TASK_NUMBER = 'task_number' - TASKS_AMOUNT = 'tasks_amount' - - LESSON_ID = 'lesson_id' - LESSON_NAME = 'lesson_name' - LESSON_NUMBER = 'lesson_number' - LESSONS_AMOUNT = 'lessons_amount' - - SECTION_ID = 'section_id' - SECTION_NAME = 'section_name' - SECTION_NUMBER = 'section_number' - SECTIONS_AMOUNT = 'sections_amount' + TASK_GLOBAL_NUMBER = f'{EduStructureType.TASK.value}_global_number' + TASK_ID = f'{EduStructureType.TASK.value}_{ID_COLUMN_POSTFIX}' + TASK_NAME = f'{EduStructureType.TASK.value}_{NAME_COLUMN_POSTFIX}' + TASK_NUMBER = f'{EduStructureType.TASK.value}_{NUMBER_COLUMN_POSTFIX}' + TASK_AMOUNT = f'{EduStructureType.TASK.value}_{AMOUNT_COLUMN_POSTFIX}' + + LESSON_ID = f'{EduStructureType.LESSON.value}_{ID_COLUMN_POSTFIX}' + LESSON_NAME = f'{EduStructureType.LESSON.value}_{NAME_COLUMN_POSTFIX}' + LESSON_NUMBER = f'{EduStructureType.LESSON.value}_{NUMBER_COLUMN_POSTFIX}' + LESSON_AMOUNT = f'{EduStructureType.LESSON.value}_{AMOUNT_COLUMN_POSTFIX}' + + SECTION_ID = f'{EduStructureType.SECTION.value}_{ID_COLUMN_POSTFIX}' + SECTION_NAME = f'{EduStructureType.SECTION.value}_{NAME_COLUMN_POSTFIX}' + SECTION_NUMBER = f'{EduStructureType.SECTION.value}_{NUMBER_COLUMN_POSTFIX}' + SECTION_AMOUNT = f'{EduStructureType.SECTION.value}_{AMOUNT_COLUMN_POSTFIX}' SOLUTION_AWS_KEY = 'solution_aws_key' FORMAT_VERSION = 'format_version' diff --git a/jba/src/models/edu_config_item.py b/jba/src/models/edu_config_item.py deleted file mode 100644 index e94436b..0000000 --- a/jba/src/models/edu_config_item.py +++ /dev/null @@ -1,10 +0,0 @@ -from dataclasses import dataclass -from typing import List, Optional - - -@dataclass(frozen=True) -class EduConfigItem: - id: int - name: str - item_type: str - nested_items: Optional[List[str]] diff --git a/jba/src/models/edu_structure.py b/jba/src/models/edu_structure.py new file mode 100644 index 0000000..ea089d0 --- /dev/null +++ b/jba/src/models/edu_structure.py @@ -0,0 +1,18 @@ +from dataclasses import dataclass +from enum import Enum +from typing import List, Optional + + +class EduStructureType(Enum): + COURSE = 'course' + SECTION = 'section' + LESSON = 'lesson' + TASK = 'task' + + +@dataclass(frozen=True) +class EduStructureNode: + id: int + name: str + structure_type: EduStructureType + children: Optional[List['EduStructureNode']] diff --git a/jba/src/processing/prepare_course_data.py b/jba/src/processing/prepare_course_data.py index f756231..dbd49fb 100644 --- a/jba/src/processing/prepare_course_data.py +++ b/jba/src/processing/prepare_course_data.py @@ -1,119 +1,140 @@ +import re +from os import listdir + import argparse -from os.path import exists from pathlib import Path -from typing import Any import pandas as pd -import sys from core.src.utils.df_utils import read_df, filter_df_by_single_value, write_df from core.src.utils.file.extension_utils import AnalysisExtension -from core.src.utils.file.file_utils import get_parent_folder, remove_slash -from core.src.utils.file.yaml_utils import parse_yaml -from jba.src.models.edu_columns import EduColumnName -from jba.src.models.edu_config_item import EduConfigItem +from core.src.utils.file.file_utils import get_output_path +from core.src.utils.file.yaml_utils import read_yaml_field_content +from jba.src.models.edu_columns import ( + EduColumnName, + NUMBER_COLUMN_POSTFIX, + AMOUNT_COLUMN_POSTFIX, + ID_COLUMN_POSTFIX, + NAME_COLUMN_POSTFIX, +) +from jba.src.models.edu_structure import EduStructureNode, EduStructureType + +CONTENT_META_FIELD = 'content' +ID_META_FIELD = 'id' -CONTENT_FIELD = 'content' -ID_FIELD = 'id' +INFO_FILE_REGEX = re.compile(f'([a-z]+)-info{AnalysisExtension.YAML.value}') +REMOTE_INFO_FILE_REGEX = re.compile(f'([a-z]+)-remote-info{AnalysisExtension.YAML.value}') -def parse_course_config(base_path: str, inner_folder: str) -> dict: - full_path = f'{base_path}/{inner_folder}' - if not exists(full_path): - raise ValueError(f'The {inner_folder} does not exist in {base_path}!') - return parse_yaml(full_path) +def filter_by_course_id_and_save(df_path: Path, course_id: int): + initial_df = read_df(df_path) + filtered_df = filter_df_by_single_value(initial_df, EduColumnName.COURSE_ID.value, course_id) + write_df(filtered_df, df_path.parent / f'course_{course_id}{AnalysisExtension.CSV.value}') -def _parse_yaml_section(yaml_config_parsed: dict, yaml_section: str, file_path: str) -> Any: - if yaml_section not in yaml_config_parsed: - raise ValueError(f'You need to specify {yaml_section} section in the {file_path} file!') - return yaml_config_parsed[yaml_section] +def _gather_structure(root: Path) -> EduStructureNode: # noqa: WPS238 + file_names = listdir(root) + info_files = list(filter(lambda file_name: re.match(INFO_FILE_REGEX, file_name), file_names)) + if len(info_files) != 1: + raise ValueError(f'The number of info files in {root} must be exactly 1 (actual: {len(info_files)}).') -def _parse_edu_config_item(base_path: str, nested_folder_name: str, item_type: str, - is_terminal: bool = False) -> EduConfigItem: - current_path = f'{base_path}/{nested_folder_name}' + info_file = info_files[0] + info_file_structure_type = re.match(INFO_FILE_REGEX, info_file).group(1) - item_remote_info_file_name = f'{item_type}-remote-info{AnalysisExtension.YAML.value}' - item_remote_info_parsed = parse_course_config(current_path, item_remote_info_file_name) - item_id = _parse_yaml_section(item_remote_info_parsed, ID_FIELD, - f'{current_path}/{item_remote_info_file_name}') + remote_info_files = list(filter(lambda file_name: re.match(REMOTE_INFO_FILE_REGEX, file_name), file_names)) + if len(remote_info_files) != 1: + raise ValueError( + f'The number of remote info files in {root} must be exactly 1 (actual: {len(remote_info_files)}).', + ) - if is_terminal: - nested_items = None - else: - item_info_file_name = f'{item_type}-info{AnalysisExtension.YAML.value}' - item_info_parsed = parse_course_config(current_path, item_info_file_name) - nested_items = _parse_yaml_section(item_info_parsed, CONTENT_FIELD, - f'{current_path}/{item_info_file_name}') + remote_info_file = remote_info_files[0] + remote_info_file_structure_type = re.match(REMOTE_INFO_FILE_REGEX, remote_info_file).group(1) - return EduConfigItem(item_id, nested_folder_name, item_type, nested_items) + if info_file_structure_type != remote_info_file_structure_type: + raise ValueError(f'Unable to determine a structure type for {root}.') + structure_type = EduStructureType(info_file_structure_type) -def filter_by_course_id_and_save(df_path: str, course_id: int) -> Path: - initial_df = read_df(df_path) - filtered_df = filter_df_by_single_value(initial_df, EduColumnName.COURSE_ID.value, course_id) - output_folder = get_parent_folder(df_path, to_add_slash=True) - new_path = f'{output_folder}/course_{course_id}{AnalysisExtension.CSV.value}' - write_df(filtered_df, new_path) - return output_folder - - -def _gather_course_structure(course_root_path: str) -> pd.DataFrame: - course_info_file_name = f'course-info{AnalysisExtension.YAML.value}' - course_root_path_without_slash = remove_slash(course_root_path) - course_info_parsed = parse_course_config(course_root_path_without_slash, course_info_file_name) - sections = _parse_yaml_section(course_info_parsed, CONTENT_FIELD, course_root_path_without_slash) - headers = [ - EduColumnName.TASK_GLOBAL_NUMBER.value, - EduColumnName.TASK_ID.value, EduColumnName.TASK_NAME.value, EduColumnName.TASK_NUMBER.value, - EduColumnName.TASKS_AMOUNT.value, - EduColumnName.LESSON_ID.value, EduColumnName.LESSON_NAME.value, EduColumnName.LESSON_NUMBER.value, - EduColumnName.LESSONS_AMOUNT.value, - EduColumnName.SECTION_ID.value, EduColumnName.SECTION_NAME.value, EduColumnName.SECTION_NUMBER.value, - EduColumnName.SECTIONS_AMOUNT.value, - ] - rows = [] - sections_amount = len(sections) - task_global_number = 0 - for i, section in enumerate(sections): - section_parsed = _parse_edu_config_item(course_root_path_without_slash, section, 'section') - current_section_path = f'{course_root_path_without_slash}/{section}' - lessons_amount = len(section_parsed.nested_items) - for j, lesson in enumerate(section_parsed.nested_items): - lesson_parsed = _parse_edu_config_item(current_section_path, lesson, 'lesson') - current_lesson_path = f'{current_section_path}/{lesson}' - tasks_amount = len(lesson_parsed.nested_items) - for k, task in enumerate(lesson_parsed.nested_items): - task_parsed = _parse_edu_config_item(current_lesson_path, task, 'task', is_terminal=True) - # task_global_number - # task_id, task_name, task_number, tasks_amount, - # lesson_id, lesson_name, lesson_number, lessons_amount, - # section_id, section_name, section_number, sections_amount - task_global_number += 1 - rows.append([ - task_global_number, - task_parsed.id, task_parsed.name, k + 1, tasks_amount, - lesson_parsed.id, lesson_parsed.name, j + 1, lessons_amount, - section_parsed.id, section_parsed.name, i + 1, sections_amount - ]) - return pd.DataFrame(rows, columns=headers) + structure_id = read_yaml_field_content(root / remote_info_file, ID_META_FIELD) + if structure_id is None: + raise ValueError(f'{root / remote_info_file} must contain the {ID_META_FIELD} field.') + + children = None + content = read_yaml_field_content(root / info_file, CONTENT_META_FIELD) + if content is not None: + children = [_gather_structure(root / name) for name in content] + + if not all([node.structure_type == children[0].structure_type for node in children]): + raise ValueError(f'All children nodes inside {root} must have the same structure type.') + + return EduStructureNode(structure_id, root.name, structure_type, children) + + +def _convert_structure_to_dataframe(structure: EduStructureNode) -> pd.DataFrame: + if structure.children is None: + # If node has no content, then it is a task node + return pd.DataFrame.from_dict( + {f'{EduColumnName.TASK_ID.value}': [structure.id], f'{EduColumnName.TASK_NAME.value}': [structure.name]} + ) + + children_dfs = [] + for i, node in enumerate(structure.children, start=1): + node_df = _convert_structure_to_dataframe(node) + node_df[f'{node.structure_type.value}_{NUMBER_COLUMN_POSTFIX}'] = i + node_df[f'{node.structure_type.value}_{AMOUNT_COLUMN_POSTFIX}'] = len(structure.children) + children_dfs.append(node_df) + + structure_df = pd.concat(children_dfs, ignore_index=True) + structure_df[f'{structure.structure_type.value}_{ID_COLUMN_POSTFIX}'] = structure.id + structure_df[f'{structure.structure_type.value}_{NAME_COLUMN_POSTFIX}'] = structure.name + + return structure_df + + +def get_course_structure(course_root: Path) -> pd.DataFrame: + course_structure = _gather_structure(course_root) + course_structure_df = _convert_structure_to_dataframe(course_structure) + + # Removing unnecessary column + course_structure_df.drop( + columns=[f'{EduStructureType.COURSE.value}_{NAME_COLUMN_POSTFIX}', EduColumnName.COURSE_ID.value], + inplace=True, + ) + + # Adding the "task global number" column + course_structure_df.index += 1 + course_structure_df.reset_index(inplace=True, names=[EduColumnName.TASK_GLOBAL_NUMBER.value]) + + return course_structure_df def configure_parser(parser: argparse.ArgumentParser) -> None: - parser.add_argument('data_path', type=str, help='Path to .csv file with collected data.') + parser.add_argument( + 'submissions_path', + type=lambda value: Path(value).absolute(), + help='Path to .csv file with collected data.', + ) + parser.add_argument('course_id', type=int, help='Course id to analyze.') - parser.add_argument('course_sources_path', type=str, help='Path to course sources to extract course structure.') + + parser.add_argument( + 'course_sources_path', + type=lambda value: Path(value).absolute(), + help='Path to course sources to extract course structure.', + ) def main(): parser = argparse.ArgumentParser() configure_parser(parser) - args = parser.parse_args(sys.argv[1:]) - output_path = filter_by_course_id_and_save(args.data_path, args.course_id) - tasks_info_df = _gather_course_structure(args.course_sources_path) - write_df(tasks_info_df, f'{output_path}/course_{args.course_id}_structure{AnalysisExtension.CSV.value}') + args = parser.parse_args() + + filter_by_course_id_and_save(args.data_path, args.course_id) + + course_structure = get_course_structure(args.course_sources_path) + write_df(course_structure, get_output_path(args.data_path, '-with-structure')) if __name__ == '__main__': diff --git a/jba/src/test_logs/tests_runner.py b/jba/src/test_logs/tests_runner.py index e7fd840..fe8254f 100644 --- a/jba/src/test_logs/tests_runner.py +++ b/jba/src/test_logs/tests_runner.py @@ -15,10 +15,10 @@ from core.src.utils.df_utils import read_df from core.src.utils.file.extension_utils import AnalysisExtension from core.src.utils.file.file_utils import create_file +from core.src.utils.file.yaml_utils import read_yaml_field_content from core.src.utils.parsing_utils import str_to_datetime from core.src.utils.subprocess_runner import run_in_subprocess from jba.src.models.edu_columns import EduColumnName, EduConfigField, EduCodeSnippetField -from jba.src.processing.prepare_course_data import parse_course_config logger = logging.getLogger(__name__) @@ -108,11 +108,12 @@ def _check_submission( course_root_path / ('' if section_name is None else section_name) / lesson_name / task_name # noqa: WPS509 ) - task_config = parse_course_config(task_root_path, f'task-info{AnalysisExtension.YAML.value}') + files_info = read_yaml_field_content( + task_root_path / f'task-info{AnalysisExtension.YAML.value}', EduConfigField.FILES.value + ) + visible_files = { - file_info[EduConfigField.NAME.value] - for file_info in task_config[EduConfigField.FILES.value] - if file_info[EduConfigField.VISIBLE.value] + file_info[EduConfigField.NAME.value] for file_info in files_info if file_info[EduConfigField.VISIBLE.value] } logger.debug(f'Visible files for submission#{submission_id}: {visible_files}') diff --git a/jba/tests/processing/__init__.py b/jba/tests/processing/__init__.py index 4234eec..3bf9aea 100644 --- a/jba/tests/processing/__init__.py +++ b/jba/tests/processing/__init__.py @@ -1,3 +1,5 @@ from jba.tests import TEST_DATA_FOLDER PROCESSING_FOLDER = TEST_DATA_FOLDER / 'processing' + +PREPARE_COURSE_DATA_FOLDER = PROCESSING_FOLDER / 'prepare_course_data' diff --git a/jba/tests/processing/data_processing/__init__.py b/jba/tests/processing/data_processing/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/jba/tests/processing/data_processing/test_gathering_course_structure.py b/jba/tests/processing/data_processing/test_gathering_course_structure.py deleted file mode 100644 index 3802bbc..0000000 --- a/jba/tests/processing/data_processing/test_gathering_course_structure.py +++ /dev/null @@ -1,19 +0,0 @@ -import pytest - -from core.src.utils.df_utils import read_df, equal_df -from jba.src.processing.prepare_course_data import _gather_course_structure -from jba.tests.processing import PROCESSING_FOLDER - -COURSE_TEST_DATA = [ - ( - (PROCESSING_FOLDER / 'course_example'), - (PROCESSING_FOLDER / 'course_1_structure_expected.csv') - ) -] - - -@pytest.mark.parametrize(('course_root', 'expected_table'), COURSE_TEST_DATA) -def test_to_cleanup_semantic(course_root: str, expected_table: str): - tasks_info_df = _gather_course_structure(course_root) - expected_df = read_df(expected_table) - equal_df(expected_df, tasks_info_df) diff --git a/jba/tests/processing/data_processing/test_run_prepare_course_data.py b/jba/tests/processing/data_processing/test_run_prepare_course_data.py deleted file mode 100644 index 2929048..0000000 --- a/jba/tests/processing/data_processing/test_run_prepare_course_data.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys - -from core.src.utils.subprocess_runner import run_in_subprocess -from jba.src import MAIN_FOLDER - - -def test_incorrect_arguments(): - command = [sys.executable, (MAIN_FOLDER.parent / 'processing' / 'prepare_course_data.py')] - - stdout, stderr = run_in_subprocess(command) - - assert stdout == '' - assert 'error: the following arguments are required' in stderr diff --git a/jba/tests/processing/test_prepare_course_data.py b/jba/tests/processing/test_prepare_course_data.py new file mode 100644 index 0000000..e4b6843 --- /dev/null +++ b/jba/tests/processing/test_prepare_course_data.py @@ -0,0 +1,221 @@ +import sys +from pathlib import Path + +import pytest + +from core.src.utils.df_utils import read_df +from core.src.utils.subprocess_runner import run_in_subprocess +from jba.src import MAIN_FOLDER +from jba.src.models.edu_structure import EduStructureNode, EduStructureType +from jba.src.processing.prepare_course_data import ( + _gather_structure, + ID_META_FIELD, + _convert_structure_to_dataframe, + get_course_structure, +) +from jba.tests.processing import PREPARE_COURSE_DATA_FOLDER +from pandas._testing import assert_frame_equal + + +COURSE_WITH_SECTION_STRUCTURE = EduStructureNode( + 1, + 'course_with_section', + EduStructureType.COURSE, + [ + EduStructureNode( + 2, + 'section', + EduStructureType.SECTION, + [ + EduStructureNode( + 3, + 'lesson', + EduStructureType.LESSON, + [ + EduStructureNode(4, 'task1', EduStructureType.TASK, None), + EduStructureNode(5, 'task2', EduStructureType.TASK, None), + EduStructureNode(6, 'task3', EduStructureType.TASK, None), + ], + ) + ], + ), + ], +) + + +COURSE_WITHOUT_SECTION_STRUCTURE = EduStructureNode( + 1, + 'course_without_section', + EduStructureType.COURSE, + [ + EduStructureNode( + 3, + 'lesson', + EduStructureType.LESSON, + [ + EduStructureNode(4, 'task1', EduStructureType.TASK, None), + EduStructureNode(5, 'task2', EduStructureType.TASK, None), + EduStructureNode(6, 'task3', EduStructureType.TASK, None), + ], + ) + ], +) + + +GATHER_STRUCTURE_TEST_DATA = [ + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_section', + COURSE_WITH_SECTION_STRUCTURE, + ), + ( + PREPARE_COURSE_DATA_FOLDER / 'course_without_section', + COURSE_WITHOUT_SECTION_STRUCTURE, + ), +] + + +@pytest.mark.parametrize(('course_root', 'expected_structure'), GATHER_STRUCTURE_TEST_DATA) +def test_gather_structure(course_root: Path, expected_structure: EduStructureNode): + actual_structure = _gather_structure(course_root) + assert actual_structure == expected_structure + + +GATHER_STRUCTURE_THROWS_TEST_DATA = [ + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_incorrect_number_of_info_files', + r'The number of info files in .+ must be exactly 1 \(actual: 2\)\.', + ), + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_incorrect_number_of_remote_info_files', + r'The number of remote info files in .+ must be exactly 1 \(actual: 2\)\.', + ), + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_undefined_structure_type', + r'Unable to determine a structure type for .+\.', + ), + (PREPARE_COURSE_DATA_FOLDER / 'course_with_incorrect_id_field', rf'.+ must contain the {ID_META_FIELD} field\.'), + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_inconsistent_children', + r'All children nodes inside .+ must have the same structure type\.', + ), + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_unknown_structure_type', + "'unknown' is not a valid EduStructureType", + ), +] + + +@pytest.mark.parametrize(('course_root', 'expected_message'), GATHER_STRUCTURE_THROWS_TEST_DATA) +def test_gather_structure_throws(course_root: Path, expected_message: str): + with pytest.raises(ValueError, match=expected_message): + _gather_structure(course_root) + + +CONVERT_STRUCTURE_TO_DATAFRAME_TEST_DATA = [ + ( + COURSE_WITH_SECTION_STRUCTURE, + PREPARE_COURSE_DATA_FOLDER / 'expected_course_with_section_df_structure.csv', + ), + ( + COURSE_WITHOUT_SECTION_STRUCTURE, + PREPARE_COURSE_DATA_FOLDER / 'expected_course_without_section_df_structure.csv', + ), + ( + EduStructureNode( + 1, + 'big_course', + EduStructureType.COURSE, + [ + EduStructureNode( + 2, + 'section1', + EduStructureType.SECTION, + [ + EduStructureNode( + 4, + 'lesson1', + EduStructureType.LESSON, + [ + EduStructureNode(10, 'task1', EduStructureType.TASK, None), + EduStructureNode(11, 'task2', EduStructureType.TASK, None), + ], + ), + EduStructureNode( + 5, + 'lesson2', + EduStructureType.LESSON, + [ + EduStructureNode(12, 'task1', EduStructureType.TASK, None), + EduStructureNode(13, 'task2', EduStructureType.TASK, None), + ], + ), + EduStructureNode( + 6, + 'lesson3', + EduStructureType.LESSON, + [ + EduStructureNode(14, 'task1', EduStructureType.TASK, None), + EduStructureNode(15, 'task2', EduStructureType.TASK, None), + ], + ), + ], + ), + EduStructureNode( + 3, + 'section2', + EduStructureType.SECTION, + [ + EduStructureNode( + 7, + 'lesson1', + EduStructureType.LESSON, + [ + EduStructureNode(16, 'task1', EduStructureType.TASK, None), + ], + ), + EduStructureNode( + 8, + 'lesson2', + EduStructureType.LESSON, + [ + EduStructureNode(17, 'task1', EduStructureType.TASK, None), + EduStructureNode(18, 'task2', EduStructureType.TASK, None), + EduStructureNode(19, 'task3', EduStructureType.TASK, None), + ], + ), + ], + ), + ], + ), + PREPARE_COURSE_DATA_FOLDER / 'expected_big_course_df_structure.csv', + ), +] + + +@pytest.mark.parametrize(('structure', 'expected_df_path'), CONVERT_STRUCTURE_TO_DATAFRAME_TEST_DATA) +def test_convert_structure_to_dataframe(structure: EduStructureNode, expected_df_path: Path): + assert_frame_equal(_convert_structure_to_dataframe(structure), read_df(expected_df_path)) + + +GET_COURSE_STRUCTURE_TEST_DATA = [ + ( + PREPARE_COURSE_DATA_FOLDER / 'course_with_section', + PREPARE_COURSE_DATA_FOLDER / 'expected_course_with_section.csv', + ), + ( + PREPARE_COURSE_DATA_FOLDER / 'course_without_section', + PREPARE_COURSE_DATA_FOLDER / 'expected_course_without_section.csv', + ), +] + + +@pytest.mark.parametrize(('course_root', 'expected_structure_path'), GET_COURSE_STRUCTURE_TEST_DATA) +def test_get_course_structure(course_root: Path, expected_structure_path: Path): + assert_frame_equal(get_course_structure(course_root), read_df(expected_structure_path)) + + +def test_incorrect_arguments(): + stdout, stderr = run_in_subprocess([sys.executable, (MAIN_FOLDER.parent / 'processing' / 'prepare_course_data.py')]) + + assert stdout == '' + assert 'error: the following arguments are required' in stderr diff --git a/jba/tests/processing/data_processing/test_run_data_processing.py b/jba/tests/processing/test_run_data_processing.py similarity index 100% rename from jba/tests/processing/data_processing/test_run_data_processing.py rename to jba/tests/processing/test_run_data_processing.py diff --git a/jba/tests/resources/processing/course_1_structure_expected.csv b/jba/tests/resources/processing/course_1_structure_expected.csv deleted file mode 100644 index 92e0c4f..0000000 --- a/jba/tests/resources/processing/course_1_structure_expected.csv +++ /dev/null @@ -1,3 +0,0 @@ -task_global_number,task_id,task_name,task_number,tasks_amount,lesson_id,lesson_name,lesson_number,lessons_amount,section_id,section_name,section_number,sections_amount -1,4,task1,1,2,3,lesson,1,1,2,section,1,1 -2,5,task2,2,2,3,lesson,1,1,2,section,1,1 diff --git a/jba/tests/resources/processing/course_example/section/lesson/task1/task-info.yaml b/jba/tests/resources/processing/course_example/section/lesson/task1/task-info.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/jba/tests/resources/processing/course_example/section/lesson/task2/task-info.yaml b/jba/tests/resources/processing/course_example/section/lesson/task2/task-info.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/course_example/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/course-remote-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/course-remote-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/course-remote-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson-info.yaml new file mode 100644 index 0000000..bbeb04c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson-info.yaml @@ -0,0 +1,3 @@ +content: +- task1 +- lesson2 diff --git a/jba/tests/resources/processing/course_example/section/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson-remote-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/section/lesson/lesson-remote-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson-remote-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/lesson-info.yaml new file mode 100644 index 0000000..a2c8416 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/lesson-info.yaml @@ -0,0 +1,2 @@ +content: +- task_2 \ No newline at end of file diff --git a/jba/tests/resources/processing/course_example/section/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/lesson-remote-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/section/lesson/task2/task-remote-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/lesson-remote-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task-remote-info.yaml new file mode 100644 index 0000000..8689b7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 6 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/lesson2/task_2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/course_example/section/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task-remote-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/section/lesson/task1/task-remote-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task-remote-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_inconsistent_children/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/course_example/section/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/lesson-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/section/lesson/lesson-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/lesson-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/lesson-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/lesson-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..728e6a1 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +this_is_not_an_id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_id_field/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/lesson-info.yaml new file mode 100644 index 0000000..d985e45 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/lesson-info.yaml @@ -0,0 +1,3 @@ +content: +- task1 +- task2 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/lesson-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/lesson-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/course_example/section/section-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/section-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/section/section-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/section-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..7035f7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_info_files/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/lesson-info.yaml new file mode 100644 index 0000000..d985e45 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/lesson-info.yaml @@ -0,0 +1,3 @@ +content: +- task1 +- task2 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/lesson-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/lesson-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/section-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/section-remote-info.yaml new file mode 100644 index 0000000..c75ab65 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/section-remote-info.yaml @@ -0,0 +1 @@ +id: 2 \ No newline at end of file diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..7035f7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_incorrect_number_of_remote_info_files/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/course_example/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/course-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/course-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_section/course-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/lesson-info.yaml new file mode 100644 index 0000000..84806ad --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/lesson-info.yaml @@ -0,0 +1,4 @@ +content: +- task1 +- task2 +- task3 \ No newline at end of file diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/lesson-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/lesson-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..7035f7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task-info.yaml new file mode 100644 index 0000000..b99161f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №3 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task-remote-info.yaml new file mode 100644 index 0000000..8689b7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task-remote-info.yaml @@ -0,0 +1 @@ +id: 6 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/lesson/task3/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_section/section/section-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/section-info.yaml new file mode 100644 index 0000000..a60749b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/section-info.yaml @@ -0,0 +1,2 @@ +content: +- lesson diff --git a/jba/tests/resources/processing/course_example/section/section-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_section/section/section-remote-info.yaml similarity index 100% rename from jba/tests/resources/processing/course_example/section/section-remote-info.yaml rename to jba/tests/resources/processing/prepare_course_data/course_with_section/section/section-remote-info.yaml diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/lesson-info.yaml new file mode 100644 index 0000000..d985e45 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/lesson-info.yaml @@ -0,0 +1,3 @@ +content: +- task1 +- task2 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..7035f7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_undefined_structure_type/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/lesson-info.yaml new file mode 100644 index 0000000..d29fc5e --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/lesson-info.yaml @@ -0,0 +1,3 @@ +content: +- unknown +- task2 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/lesson-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/lesson-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..7035f7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/unknown/unknown-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/unknown/unknown-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/unknown/unknown-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/unknown/unknown-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/unknown/unknown-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_with_unknown_structure_type/lesson/unknown/unknown-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/course-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/course-info.yaml new file mode 100644 index 0000000..9d8bbca --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/course-info.yaml @@ -0,0 +1,5 @@ +type: marketplace +title: "title" +programming_language: Kotlin +content: +- lesson diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/course-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/course-remote-info.yaml new file mode 100644 index 0000000..b78d2c3 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/course-remote-info.yaml @@ -0,0 +1 @@ +id: 1 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/lesson-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/lesson-info.yaml new file mode 100644 index 0000000..b095640 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/lesson-info.yaml @@ -0,0 +1,4 @@ +content: +- task1 +- task2 +- task3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/lesson-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/lesson-remote-info.yaml new file mode 100644 index 0000000..0fb44c9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/lesson-remote-info.yaml @@ -0,0 +1 @@ +id: 3 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task-info.yaml new file mode 100644 index 0000000..085f94c --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task-info.yaml @@ -0,0 +1,5 @@ +type: theory +custom_name: Task №1 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task-remote-info.yaml new file mode 100644 index 0000000..8392b5d --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task-remote-info.yaml @@ -0,0 +1 @@ +id: 4 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task.md b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task.md new file mode 100644 index 0000000..537fb71 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task1/task.md @@ -0,0 +1,2 @@ +# This is a theory task +This is a description for the theory task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task-info.yaml new file mode 100644 index 0000000..9dd3a21 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №2 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task-remote-info.yaml new file mode 100644 index 0000000..7035f7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task-remote-info.yaml @@ -0,0 +1 @@ +id: 5 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task.md b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task2/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/src/main/kotlin/Main.kt b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/src/main/kotlin/Main.kt new file mode 100644 index 0000000..d315da9 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/src/main/kotlin/Main.kt @@ -0,0 +1,3 @@ +fun main() { + println("My first program!") +} diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task-info.yaml new file mode 100644 index 0000000..b99161f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task-info.yaml @@ -0,0 +1,5 @@ +type: edu +custom_name: Task №3 +files: +- name: src/main/kotlin/Main.kt + visible: true diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task-remote-info.yaml b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task-remote-info.yaml new file mode 100644 index 0000000..8689b7f --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task-remote-info.yaml @@ -0,0 +1 @@ +id: 6 diff --git a/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task.md b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task.md new file mode 100644 index 0000000..59eec3b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/course_without_section/lesson/task3/task.md @@ -0,0 +1,2 @@ +# This is an edu task +This is a description for the edu task. diff --git a/jba/tests/resources/processing/prepare_course_data/expected_big_course_df_structure.csv b/jba/tests/resources/processing/prepare_course_data/expected_big_course_df_structure.csv new file mode 100644 index 0000000..7d30b29 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/expected_big_course_df_structure.csv @@ -0,0 +1,11 @@ +task_id,task_name,task_number,task_amount,lesson_id,lesson_name,lesson_number,lesson_amount,section_id,section_name,section_number,section_amount,course_id,course_name +10,task1,1,2,4,lesson1,1,3,2,section1,1,2,1,big_course +11,task2,2,2,4,lesson1,1,3,2,section1,1,2,1,big_course +12,task1,1,2,5,lesson2,2,3,2,section1,1,2,1,big_course +13,task2,2,2,5,lesson2,2,3,2,section1,1,2,1,big_course +14,task1,1,2,6,lesson3,3,3,2,section1,1,2,1,big_course +15,task2,2,2,6,lesson3,3,3,2,section1,1,2,1,big_course +16,task1,1,1,7,lesson1,1,2,3,section2,2,2,1,big_course +17,task1,1,3,8,lesson2,2,2,3,section2,2,2,1,big_course +18,task2,2,3,8,lesson2,2,2,3,section2,2,2,1,big_course +19,task3,3,3,8,lesson2,2,2,3,section2,2,2,1,big_course \ No newline at end of file diff --git a/jba/tests/resources/processing/prepare_course_data/expected_course_with_section.csv b/jba/tests/resources/processing/prepare_course_data/expected_course_with_section.csv new file mode 100644 index 0000000..72cd166 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/expected_course_with_section.csv @@ -0,0 +1,4 @@ +task_global_number,task_id,task_name,task_number,task_amount,lesson_id,lesson_name,lesson_number,lesson_amount,section_id,section_name,section_number,section_amount +1,4,task1,1,3,3,lesson,1,1,2,section,1,1 +2,5,task2,2,3,3,lesson,1,1,2,section,1,1 +3,6,task3,3,3,3,lesson,1,1,2,section,1,1 \ No newline at end of file diff --git a/jba/tests/resources/processing/prepare_course_data/expected_course_with_section_df_structure.csv b/jba/tests/resources/processing/prepare_course_data/expected_course_with_section_df_structure.csv new file mode 100644 index 0000000..76e7e1b --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/expected_course_with_section_df_structure.csv @@ -0,0 +1,4 @@ +task_id,task_name,task_number,task_amount,lesson_id,lesson_name,lesson_number,lesson_amount,section_id,section_name,section_number,section_amount,course_id,course_name +4,task1,1,3,3,lesson,1,1,2,section,1,1,1,course_with_section +5,task2,2,3,3,lesson,1,1,2,section,1,1,1,course_with_section +6,task3,3,3,3,lesson,1,1,2,section,1,1,1,course_with_section \ No newline at end of file diff --git a/jba/tests/resources/processing/prepare_course_data/expected_course_without_section.csv b/jba/tests/resources/processing/prepare_course_data/expected_course_without_section.csv new file mode 100644 index 0000000..78cb5a1 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/expected_course_without_section.csv @@ -0,0 +1,4 @@ +task_global_number,task_id,task_name,task_number,task_amount,lesson_id,lesson_name,lesson_number,lesson_amount +1,4,task1,1,3,3,lesson,1,1 +2,5,task2,2,3,3,lesson,1,1 +3,6,task3,3,3,3,lesson,1,1 \ No newline at end of file diff --git a/jba/tests/resources/processing/prepare_course_data/expected_course_without_section_df_structure.csv b/jba/tests/resources/processing/prepare_course_data/expected_course_without_section_df_structure.csv new file mode 100644 index 0000000..3050871 --- /dev/null +++ b/jba/tests/resources/processing/prepare_course_data/expected_course_without_section_df_structure.csv @@ -0,0 +1,4 @@ +task_id,task_name,task_number,task_amount,lesson_id,lesson_name,lesson_number,lesson_amount,course_id,course_name +4,task1,1,3,3,lesson,1,1,1,course_without_section +5,task2,2,3,3,lesson,1,1,1,course_without_section +6,task3,3,3,3,lesson,1,1,1,course_without_section \ No newline at end of file diff --git a/spellcheck_whitelist.txt b/spellcheck_whitelist.txt index 3da2d39..3c92f75 100644 --- a/spellcheck_whitelist.txt +++ b/spellcheck_whitelist.txt @@ -82,6 +82,7 @@ pathlib plotly plt pos +postfix postprocess preprocess preprocessed