@dataclouder/ngx-lessons 0.0.33 → 0.0.34
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/fesm2022/dataclouder-ngx-lessons.mjs +373 -107
- package/fesm2022/dataclouder-ngx-lessons.mjs.map +1 -1
- package/lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component.d.ts +0 -7
- package/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.d.ts +19 -3
- package/lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component.d.ts +5 -1
- package/lib/components/dc-lessons/dc-lesson-renderer/eval-agents-skills.d.ts +1 -0
- package/lib/components/lesson-mini-components/components/lessons.clases.d.ts +8 -0
- package/lib/services/default-lessons.service.d.ts +18 -0
- package/lib/services/lesson-utils.service.d.ts +14 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -38,13 +38,6 @@ export declare class DCLessonEditorComponent {
|
|
|
38
38
|
* @param result The configuration data returned from the component builder dialog. Expected format: { obj: LessonComponentConfiguration }
|
|
39
39
|
*/
|
|
40
40
|
onComponentAdded(result: ComponentBuildData): void;
|
|
41
|
-
generateByAI(): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Replaces encoded JSON blocks (~...~) in HTML with their 'settings.text' value.
|
|
44
|
-
* @param htmlInput The HTML string containing encoded JSON.
|
|
45
|
-
* @returns The processed HTML string with text replacements.
|
|
46
|
-
*/
|
|
47
|
-
private _extractTextFromEncodedJson;
|
|
48
41
|
/**
|
|
49
42
|
* Handles the image upload event, updates the lesson signal via the service, and saves.
|
|
50
43
|
* @param event The image upload event data.
|
package/lib/components/dc-lessons/dc-lesson-metadata-editor/dc-lesson-metadata-editor.component.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { EventEmitter, WritableSignal } from '@angular/core';
|
|
|
2
2
|
import { ILesson } from '../../lesson-mini-components/components/lessons.clases';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DCLessonMetadataEditorComponent {
|
|
5
|
+
#private;
|
|
5
6
|
lesson: WritableSignal<ILesson | undefined>;
|
|
6
7
|
isLoadingLesson: WritableSignal<boolean>;
|
|
7
8
|
saveRequest: EventEmitter<void>;
|
|
8
9
|
importNotionRequest: EventEmitter<void>;
|
|
9
10
|
improveNotionRequest: EventEmitter<void>;
|
|
10
|
-
generateAIRequest: EventEmitter<void>;
|
|
11
11
|
propertyChange: EventEmitter<{
|
|
12
12
|
property: keyof ILesson;
|
|
13
13
|
value: any;
|
|
@@ -16,7 +16,23 @@ export declare class DCLessonMetadataEditorComponent {
|
|
|
16
16
|
emitSaveRequest(): void;
|
|
17
17
|
emitImportNotionRequest(): void;
|
|
18
18
|
emitImproveNotionRequest(): void;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Generates lesson content using AI, saving the current state first.
|
|
21
|
+
* Moved from DCLessonEditorComponent.
|
|
22
|
+
*/
|
|
23
|
+
generateByAI(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Replaces encoded JSON blocks (~...~) in HTML with their 'settings.text' value.
|
|
26
|
+
* Moved from DCLessonEditorComponent.
|
|
27
|
+
* @param htmlInput The HTML string containing encoded JSON.
|
|
28
|
+
* @returns The processed HTML string with text replacements.
|
|
29
|
+
*/
|
|
30
|
+
private _extractTextFromEncodedJson;
|
|
31
|
+
/**
|
|
32
|
+
* Calls the LessonUtilsService to generate a description using AI
|
|
33
|
+
* and updates the lesson signal if successful.
|
|
34
|
+
*/
|
|
35
|
+
triggerGenerateDescriptionAI(): Promise<void>;
|
|
20
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCLessonMetadataEditorComponent, never>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonMetadataEditorComponent, "dc-lesson-metadata-editor", never, { "lesson": { "alias": "lesson"; "required": true; }; "isLoadingLesson": { "alias": "isLoadingLesson"; "required": true; }; }, { "saveRequest": "saveRequest"; "importNotionRequest": "importNotionRequest"; "improveNotionRequest": "improveNotionRequest"; "
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonMetadataEditorComponent, "dc-lesson-metadata-editor", never, { "lesson": { "alias": "lesson"; "required": true; }; "isLoadingLesson": { "alias": "isLoadingLesson"; "required": true; }; }, { "saveRequest": "saveRequest"; "importNotionRequest": "importNotionRequest"; "improveNotionRequest": "improveNotionRequest"; "propertyChange": "propertyChange"; }, never, never, true, never>;
|
|
22
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { FormGroup, FormControl } from '@angular/forms';
|
|
3
3
|
import { ILesson } from '../../lesson-mini-components/components/lessons.clases';
|
|
4
|
-
import { IAgentCard, IConversationSettings, IMiniAgentCard } from '@dataclouder/ngx-agent-cards';
|
|
4
|
+
import { IAgentCard, IConversationSettings, IMiniAgentCard, SimpleAgentTask } from '@dataclouder/ngx-agent-cards';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class DCLessonRendererComponent {
|
|
7
7
|
lessonInput: import("@angular/core").InputSignal<ILesson>;
|
|
@@ -13,11 +13,13 @@ export declare class DCLessonRendererComponent {
|
|
|
13
13
|
private readonly toastrService;
|
|
14
14
|
private readonly lessonService;
|
|
15
15
|
private readonly lessonAIService;
|
|
16
|
+
private readonly userDataExchange;
|
|
16
17
|
lesson: import("@angular/core").WritableSignal<ILesson>;
|
|
17
18
|
chatVisible: import("@angular/core").WritableSignal<boolean>;
|
|
18
19
|
agentMasterLesson: import("@angular/core").WritableSignal<IAgentCard>;
|
|
19
20
|
evaluatorAgentCard: import("@angular/core").WritableSignal<IMiniAgentCard>;
|
|
20
21
|
conversationSettings: import("@angular/core").WritableSignal<IConversationSettings>;
|
|
22
|
+
evalAgentTask: import("@angular/core").WritableSignal<SimpleAgentTask>;
|
|
21
23
|
imageCover: import("@angular/core").Signal<string>;
|
|
22
24
|
private components;
|
|
23
25
|
mainForm: FormGroup<{
|
|
@@ -34,6 +36,8 @@ export declare class DCLessonRendererComponent {
|
|
|
34
36
|
private _createComponentReferenceWithJson;
|
|
35
37
|
evaluateForms(): Promise<void>;
|
|
36
38
|
startAI(): Promise<void>;
|
|
39
|
+
onVisibleChange(isVisible: boolean): void;
|
|
40
|
+
handleGoalCompleted(event: any): void;
|
|
37
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCLessonRendererComponent, never>;
|
|
38
42
|
static ɵcmp: i0.ɵɵComponentDeclaration<DCLessonRendererComponent, "dc-lesson-renderer", never, { "lessonInput": { "alias": "lessonInput"; "required": false; "isSignal": true; }; "lessonIdInput": { "alias": "lessonIdInput"; "required": false; "isSignal": true; }; "test": { "alias": "test"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
39
43
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EnglishEvaluationSkill = "\nYou are a virtual professor for the Polilan English learning app. Your primary role is to evaluate a student's English conversational performance.\n\nYou will be provided with two pieces of information for each evaluation:\n1. **The student's English level:** This will be one of \"Beginner\", \"Intermediate\", or \"Advanced\".\n2. **A conversation transcript:** This will be the dialogue between the Student and an Assistant, with each turn clearly labeled (e.g., \"Student or User: ...\", \"Assistant: ...\").\n\nYour sole task is to evaluate the *Student's* contribution to the conversation. **Do NOT evaluate the Assistant's turns.**\n\nEvaluate the student's performance based on the following aspects, *always keeping the student's provided level in mind* and adjusting your expectations accordingly specially with beginners give them credits just for trying:\n\n* **Grammar & Syntax:** Evaluate accuracy and complexity *relative to the expected level*. (Beginners: focus on basic accuracy; Advanced: expect complex structures with high accuracy).\n* **Vocabulary & Usage:** Evaluate the range and appropriateness of words used *relative to the expected level*. (Beginners: focus on using basic words correctly; Advanced: expect varied and idiomatic language).\n* **Cohesion & Coherence:** Evaluate how well their turns connect and make sense within the conversation *relative to the expected level*. (Beginners: focus on simple, clear responses; Advanced: expect logical flow and detailed contributions).\n* **Task Completion/Relevance:** Evaluate how effectively they participate and respond to the conversation's goals or topics *relative to the expected level*.\n\nAssign a rating from 0 to 3 based on how well the student performs *compared to the typical expectations for their provided level*:\n\n* **0: Bad** - Performance is significantly below what is expected for this level. Many errors impede communication.\n* **1: Not Bad** - Performance is below expectations for this level, but communication is sometimes possible despite frequent errors.\n* **2: Good** - Performance meets expectations for this level, demonstrating solid understanding and usage with only occasional minor errors.\n* **3: Very Good** - Performance exceeds expectations for this level, demonstrating a strong command and potential to progress quickly.\n\nProvide detailed, constructive feedback that explains the rating. Point out specific strengths and areas for improvement based on their performance *at their given level*. Use examples from the dialog if helpful. Maintain a supportive, encouraging, and educational tone appropriate for a virtual professor guiding a student at their specific stage.\n";
|
|
@@ -113,6 +113,13 @@ export interface ILesson {
|
|
|
113
113
|
export interface ILessonWithTaken extends ILesson {
|
|
114
114
|
taken: any;
|
|
115
115
|
}
|
|
116
|
+
export interface ILessonTaken {
|
|
117
|
+
id: string;
|
|
118
|
+
score: number;
|
|
119
|
+
goalCompleted: boolean;
|
|
120
|
+
status: string;
|
|
121
|
+
lastAccess: Date;
|
|
122
|
+
}
|
|
116
123
|
export declare abstract class LessonsAbstractService {
|
|
117
124
|
abstract getLessons(paginator?: any): Promise<any>;
|
|
118
125
|
abstract getLesson(id: string): Promise<any>;
|
|
@@ -123,6 +130,7 @@ export declare abstract class LessonsAbstractService {
|
|
|
123
130
|
abstract postGenerateByAI(id: string): Promise<any>;
|
|
124
131
|
abstract extractTextFromHtml(html: string): string;
|
|
125
132
|
abstract postImproveMDWithAI(lessonId: string, markdownText: string): Promise<any>;
|
|
133
|
+
abstract saveTakenLesson(lesson: ILessonTaken): Promise<any>;
|
|
126
134
|
}
|
|
127
135
|
export declare function provideLessonsService(serviceImplementation: Type<LessonsAbstractService>): Provider[];
|
|
128
136
|
export declare const LangCodeDescription: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ILesson, ILessonTaken, LessonsAbstractService } from '../components/lesson-mini-components/components/lessons.clases';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DefaultLessonsService implements LessonsAbstractService {
|
|
4
|
+
saveTakenLesson(lesson: ILessonTaken): Promise<any>;
|
|
5
|
+
private httpCoreService;
|
|
6
|
+
private endpoints;
|
|
7
|
+
getLessons(paginator?: any): Promise<any>;
|
|
8
|
+
getLesson(id: string): Promise<any>;
|
|
9
|
+
postLesson(lesson: ILesson): Promise<any>;
|
|
10
|
+
updateLesson(lesson: ILesson): Promise<any>;
|
|
11
|
+
deleteLesson(id: string): Promise<any>;
|
|
12
|
+
generateLesson(lesson: ILesson): Promise<any>;
|
|
13
|
+
postGenerateByAI(id: string): Promise<any>;
|
|
14
|
+
postImproveMDWithAI(lessonId: string, markdownText: string): Promise<any>;
|
|
15
|
+
extractTextFromHtml(html: string): string;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultLessonsService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultLessonsService>;
|
|
18
|
+
}
|
|
@@ -26,11 +26,23 @@ export declare class LessonUtilsService {
|
|
|
26
26
|
/**
|
|
27
27
|
* Improves the provided Markdown text using AI and updates the lesson.
|
|
28
28
|
* Assumes the lesson is already saved before calling this.
|
|
29
|
-
* @param
|
|
29
|
+
* @param lesson The lesson object containing the prompt and other context.
|
|
30
30
|
* @param markdownText The Markdown text generated from the lesson's HTML content.
|
|
31
|
-
* @returns The
|
|
31
|
+
* @returns The improved Markdown string, or null on failure.
|
|
32
32
|
*/
|
|
33
33
|
improveMDWithAI(lesson: ILesson, markdownText: string): Promise<string | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Generates a concise description for the lesson using AI based on its content.
|
|
36
|
+
* @param lesson The lesson object containing the content.
|
|
37
|
+
* @returns A promise resolving to the generated description string, or null on failure.
|
|
38
|
+
*/
|
|
39
|
+
generateDescriptionWithAI(lesson: ILesson): Promise<string | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Extracts plain text from an HTML string, removing encoded JSON components.
|
|
42
|
+
* @param htmlInput The HTML string potentially containing encoded JSON (~...~).
|
|
43
|
+
* @returns The plain text representation.
|
|
44
|
+
*/
|
|
45
|
+
private _extractTextFromHtml;
|
|
34
46
|
/**
|
|
35
47
|
* Cleans orphaned components from the lesson's dynamicComponents.
|
|
36
48
|
* An orphaned component is one present in dynamicComponents but its ID is not found in the textCoded HTML.
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './lib/components/dc-lessons/lesson-list/dc-lesson-list.component'
|
|
|
5
5
|
export * from './lib/components/dc-lessons/lesson-form/lesson-form.component';
|
|
6
6
|
export * from './lib/components/dc-lessons/dc-lesson-editor/dc-lesson-editor.component';
|
|
7
7
|
export * from './lib/components/dc-lessons/dc-lesson-card/dc-lesson-card.component';
|
|
8
|
+
export * from './lib/services/default-lessons.service';
|
|
8
9
|
export * from './lib/components/dc-lessons/dc-lesson-renderer/dc-lesson-renderer.component';
|
|
9
10
|
export * from './lib/components/lesson-mini-components/components/ComponentWithForm';
|
|
10
11
|
export * from './lib/components/lesson-mini-components/components/lesson-dynamic.component';
|