course-format-ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/edu-format-ts.iml +10 -0
- package/.idea/inspectionProfiles/Project_Default.xml +28 -0
- package/.idea/misc.xml +4 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/AGENTS.md +1 -0
- package/dist/courseFormat/AnswerPlaceholder.d.ts +37 -0
- package/dist/courseFormat/AnswerPlaceholder.js +101 -0
- package/dist/courseFormat/AnswerPlaceholderComparator.d.ts +4 -0
- package/dist/courseFormat/AnswerPlaceholderComparator.js +8 -0
- package/dist/courseFormat/AnswerPlaceholderDependency.d.ts +19 -0
- package/dist/courseFormat/AnswerPlaceholderDependency.js +91 -0
- package/dist/courseFormat/CheckFeedback.d.ts +20 -0
- package/dist/courseFormat/CheckFeedback.js +58 -0
- package/dist/courseFormat/CheckResult.d.ts +33 -0
- package/dist/courseFormat/CheckResult.js +58 -0
- package/dist/courseFormat/CheckResultSeverity.d.ts +7 -0
- package/dist/courseFormat/CheckResultSeverity.js +17 -0
- package/dist/courseFormat/CheckStatus.d.ts +5 -0
- package/dist/courseFormat/CheckStatus.js +9 -0
- package/dist/courseFormat/Course.d.ts +68 -0
- package/dist/courseFormat/Course.js +165 -0
- package/dist/courseFormat/CourseMode.d.ts +4 -0
- package/dist/courseFormat/CourseMode.js +8 -0
- package/dist/courseFormat/CourseVisibility.d.ts +4 -0
- package/dist/courseFormat/CourseVisibility.js +8 -0
- package/dist/courseFormat/CourseraCourse.d.ts +5 -0
- package/dist/courseFormat/CourseraCourse.js +15 -0
- package/dist/courseFormat/DescriptionFormat.d.ts +5 -0
- package/dist/courseFormat/DescriptionFormat.js +9 -0
- package/dist/courseFormat/EduCourse.d.ts +17 -0
- package/dist/courseFormat/EduCourse.js +42 -0
- package/dist/courseFormat/EduFile.d.ts +22 -0
- package/dist/courseFormat/EduFile.js +110 -0
- package/dist/courseFormat/EduFileErrorHighlightLevel.d.ts +5 -0
- package/dist/courseFormat/EduFileErrorHighlightLevel.js +9 -0
- package/dist/courseFormat/EduFormatNames.d.ts +75 -0
- package/dist/courseFormat/EduFormatNames.js +80 -0
- package/dist/courseFormat/EduTestInfo.d.ts +28 -0
- package/dist/courseFormat/EduTestInfo.js +68 -0
- package/dist/courseFormat/EduVersions.d.ts +2 -0
- package/dist/courseFormat/EduVersions.js +5 -0
- package/dist/courseFormat/FileContents.d.ts +36 -0
- package/dist/courseFormat/FileContents.js +67 -0
- package/dist/courseFormat/FileContentsFactory.d.ts +17 -0
- package/dist/courseFormat/FileContentsFactory.js +2 -0
- package/dist/courseFormat/FrameworkLesson.d.ts +9 -0
- package/dist/courseFormat/FrameworkLesson.js +28 -0
- package/dist/courseFormat/ItemContainer.d.ts +13 -0
- package/dist/courseFormat/ItemContainer.js +45 -0
- package/dist/courseFormat/JBAccountUserInfo.d.ts +9 -0
- package/dist/courseFormat/JBAccountUserInfo.js +20 -0
- package/dist/courseFormat/Language.d.ts +4 -0
- package/dist/courseFormat/Language.js +33 -0
- package/dist/courseFormat/Lesson.d.ts +20 -0
- package/dist/courseFormat/Lesson.js +56 -0
- package/dist/courseFormat/LessonContainer.d.ts +16 -0
- package/dist/courseFormat/LessonContainer.js +54 -0
- package/dist/courseFormat/PluginInfo.d.ts +7 -0
- package/dist/courseFormat/PluginInfo.js +15 -0
- package/dist/courseFormat/Section.d.ts +8 -0
- package/dist/courseFormat/Section.js +27 -0
- package/dist/courseFormat/StudyItem.d.ts +20 -0
- package/dist/courseFormat/StudyItem.js +47 -0
- package/dist/courseFormat/Tags.d.ts +16 -0
- package/dist/courseFormat/Tags.js +42 -0
- package/dist/courseFormat/TaskFile.d.ts +26 -0
- package/dist/courseFormat/TaskFile.js +72 -0
- package/dist/courseFormat/UserInfo.d.ts +3 -0
- package/dist/courseFormat/UserInfo.js +2 -0
- package/dist/courseFormat/Vendor.d.ts +7 -0
- package/dist/courseFormat/Vendor.js +14 -0
- package/dist/courseFormat/attempts/Attempt.d.ts +12 -0
- package/dist/courseFormat/attempts/Attempt.js +25 -0
- package/dist/courseFormat/attempts/AttemptBase.d.ts +9 -0
- package/dist/courseFormat/attempts/AttemptBase.js +28 -0
- package/dist/courseFormat/attempts/DataTaskAttempt.d.ts +6 -0
- package/dist/courseFormat/attempts/DataTaskAttempt.js +24 -0
- package/dist/courseFormat/attempts/Dataset.d.ts +12 -0
- package/dist/courseFormat/attempts/Dataset.js +21 -0
- package/dist/courseFormat/fileUtils.d.ts +5 -0
- package/dist/courseFormat/fileUtils.js +32 -0
- package/dist/courseFormat/hyperskill/HyperskillCourse.d.ts +13 -0
- package/dist/courseFormat/hyperskill/HyperskillCourse.js +25 -0
- package/dist/courseFormat/hyperskill/HyperskillProject.d.ts +10 -0
- package/dist/courseFormat/hyperskill/HyperskillProject.js +16 -0
- package/dist/courseFormat/hyperskill/HyperskillStage.d.ts +8 -0
- package/dist/courseFormat/hyperskill/HyperskillStage.js +20 -0
- package/dist/courseFormat/hyperskill/HyperskillTaskType.d.ts +4 -0
- package/dist/courseFormat/hyperskill/HyperskillTaskType.js +26 -0
- package/dist/courseFormat/hyperskill/HyperskillTopic.d.ts +5 -0
- package/dist/courseFormat/hyperskill/HyperskillTopic.js +11 -0
- package/dist/courseFormat/loggerUtils.d.ts +1 -0
- package/dist/courseFormat/loggerUtils.js +6 -0
- package/dist/courseFormat/stepik/StepikCourse.d.ts +5 -0
- package/dist/courseFormat/stepik/StepikCourse.js +15 -0
- package/dist/courseFormat/stepik/StepikLesson.d.ts +6 -0
- package/dist/courseFormat/stepik/StepikLesson.js +16 -0
- package/dist/courseFormat/tasks/AnswerTask.d.ts +8 -0
- package/dist/courseFormat/tasks/AnswerTask.js +11 -0
- package/dist/courseFormat/tasks/CodeTask.d.ts +12 -0
- package/dist/courseFormat/tasks/CodeTask.js +21 -0
- package/dist/courseFormat/tasks/DataTask.d.ts +18 -0
- package/dist/courseFormat/tasks/DataTask.js +32 -0
- package/dist/courseFormat/tasks/EduTask.d.ts +12 -0
- package/dist/courseFormat/tasks/EduTask.js +22 -0
- package/dist/courseFormat/tasks/IdeTask.d.ts +9 -0
- package/dist/courseFormat/tasks/IdeTask.js +14 -0
- package/dist/courseFormat/tasks/NumberTask.d.ts +9 -0
- package/dist/courseFormat/tasks/NumberTask.js +14 -0
- package/dist/courseFormat/tasks/OutputTask.d.ts +10 -0
- package/dist/courseFormat/tasks/OutputTask.js +18 -0
- package/dist/courseFormat/tasks/OutputTaskBase.d.ts +14 -0
- package/dist/courseFormat/tasks/OutputTaskBase.js +19 -0
- package/dist/courseFormat/tasks/RemoteEduTask.d.ts +9 -0
- package/dist/courseFormat/tasks/RemoteEduTask.js +15 -0
- package/dist/courseFormat/tasks/StringTask.d.ts +9 -0
- package/dist/courseFormat/tasks/StringTask.js +14 -0
- package/dist/courseFormat/tasks/TableTask.d.ts +17 -0
- package/dist/courseFormat/tasks/TableTask.js +43 -0
- package/dist/courseFormat/tasks/Task.d.ts +45 -0
- package/dist/courseFormat/tasks/Task.js +155 -0
- package/dist/courseFormat/tasks/TheoryTask.d.ts +10 -0
- package/dist/courseFormat/tasks/TheoryTask.js +15 -0
- package/dist/courseFormat/tasks/UnsupportedTask.d.ts +9 -0
- package/dist/courseFormat/tasks/UnsupportedTask.js +14 -0
- package/dist/courseFormat/tasks/choice/ChoiceOption.d.ts +10 -0
- package/dist/courseFormat/tasks/choice/ChoiceOption.js +33 -0
- package/dist/courseFormat/tasks/choice/ChoiceOptionStatus.d.ts +5 -0
- package/dist/courseFormat/tasks/choice/ChoiceOptionStatus.js +9 -0
- package/dist/courseFormat/tasks/choice/ChoiceTask.d.ts +23 -0
- package/dist/courseFormat/tasks/choice/ChoiceTask.js +47 -0
- package/dist/courseFormat/tasks/matching/MatchingTask.d.ts +10 -0
- package/dist/courseFormat/tasks/matching/MatchingTask.js +15 -0
- package/dist/courseFormat/tasks/matching/SortingBasedTask.d.ts +16 -0
- package/dist/courseFormat/tasks/matching/SortingBasedTask.js +50 -0
- package/dist/courseFormat/tasks/matching/SortingTask.d.ts +9 -0
- package/dist/courseFormat/tasks/matching/SortingTask.js +14 -0
- package/dist/courseFormat/uiMessages.d.ts +3 -0
- package/dist/courseFormat/uiMessages.js +14 -0
- package/dist/disk-loader.d.ts +4 -0
- package/dist/disk-loader.js +389 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +64 -0
- package/dist/loader.d.ts +7 -0
- package/dist/loader.js +435 -0
- package/dist/models.d.ts +49 -0
- package/dist/models.js +2 -0
- package/dist/zip-loader.d.ts +4 -0
- package/dist/zip-loader.js +431 -0
- package/example-course-project/course-info.yaml +15 -0
- package/example-course-project/lesson1/lesson-info.yaml +3 -0
- package/example-course-project/lesson1/lesson-remote-info.yaml +1 -0
- package/example-course-project/lesson1/task1/Task.txt +1 -0
- package/example-course-project/lesson1/task1/task-info.yaml +12 -0
- package/example-course-project/lesson1/task1/task-remote-info.yaml +1 -0
- package/example-course-project/lesson1/task1/task.md +47 -0
- package/example-course-project/lesson1/task1/tests/Tests.txt +0 -0
- package/example-course-project/lesson1/task2/Task.txt +1 -0
- package/example-course-project/lesson1/task2/task-info.yaml +12 -0
- package/example-course-project/lesson1/task2/task-remote-info.yaml +1 -0
- package/example-course-project/lesson1/task2/task.md +47 -0
- package/example-course-project/lesson1/task2/tests/Tests.txt +0 -0
- package/package.json +19 -0
- package/src/@types/mime-types.d.ts +3 -0
- package/src/courseFormat/AnswerPlaceholder.ts +121 -0
- package/src/courseFormat/AnswerPlaceholderComparator.ts +7 -0
- package/src/courseFormat/AnswerPlaceholderDependency.ts +122 -0
- package/src/courseFormat/CheckFeedback.ts +71 -0
- package/src/courseFormat/CheckResult.ts +92 -0
- package/src/courseFormat/CheckResultSeverity.ts +13 -0
- package/src/courseFormat/CheckStatus.ts +5 -0
- package/src/courseFormat/Course.ts +201 -0
- package/src/courseFormat/CourseMode.ts +4 -0
- package/src/courseFormat/CourseVisibility.ts +4 -0
- package/src/courseFormat/CourseraCourse.ts +10 -0
- package/src/courseFormat/DescriptionFormat.ts +5 -0
- package/src/courseFormat/EduCourse.ts +41 -0
- package/src/courseFormat/EduFile.ts +133 -0
- package/src/courseFormat/EduFileErrorHighlightLevel.ts +5 -0
- package/src/courseFormat/EduFormatNames.ts +95 -0
- package/src/courseFormat/EduTestInfo.ts +87 -0
- package/src/courseFormat/EduVersions.ts +2 -0
- package/src/courseFormat/FileContents.ts +97 -0
- package/src/courseFormat/FileContentsFactory.ts +19 -0
- package/src/courseFormat/FrameworkLesson.ts +29 -0
- package/src/courseFormat/ItemContainer.ts +47 -0
- package/src/courseFormat/JBAccountUserInfo.ts +21 -0
- package/src/courseFormat/Language.ts +31 -0
- package/src/courseFormat/Lesson.ts +69 -0
- package/src/courseFormat/LessonContainer.ts +65 -0
- package/src/courseFormat/PluginInfo.ts +15 -0
- package/src/courseFormat/Section.ts +29 -0
- package/src/courseFormat/StudyItem.ts +55 -0
- package/src/courseFormat/Tags.ts +45 -0
- package/src/courseFormat/TaskFile.ts +88 -0
- package/src/courseFormat/UserInfo.ts +3 -0
- package/src/courseFormat/Vendor.ts +15 -0
- package/src/courseFormat/attempts/Attempt.ts +28 -0
- package/src/courseFormat/attempts/AttemptBase.ts +24 -0
- package/src/courseFormat/attempts/DataTaskAttempt.ts +19 -0
- package/src/courseFormat/attempts/Dataset.ts +13 -0
- package/src/courseFormat/fileUtils.ts +31 -0
- package/src/courseFormat/hyperskill/HyperskillCourse.ts +24 -0
- package/src/courseFormat/hyperskill/HyperskillProject.ts +10 -0
- package/src/courseFormat/hyperskill/HyperskillStage.ts +15 -0
- package/src/courseFormat/hyperskill/HyperskillTaskType.ts +23 -0
- package/src/courseFormat/hyperskill/HyperskillTopic.ts +5 -0
- package/src/courseFormat/loggerUtils.ts +3 -0
- package/src/courseFormat/stepik/StepikCourse.ts +10 -0
- package/src/courseFormat/stepik/StepikLesson.ts +11 -0
- package/src/courseFormat/tasks/AnswerTask.ts +13 -0
- package/src/courseFormat/tasks/CodeTask.ts +42 -0
- package/src/courseFormat/tasks/DataTask.ts +37 -0
- package/src/courseFormat/tasks/EduTask.ts +26 -0
- package/src/courseFormat/tasks/IdeTask.ts +17 -0
- package/src/courseFormat/tasks/NumberTask.ts +17 -0
- package/src/courseFormat/tasks/OutputTask.ts +21 -0
- package/src/courseFormat/tasks/OutputTaskBase.ts +23 -0
- package/src/courseFormat/tasks/RemoteEduTask.ts +18 -0
- package/src/courseFormat/tasks/StringTask.ts +17 -0
- package/src/courseFormat/tasks/TableTask.ts +51 -0
- package/src/courseFormat/tasks/Task.ts +181 -0
- package/src/courseFormat/tasks/TheoryTask.ts +19 -0
- package/src/courseFormat/tasks/UnsupportedTask.ts +17 -0
- package/src/courseFormat/tasks/choice/ChoiceOption.ts +37 -0
- package/src/courseFormat/tasks/choice/ChoiceOptionStatus.ts +5 -0
- package/src/courseFormat/tasks/choice/ChoiceTask.ts +57 -0
- package/src/courseFormat/tasks/matching/MatchingTask.ts +19 -0
- package/src/courseFormat/tasks/matching/SortingBasedTask.ts +59 -0
- package/src/courseFormat/tasks/matching/SortingTask.ts +17 -0
- package/src/courseFormat/uiMessages.ts +12 -0
- package/src/disk-loader.ts +463 -0
- package/src/index.ts +33 -0
- package/src/models.ts +54 -0
- package/src/zip-loader.ts +583 -0
- package/test/load-course.test.js +279 -0
- package/test/load-zip-course.test.js +73 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/edu-format" />
|
|
6
|
+
</content>
|
|
7
|
+
<orderEntry type="inheritedJdk" />
|
|
8
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
9
|
+
</component>
|
|
10
|
+
</module>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
+
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
|
6
|
+
<option name="ignoredErrors">
|
|
7
|
+
<list>
|
|
8
|
+
<option value="N806" />
|
|
9
|
+
</list>
|
|
10
|
+
</option>
|
|
11
|
+
</inspection_tool>
|
|
12
|
+
<inspection_tool class="PyStringConversionWithoutDunderMethodInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
|
13
|
+
<option name="reportedTypes">
|
|
14
|
+
<list>
|
|
15
|
+
<option value="types.FunctionType" />
|
|
16
|
+
<option value="type" />
|
|
17
|
+
</list>
|
|
18
|
+
</option>
|
|
19
|
+
</inspection_tool>
|
|
20
|
+
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
21
|
+
<option name="ignoredIdentifiers">
|
|
22
|
+
<list>
|
|
23
|
+
<option value="PySide2.QtCore.QAbstractItemModel.*" />
|
|
24
|
+
</list>
|
|
25
|
+
</option>
|
|
26
|
+
</inspection_tool>
|
|
27
|
+
</profile>
|
|
28
|
+
</component>
|
package/.idea/misc.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/edu-format-ts.iml" filepath="$PROJECT_DIR$/.idea/edu-format-ts.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/AGENTS.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This library is a ts version for JetBrains Academy format.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CheckStatus } from "./CheckStatus";
|
|
2
|
+
import { TaskFile } from "./TaskFile";
|
|
3
|
+
import { AnswerPlaceholderDependency } from "./AnswerPlaceholderDependency";
|
|
4
|
+
export declare class AnswerPlaceholder {
|
|
5
|
+
offset: number;
|
|
6
|
+
length: number;
|
|
7
|
+
index: number;
|
|
8
|
+
private _initialState?;
|
|
9
|
+
private _taskFile?;
|
|
10
|
+
placeholderDependency?: AnswerPlaceholderDependency;
|
|
11
|
+
isInitializedFromDependency: boolean;
|
|
12
|
+
possibleAnswer: string;
|
|
13
|
+
placeholderText: string;
|
|
14
|
+
selected: boolean;
|
|
15
|
+
status: CheckStatus;
|
|
16
|
+
isVisible: boolean;
|
|
17
|
+
studentAnswer?: string;
|
|
18
|
+
constructor();
|
|
19
|
+
constructor(offset: number, placeholderText: string);
|
|
20
|
+
get initialState(): MyInitialState;
|
|
21
|
+
set initialState(value: MyInitialState);
|
|
22
|
+
get taskFile(): TaskFile;
|
|
23
|
+
set taskFile(value: TaskFile);
|
|
24
|
+
init(file: TaskFile, isRestarted: boolean): void;
|
|
25
|
+
reset(revertStartOffset: boolean): void;
|
|
26
|
+
initEmpty(): void;
|
|
27
|
+
get isCurrentlyVisible(): boolean;
|
|
28
|
+
get shouldBeVisible(): boolean;
|
|
29
|
+
isValid(textLength: number): boolean;
|
|
30
|
+
get endOffset(): number;
|
|
31
|
+
toString(): string;
|
|
32
|
+
}
|
|
33
|
+
export declare class MyInitialState {
|
|
34
|
+
length: number;
|
|
35
|
+
offset: number;
|
|
36
|
+
constructor(initialOffset?: number, initialLength?: number);
|
|
37
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MyInitialState = exports.AnswerPlaceholder = void 0;
|
|
4
|
+
const CheckStatus_1 = require("./CheckStatus");
|
|
5
|
+
class AnswerPlaceholder {
|
|
6
|
+
constructor(offset, placeholderText) {
|
|
7
|
+
this.offset = -1;
|
|
8
|
+
this.length = -1;
|
|
9
|
+
this.index = -1;
|
|
10
|
+
this.isInitializedFromDependency = false;
|
|
11
|
+
this.possibleAnswer = "";
|
|
12
|
+
this.placeholderText = "";
|
|
13
|
+
this.selected = false;
|
|
14
|
+
this.status = CheckStatus_1.CheckStatus.Unchecked;
|
|
15
|
+
this.isVisible = true;
|
|
16
|
+
if (offset !== undefined && placeholderText !== undefined) {
|
|
17
|
+
this.offset = offset;
|
|
18
|
+
this.length = placeholderText.length;
|
|
19
|
+
this.placeholderText = placeholderText;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
get initialState() {
|
|
23
|
+
if (!this._initialState) {
|
|
24
|
+
throw new Error("No initial state for answer placeholder");
|
|
25
|
+
}
|
|
26
|
+
return this._initialState;
|
|
27
|
+
}
|
|
28
|
+
set initialState(value) {
|
|
29
|
+
this._initialState = value;
|
|
30
|
+
}
|
|
31
|
+
get taskFile() {
|
|
32
|
+
if (!this._taskFile) {
|
|
33
|
+
throw new Error(`Task file is null for answer placeholder`);
|
|
34
|
+
}
|
|
35
|
+
return this._taskFile;
|
|
36
|
+
}
|
|
37
|
+
set taskFile(value) {
|
|
38
|
+
this._taskFile = value;
|
|
39
|
+
}
|
|
40
|
+
init(file, isRestarted) {
|
|
41
|
+
this.taskFile = file;
|
|
42
|
+
if (isRestarted)
|
|
43
|
+
return;
|
|
44
|
+
if (this.placeholderDependency) {
|
|
45
|
+
this.placeholderDependency.answerPlaceholder = this;
|
|
46
|
+
}
|
|
47
|
+
this.initialState = new MyInitialState(this.offset, this.length);
|
|
48
|
+
this.status = file.task.status;
|
|
49
|
+
}
|
|
50
|
+
reset(revertStartOffset) {
|
|
51
|
+
if (revertStartOffset) {
|
|
52
|
+
this.offset = this.initialState.offset;
|
|
53
|
+
}
|
|
54
|
+
this.length = this.initialState.length;
|
|
55
|
+
this.status = CheckStatus_1.CheckStatus.Unchecked;
|
|
56
|
+
this.isInitializedFromDependency = false;
|
|
57
|
+
}
|
|
58
|
+
initEmpty() {
|
|
59
|
+
this.initialState = new MyInitialState(this.offset, this.placeholderText.length);
|
|
60
|
+
}
|
|
61
|
+
get isCurrentlyVisible() {
|
|
62
|
+
let result = this.shouldBeVisible;
|
|
63
|
+
if (this.placeholderDependency) {
|
|
64
|
+
result = result || !this.isInitializedFromDependency;
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
get shouldBeVisible() {
|
|
69
|
+
if (!this.placeholderDependency) {
|
|
70
|
+
return this.isVisible;
|
|
71
|
+
}
|
|
72
|
+
return this.isVisible && this.placeholderDependency.isVisible;
|
|
73
|
+
}
|
|
74
|
+
isValid(textLength) {
|
|
75
|
+
return this.offset >= 0 && this.length >= 0 && this.endOffset <= textLength;
|
|
76
|
+
}
|
|
77
|
+
get endOffset() {
|
|
78
|
+
return this.offset + this.length;
|
|
79
|
+
}
|
|
80
|
+
toString() {
|
|
81
|
+
const task = this.taskFile.task;
|
|
82
|
+
const lesson = task.lesson;
|
|
83
|
+
const section = lesson.section;
|
|
84
|
+
const sectionPrefix = section ? `${section.name}#` : "";
|
|
85
|
+
return `${sectionPrefix}${lesson.name}#${task.name}#${this.taskFile.name}[${this.offset}, ${this.endOffset}]`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.AnswerPlaceholder = AnswerPlaceholder;
|
|
89
|
+
class MyInitialState {
|
|
90
|
+
constructor(initialOffset, initialLength) {
|
|
91
|
+
this.length = -1;
|
|
92
|
+
this.offset = -1;
|
|
93
|
+
if (initialOffset !== undefined) {
|
|
94
|
+
this.offset = initialOffset;
|
|
95
|
+
}
|
|
96
|
+
if (initialLength !== undefined) {
|
|
97
|
+
this.length = initialLength;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.MyInitialState = MyInitialState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AnswerPlaceholder } from "./AnswerPlaceholder";
|
|
2
|
+
import { Course } from "./Course";
|
|
3
|
+
export declare class AnswerPlaceholderDependency {
|
|
4
|
+
sectionName?: string;
|
|
5
|
+
lessonName: string;
|
|
6
|
+
taskName: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
placeholderIndex: number;
|
|
9
|
+
isVisible: boolean;
|
|
10
|
+
answerPlaceholder: AnswerPlaceholder;
|
|
11
|
+
constructor(answerPlaceholder?: AnswerPlaceholder, sectionName?: string | null, lessonName?: string, taskName?: string, fileName?: string, placeholderIndex?: number, isVisible?: boolean);
|
|
12
|
+
resolve(course: Course): AnswerPlaceholder | undefined;
|
|
13
|
+
toString(): string;
|
|
14
|
+
static create(answerPlaceholder: AnswerPlaceholder, text: string): AnswerPlaceholderDependency | null;
|
|
15
|
+
}
|
|
16
|
+
export declare class InvalidDependencyException extends Error {
|
|
17
|
+
readonly customMessage: string;
|
|
18
|
+
constructor(dependencyText: string, customMessage?: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidDependencyException = exports.AnswerPlaceholderDependency = void 0;
|
|
4
|
+
const uiMessages_1 = require("./uiMessages");
|
|
5
|
+
const DEPENDENCY_PATTERN = /(([^#]+)#)?([^#]+)#([^#]+)#([^#]+)#(\d+)/;
|
|
6
|
+
class AnswerPlaceholderDependency {
|
|
7
|
+
constructor(answerPlaceholder, sectionName, lessonName = "", taskName = "", fileName = "", placeholderIndex = 0, isVisible = true) {
|
|
8
|
+
this.lessonName = "";
|
|
9
|
+
this.taskName = "";
|
|
10
|
+
this.fileName = "";
|
|
11
|
+
this.placeholderIndex = 0;
|
|
12
|
+
this.isVisible = true;
|
|
13
|
+
if (answerPlaceholder) {
|
|
14
|
+
this.answerPlaceholder = answerPlaceholder;
|
|
15
|
+
}
|
|
16
|
+
this.sectionName = sectionName !== null && sectionName !== void 0 ? sectionName : undefined;
|
|
17
|
+
this.lessonName = lessonName;
|
|
18
|
+
this.taskName = taskName;
|
|
19
|
+
this.fileName = fileName;
|
|
20
|
+
this.placeholderIndex = placeholderIndex;
|
|
21
|
+
this.isVisible = isVisible;
|
|
22
|
+
}
|
|
23
|
+
resolve(course) {
|
|
24
|
+
const lesson = course.getLesson(this.sectionName, this.lessonName);
|
|
25
|
+
const task = lesson === null || lesson === void 0 ? void 0 : lesson.getTask(this.taskName);
|
|
26
|
+
const taskFile = task === null || task === void 0 ? void 0 : task.getTaskFile(this.fileName);
|
|
27
|
+
return taskFile === null || taskFile === void 0 ? void 0 : taskFile.answerPlaceholders[this.placeholderIndex];
|
|
28
|
+
}
|
|
29
|
+
toString() {
|
|
30
|
+
const section = this.sectionName ? `${this.sectionName}#` : "";
|
|
31
|
+
return `${section}${this.lessonName}#${this.taskName}#${this.fileName}#${this.placeholderIndex + 1}`;
|
|
32
|
+
}
|
|
33
|
+
static create(answerPlaceholder, text) {
|
|
34
|
+
if (!text.trim()) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const task = answerPlaceholder.taskFile.task;
|
|
38
|
+
const match = text.match(DEPENDENCY_PATTERN);
|
|
39
|
+
if (!match) {
|
|
40
|
+
throw new InvalidDependencyException(text);
|
|
41
|
+
}
|
|
42
|
+
const sectionName = match[2];
|
|
43
|
+
const lessonName = match[3];
|
|
44
|
+
const taskName = match[4];
|
|
45
|
+
const filePath = toSystemIndependent(match[5]);
|
|
46
|
+
const placeholderIndex = Number.parseInt(match[6], 10) - 1;
|
|
47
|
+
if (Number.isNaN(placeholderIndex)) {
|
|
48
|
+
throw new InvalidDependencyException(text);
|
|
49
|
+
}
|
|
50
|
+
const dependency = new AnswerPlaceholderDependency(answerPlaceholder, sectionName, lessonName, taskName, filePath, placeholderIndex, true);
|
|
51
|
+
const targetPlaceholder = dependency.resolve(task.course);
|
|
52
|
+
if (!targetPlaceholder) {
|
|
53
|
+
throw new InvalidDependencyException(text, (0, uiMessages_1.message)("exception.placeholder.non.existing"));
|
|
54
|
+
}
|
|
55
|
+
if (targetPlaceholder.taskFile.task === task) {
|
|
56
|
+
throw new InvalidDependencyException(text, (0, uiMessages_1.message)("exception.placeholder.wrong.reference.to.source"));
|
|
57
|
+
}
|
|
58
|
+
if (refersToNextTask(task, targetPlaceholder.taskFile.task)) {
|
|
59
|
+
throw new InvalidDependencyException(text, (0, uiMessages_1.message)("exception.placeholder.wrong.reference.to.next"));
|
|
60
|
+
}
|
|
61
|
+
return dependency;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.AnswerPlaceholderDependency = AnswerPlaceholderDependency;
|
|
65
|
+
class InvalidDependencyException extends Error {
|
|
66
|
+
constructor(dependencyText, customMessage) {
|
|
67
|
+
super(customMessage
|
|
68
|
+
? `'${dependencyText}' is not a valid placeholder dependency\n${customMessage}`
|
|
69
|
+
: `'${dependencyText}' is not a valid placeholder dependency`);
|
|
70
|
+
this.customMessage = customMessage !== null && customMessage !== void 0 ? customMessage : (0, uiMessages_1.message)("exception.placeholder.invalid.dependency");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.InvalidDependencyException = InvalidDependencyException;
|
|
74
|
+
function toSystemIndependent(pathValue) {
|
|
75
|
+
return pathValue.replace(/\\/g, "/");
|
|
76
|
+
}
|
|
77
|
+
function refersToNextTask(sourceTask, targetTask) {
|
|
78
|
+
const sourceLesson = sourceTask.lesson;
|
|
79
|
+
const targetLesson = targetTask.lesson;
|
|
80
|
+
if (sourceLesson === targetLesson) {
|
|
81
|
+
return targetTask.index > sourceTask.index;
|
|
82
|
+
}
|
|
83
|
+
if (sourceLesson.section === targetLesson.section) {
|
|
84
|
+
return targetLesson.index > sourceLesson.index;
|
|
85
|
+
}
|
|
86
|
+
return getIndexInCourse(targetLesson) > getIndexInCourse(sourceLesson);
|
|
87
|
+
}
|
|
88
|
+
function getIndexInCourse(lesson) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
return (_b = (_a = lesson.section) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : lesson.index;
|
|
91
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CheckResult } from "./CheckResult";
|
|
2
|
+
import { CheckStatus } from "./CheckStatus";
|
|
3
|
+
import { EduTestInfo } from "./EduTestInfo";
|
|
4
|
+
export declare class CheckFeedback {
|
|
5
|
+
readonly failedTestInfo?: EduTestInfo;
|
|
6
|
+
readonly time?: Date;
|
|
7
|
+
private _message;
|
|
8
|
+
private _expected?;
|
|
9
|
+
private _actual?;
|
|
10
|
+
constructor(failedTestInfo?: EduTestInfo | null, time?: Date | null);
|
|
11
|
+
static fromMessage(message: string, time?: Date | null, expected?: string | null, actual?: string | null): CheckFeedback;
|
|
12
|
+
static fromCheckResult(time: Date, checkResult: CheckResult): CheckFeedback;
|
|
13
|
+
get message(): string;
|
|
14
|
+
set message(value: string);
|
|
15
|
+
get expected(): string | undefined;
|
|
16
|
+
set expected(value: string | undefined);
|
|
17
|
+
get actual(): string | undefined;
|
|
18
|
+
set actual(value: string | undefined);
|
|
19
|
+
toCheckResult(status: CheckStatus): CheckResult;
|
|
20
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckFeedback = void 0;
|
|
4
|
+
const CheckResult_1 = require("./CheckResult");
|
|
5
|
+
const loggerUtils_1 = require("./loggerUtils");
|
|
6
|
+
class CheckFeedback {
|
|
7
|
+
constructor(failedTestInfo, time) {
|
|
8
|
+
this._message = "";
|
|
9
|
+
this.failedTestInfo = failedTestInfo !== null && failedTestInfo !== void 0 ? failedTestInfo : undefined;
|
|
10
|
+
this.time = time !== null && time !== void 0 ? time : undefined;
|
|
11
|
+
}
|
|
12
|
+
static fromMessage(message, time, expected, actual) {
|
|
13
|
+
const feedback = new CheckFeedback(undefined, time !== null && time !== void 0 ? time : undefined);
|
|
14
|
+
feedback.message = message;
|
|
15
|
+
feedback.expected = expected !== null && expected !== void 0 ? expected : undefined;
|
|
16
|
+
feedback.actual = actual !== null && actual !== void 0 ? actual : undefined;
|
|
17
|
+
return feedback;
|
|
18
|
+
}
|
|
19
|
+
static fromCheckResult(time, checkResult) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const feedback = new CheckFeedback(checkResult.executedTestsInfo[0], time);
|
|
22
|
+
feedback.expected = (_a = checkResult.diffResolved) === null || _a === void 0 ? void 0 : _a.expected;
|
|
23
|
+
feedback.actual = (_b = checkResult.diffResolved) === null || _b === void 0 ? void 0 : _b.actual;
|
|
24
|
+
feedback.message = checkResult.messageResolved;
|
|
25
|
+
return feedback;
|
|
26
|
+
}
|
|
27
|
+
get message() {
|
|
28
|
+
var _a;
|
|
29
|
+
return this._message || ((_a = this.failedTestInfo) === null || _a === void 0 ? void 0 : _a.message) || "";
|
|
30
|
+
}
|
|
31
|
+
set message(value) {
|
|
32
|
+
this._message = value;
|
|
33
|
+
}
|
|
34
|
+
get expected() {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
return (_a = this._expected) !== null && _a !== void 0 ? _a : (_c = (_b = this.failedTestInfo) === null || _b === void 0 ? void 0 : _b.checkResultDiff) === null || _c === void 0 ? void 0 : _c.expected;
|
|
37
|
+
}
|
|
38
|
+
set expected(value) {
|
|
39
|
+
this._expected = value;
|
|
40
|
+
}
|
|
41
|
+
get actual() {
|
|
42
|
+
var _a, _b, _c;
|
|
43
|
+
return (_a = this._actual) !== null && _a !== void 0 ? _a : (_c = (_b = this.failedTestInfo) === null || _b === void 0 ? void 0 : _b.checkResultDiff) === null || _c === void 0 ? void 0 : _c.actual;
|
|
44
|
+
}
|
|
45
|
+
set actual(value) {
|
|
46
|
+
this._actual = value;
|
|
47
|
+
}
|
|
48
|
+
toCheckResult(status) {
|
|
49
|
+
const expected = this.expected;
|
|
50
|
+
const actual = this.actual;
|
|
51
|
+
if ((expected === undefined && actual !== undefined) || (expected !== undefined && actual === undefined)) {
|
|
52
|
+
(0, loggerUtils_1.logger)("CheckFeedback").warn("Expected/Actual: one value is missing. Second value would be ignored");
|
|
53
|
+
}
|
|
54
|
+
const diff = expected !== undefined && actual !== undefined ? new CheckResult_1.CheckResultDiff(expected, actual) : undefined;
|
|
55
|
+
return new CheckResult_1.CheckResult(status, this.message, undefined, diff);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.CheckFeedback = CheckFeedback;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CheckResultSeverity } from "./CheckResultSeverity";
|
|
2
|
+
import { CheckStatus } from "./CheckStatus";
|
|
3
|
+
import { EduTestInfo } from "./EduTestInfo";
|
|
4
|
+
export declare class CheckResult {
|
|
5
|
+
readonly status: CheckStatus;
|
|
6
|
+
readonly severity: CheckResultSeverity;
|
|
7
|
+
readonly hyperlinkAction?: () => void;
|
|
8
|
+
readonly executedTestsInfo: EduTestInfo[];
|
|
9
|
+
private readonly firstFailedTest?;
|
|
10
|
+
details?: string;
|
|
11
|
+
diff?: CheckResultDiff;
|
|
12
|
+
messageText: string;
|
|
13
|
+
constructor(status: CheckStatus, messageText?: string, details?: string | null, diff?: CheckResultDiff | null, severity?: CheckResultSeverity, hyperlinkAction?: (() => void) | null, executedTestsInfo?: EduTestInfo[]);
|
|
14
|
+
get fullMessage(): string;
|
|
15
|
+
get isSolved(): boolean;
|
|
16
|
+
get detailsResolved(): string | undefined;
|
|
17
|
+
get diffResolved(): CheckResultDiff | undefined;
|
|
18
|
+
get messageResolved(): string;
|
|
19
|
+
static NO_LOCAL_CHECK: CheckResult;
|
|
20
|
+
static LOGIN_NEEDED: CheckResult;
|
|
21
|
+
static CONNECTION_FAILED: CheckResult;
|
|
22
|
+
static SOLVED: CheckResult;
|
|
23
|
+
static CANCELED: CheckResult;
|
|
24
|
+
static UNCHECKED: CheckResult;
|
|
25
|
+
static get noTestsRun(): CheckResult;
|
|
26
|
+
static get failedToCheck(): CheckResult;
|
|
27
|
+
}
|
|
28
|
+
export declare class CheckResultDiff {
|
|
29
|
+
readonly expected: string;
|
|
30
|
+
readonly actual: string;
|
|
31
|
+
readonly title: string;
|
|
32
|
+
constructor(expected: string, actual: string, title?: string);
|
|
33
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckResultDiff = exports.CheckResult = void 0;
|
|
4
|
+
const CheckResultSeverity_1 = require("./CheckResultSeverity");
|
|
5
|
+
const CheckStatus_1 = require("./CheckStatus");
|
|
6
|
+
const EduFormatNames_1 = require("./EduFormatNames");
|
|
7
|
+
const uiMessages_1 = require("./uiMessages");
|
|
8
|
+
class CheckResult {
|
|
9
|
+
constructor(status, messageText = "", details, diff, severity = CheckResultSeverity_1.CheckResultSeverity.Info, hyperlinkAction, executedTestsInfo = []) {
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.severity = severity;
|
|
12
|
+
this.hyperlinkAction = hyperlinkAction !== null && hyperlinkAction !== void 0 ? hyperlinkAction : undefined;
|
|
13
|
+
this.executedTestsInfo = executedTestsInfo;
|
|
14
|
+
this.firstFailedTest = this.executedTestsInfo.find((test) => !test.isSuccess);
|
|
15
|
+
this.details = details !== null && details !== void 0 ? details : undefined;
|
|
16
|
+
this.diff = diff !== null && diff !== void 0 ? diff : undefined;
|
|
17
|
+
this.messageText = messageText;
|
|
18
|
+
}
|
|
19
|
+
get fullMessage() {
|
|
20
|
+
return this.details ? `${this.messageText}\n\n${this.details}` : this.messageText;
|
|
21
|
+
}
|
|
22
|
+
get isSolved() {
|
|
23
|
+
return this.status === CheckStatus_1.CheckStatus.Solved;
|
|
24
|
+
}
|
|
25
|
+
get detailsResolved() {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
return (_a = this.details) !== null && _a !== void 0 ? _a : (_b = this.firstFailedTest) === null || _b === void 0 ? void 0 : _b.details;
|
|
28
|
+
}
|
|
29
|
+
get diffResolved() {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
return (_a = this.diff) !== null && _a !== void 0 ? _a : (_b = this.firstFailedTest) === null || _b === void 0 ? void 0 : _b.checkResultDiff;
|
|
32
|
+
}
|
|
33
|
+
get messageResolved() {
|
|
34
|
+
var _a;
|
|
35
|
+
return this.messageText || ((_a = this.firstFailedTest) === null || _a === void 0 ? void 0 : _a.message) || "";
|
|
36
|
+
}
|
|
37
|
+
static get noTestsRun() {
|
|
38
|
+
return new CheckResult(CheckStatus_1.CheckStatus.Unchecked, (0, uiMessages_1.message)("check.no.tests.with.help.guide", EduFormatNames_1.NO_TESTS_URL));
|
|
39
|
+
}
|
|
40
|
+
static get failedToCheck() {
|
|
41
|
+
return new CheckResult(CheckStatus_1.CheckStatus.Unchecked, (0, uiMessages_1.message)("error.failed.to.launch.checking.with.help.guide", EduFormatNames_1.FAILED_TO_CHECK_URL));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.CheckResult = CheckResult;
|
|
45
|
+
CheckResult.NO_LOCAL_CHECK = new CheckResult(CheckStatus_1.CheckStatus.Unchecked, (0, uiMessages_1.message)("check.result.local.check.unavailable"));
|
|
46
|
+
CheckResult.LOGIN_NEEDED = new CheckResult(CheckStatus_1.CheckStatus.Unchecked, EduFormatNames_1.LOGIN_NEEDED_MESSAGE);
|
|
47
|
+
CheckResult.CONNECTION_FAILED = new CheckResult(CheckStatus_1.CheckStatus.Unchecked, (0, uiMessages_1.message)("check.result.connection.failed"));
|
|
48
|
+
CheckResult.SOLVED = new CheckResult(CheckStatus_1.CheckStatus.Solved);
|
|
49
|
+
CheckResult.CANCELED = new CheckResult(CheckStatus_1.CheckStatus.Unchecked, (0, uiMessages_1.message)("check.result.canceled"));
|
|
50
|
+
CheckResult.UNCHECKED = new CheckResult(CheckStatus_1.CheckStatus.Unchecked);
|
|
51
|
+
class CheckResultDiff {
|
|
52
|
+
constructor(expected, actual, title = "") {
|
|
53
|
+
this.expected = expected;
|
|
54
|
+
this.actual = actual;
|
|
55
|
+
this.title = title;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.CheckResultDiff = CheckResultDiff;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckResultSeverity = void 0;
|
|
4
|
+
exports.isWarning = isWarning;
|
|
5
|
+
exports.isInfo = isInfo;
|
|
6
|
+
var CheckResultSeverity;
|
|
7
|
+
(function (CheckResultSeverity) {
|
|
8
|
+
CheckResultSeverity["Info"] = "Info";
|
|
9
|
+
CheckResultSeverity["Warning"] = "Warning";
|
|
10
|
+
CheckResultSeverity["Error"] = "Error";
|
|
11
|
+
})(CheckResultSeverity || (exports.CheckResultSeverity = CheckResultSeverity = {}));
|
|
12
|
+
function isWarning(severity) {
|
|
13
|
+
return severity === CheckResultSeverity.Warning;
|
|
14
|
+
}
|
|
15
|
+
function isInfo(severity) {
|
|
16
|
+
return severity === CheckResultSeverity.Info;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckStatus = void 0;
|
|
4
|
+
var CheckStatus;
|
|
5
|
+
(function (CheckStatus) {
|
|
6
|
+
CheckStatus["Unchecked"] = "Unchecked";
|
|
7
|
+
CheckStatus["Failed"] = "Failed";
|
|
8
|
+
CheckStatus["Solved"] = "Solved";
|
|
9
|
+
})(CheckStatus || (exports.CheckStatus = CheckStatus = {}));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LessonContainer } from "./LessonContainer";
|
|
2
|
+
import { CourseMode } from "./CourseMode";
|
|
3
|
+
import { CourseVisibility } from "./CourseVisibility";
|
|
4
|
+
import { EduFile } from "./EduFile";
|
|
5
|
+
import { PluginInfo } from "./PluginInfo";
|
|
6
|
+
import { UserInfo } from "./UserInfo";
|
|
7
|
+
import { Vendor } from "./Vendor";
|
|
8
|
+
import { Lesson } from "./Lesson";
|
|
9
|
+
import { Section } from "./Section";
|
|
10
|
+
import { ItemContainer } from "./ItemContainer";
|
|
11
|
+
export declare abstract class Course extends LessonContainer {
|
|
12
|
+
description: string;
|
|
13
|
+
environment: string;
|
|
14
|
+
environmentSettings: Record<string, string>;
|
|
15
|
+
courseMode: CourseMode;
|
|
16
|
+
solutionsHidden: boolean;
|
|
17
|
+
disabledFeatures: string[];
|
|
18
|
+
visibility: CourseVisibility;
|
|
19
|
+
additionalFiles: EduFile[];
|
|
20
|
+
pluginDependencies: PluginInfo[];
|
|
21
|
+
private nonEditableFiles;
|
|
22
|
+
authors: UserInfo[];
|
|
23
|
+
isLocal: boolean;
|
|
24
|
+
needWriteYamlText: boolean;
|
|
25
|
+
languageCode: string;
|
|
26
|
+
get type(): string;
|
|
27
|
+
get title(): string;
|
|
28
|
+
set title(value: string);
|
|
29
|
+
get language(): string;
|
|
30
|
+
get content(): Lesson[];
|
|
31
|
+
isMarketplace: boolean;
|
|
32
|
+
vendor?: Vendor;
|
|
33
|
+
marketplaceCourseVersion: number;
|
|
34
|
+
organization?: string;
|
|
35
|
+
isMarketplacePrivate: boolean;
|
|
36
|
+
createDate: Date;
|
|
37
|
+
feedbackLink?: string;
|
|
38
|
+
license?: string;
|
|
39
|
+
customContentPath: string;
|
|
40
|
+
private _languageId;
|
|
41
|
+
languageVersion?: string;
|
|
42
|
+
private _programmingLanguage;
|
|
43
|
+
get programmingLanguage(): string;
|
|
44
|
+
set programmingLanguage(value: string | null);
|
|
45
|
+
get languageId(): string;
|
|
46
|
+
set languageId(value: string);
|
|
47
|
+
initCourse(isRestarted: boolean): void;
|
|
48
|
+
init(parentItem: ItemContainer, isRestarted: boolean): void;
|
|
49
|
+
getLesson(sectionName?: string, lessonName?: string): Lesson | undefined;
|
|
50
|
+
getLesson(param?: string | number | ((lesson: Lesson) => boolean)): Lesson | undefined;
|
|
51
|
+
get sections(): Section[];
|
|
52
|
+
addSection(section: Section): void;
|
|
53
|
+
removeSection(section: Section): void;
|
|
54
|
+
getSection(name: string): Section | undefined;
|
|
55
|
+
getSection(predicate: (section: Section) => boolean): Section | undefined;
|
|
56
|
+
get course(): Course;
|
|
57
|
+
get itemType(): string;
|
|
58
|
+
get isStudy(): boolean;
|
|
59
|
+
sortItems(): void;
|
|
60
|
+
toString(): string;
|
|
61
|
+
get authorFullNames(): string[];
|
|
62
|
+
get humanLanguage(): string;
|
|
63
|
+
get isStepikRemote(): boolean;
|
|
64
|
+
incrementMarketplaceCourseVersion(remoteCourseVersion: number): void;
|
|
65
|
+
isEditableFile(path: string): boolean;
|
|
66
|
+
addNonEditableFile(path?: string | null): void;
|
|
67
|
+
removeNonEditableFile(path?: string | null): void;
|
|
68
|
+
}
|