commons-assessment 12.1.1 → 12.1.2-dev.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/bundles/commons-assessment.umd.js +989 -114
- package/bundles/commons-assessment.umd.js.map +1 -1
- package/esm2015/lib/modules/assessment-maker/assessment-maker.component.js +148 -5
- package/esm2015/lib/modules/assessment-maker/assessment-maker.module.js +10 -5
- package/esm2015/lib/modules/assessment-maker/components/add-edit-section-introduction/add-edit-section-introduction.component.js +1 -1
- package/esm2015/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.js +64 -20
- package/esm2015/lib/modules/assessment-maker/components/question-bank-picker/question-bank-picker.component.js +276 -0
- package/esm2015/lib/modules/assessment-maker/components/question-details/question-details.component.js +12 -2
- package/esm2015/lib/modules/assessment-maker/services/assessment-builder.service.js +7 -2
- package/esm2015/lib/modules/assessment-maker/services/assessment-maker.service.js +30 -19
- package/esm2015/lib/modules/assessment-taker/assessment-taker.component.js +2 -7
- package/esm2015/lib/modules/assessment-taker/components/proctoring-consent/proctoring-consent.component.js +2 -14
- package/esm2015/lib/modules/assessment-taker/components/proctoring-result/proctoring-result.component.js +2 -2
- package/esm2015/lib/modules/assessment-taker/components/question-type-date-picker/question-type-date-picker.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-editor/question-type-editor.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-file-upload/question-type-file-upload.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-long/question-type-long.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-preference/question-type-preference.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/question-type-short/question-type-short.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/components/section-instructions/section-instructions.component.js +1 -1
- package/esm2015/lib/modules/assessment-taker/services/assessment-taker.service.js +2 -15
- package/esm2015/lib/modules/question-bank/question-bank.component.js +313 -0
- package/esm2015/lib/modules/question-bank/question-bank.module.js +45 -0
- package/esm2015/lib/shared/components/confirmation-dialog/confirmation-dialog.component.js +1 -1
- package/esm2015/lib/shared/components/skill-allocation/skill-allocation.component.js +1 -1
- package/esm2015/lib/shared/controllers.js +5 -1
- package/esm2015/lib/shared/interfaces/assessment.interface.js +1 -1
- package/esm2015/lib/shared/pipes/order-by.pipe.js +3 -4
- package/esm2015/lib/shared/utils.js +19 -1
- package/esm2015/public-api.js +4 -1
- package/fesm2015/commons-assessment.js +904 -93
- package/fesm2015/commons-assessment.js.map +1 -1
- package/lib/modules/assessment-maker/assessment-maker.component.d.ts +11 -2
- package/lib/modules/assessment-maker/assessment-maker.module.d.ts +6 -5
- package/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.d.ts +3 -0
- package/lib/modules/assessment-maker/components/question-bank-picker/question-bank-picker.component.d.ts +81 -0
- package/lib/modules/assessment-maker/components/question-details/question-details.component.d.ts +3 -1
- package/lib/modules/assessment-maker/services/assessment-maker.service.d.ts +3 -2
- package/lib/modules/assessment-taker/services/assessment-taker.service.d.ts +16 -18
- package/lib/modules/question-bank/question-bank.component.d.ts +65 -0
- package/lib/modules/question-bank/question-bank.module.d.ts +12 -0
- package/lib/shared/controllers.d.ts +4 -0
- package/lib/shared/interfaces/assessment.interface.d.ts +5 -0
- package/lib/shared/utils.d.ts +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
- package/src/lib/assets/images/arrow-down-blue.svg +3 -0
- package/src/lib/assets/images/arrow-up-blue.svg +3 -0
- package/src/lib/assets/images/file-import.svg +11 -0
- package/src/lib/assets/images/plus-white.svg +1 -0
- package/src/lib/assets/json/imageConfig.json +5 -1
- package/src/lib/assets/json/labelConfig.json +35 -4
- package/src/lib/assets/theme/_theme.global.scss +0 -1
- package/src/lib/assets/theme/styles.global.scss +0 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
3
3
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
|
-
import { QuestionType, Assessment, RefData, AssessmentContextDTO, AssessmentInstance } from '../../shared/interfaces/assessment.interface';
|
|
4
|
+
import { QuestionType, Assessment, RefData, AssessmentContextDTO, AssessmentInstance, QuestionBankConfig } from '../../shared/interfaces/assessment.interface';
|
|
5
5
|
import { AssessmentQuestionPaper, SectionQuestion, QuestionPaperSection } from '../../shared/interfaces/question-paper.interface';
|
|
6
6
|
import { AssessmentQuestion } from '../../shared/interfaces/question.interface';
|
|
7
7
|
import { AssessmentBuilderService } from './services/assessment-builder.service';
|
|
@@ -30,6 +30,8 @@ export declare class AssessmentMakerComponent implements OnInit {
|
|
|
30
30
|
checkForResponses: boolean;
|
|
31
31
|
showProctoringToggle: boolean;
|
|
32
32
|
showTimeInput: boolean;
|
|
33
|
+
enableImportFromQuestionBank: boolean;
|
|
34
|
+
questionBankConfig?: QuestionBankConfig;
|
|
33
35
|
assessmentIdChange: EventEmitter<number>;
|
|
34
36
|
assessmentInstanceIdChange: EventEmitter<number>;
|
|
35
37
|
snackbarMessage: EventEmitter<{
|
|
@@ -38,6 +40,7 @@ export declare class AssessmentMakerComponent implements OnInit {
|
|
|
38
40
|
}>;
|
|
39
41
|
showLoader: boolean;
|
|
40
42
|
questionBank: Record<number, AssessmentQuestion>;
|
|
43
|
+
lockedQuestionsMap: Record<number, boolean>;
|
|
41
44
|
assessmentQuestionPaperData: AssessmentQuestionPaper;
|
|
42
45
|
configsLoaded: boolean;
|
|
43
46
|
rules: any;
|
|
@@ -57,6 +60,8 @@ export declare class AssessmentMakerComponent implements OnInit {
|
|
|
57
60
|
private confirmResponsesWarning;
|
|
58
61
|
getConfigsFromJSON(): void;
|
|
59
62
|
loadAssessmentData(): void;
|
|
63
|
+
checkAssessmentQuestionsLocked(): void;
|
|
64
|
+
isQuestionLocked(questionId?: number): boolean;
|
|
60
65
|
generateQuestionBank(): void;
|
|
61
66
|
imageErrorHandler(event: any, filePath: string): void;
|
|
62
67
|
focusSectionInput(sectionIndex: number, event: Event): void;
|
|
@@ -94,6 +99,10 @@ export declare class AssessmentMakerComponent implements OnInit {
|
|
|
94
99
|
getSkillsList(): void;
|
|
95
100
|
trackBySectionId(index: number, section: any): string;
|
|
96
101
|
trackBySectionQuestion(index: number, sq: any): string;
|
|
102
|
+
private collectExistingQuestionIds;
|
|
103
|
+
openQuestionBankPicker(section?: QuestionPaperSection): void;
|
|
104
|
+
private importQuestionsToSection;
|
|
105
|
+
private createAssessmentAndQuestionPaperOnImport;
|
|
97
106
|
static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentMakerComponent, never>;
|
|
98
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AssessmentMakerComponent, "lib-assessment-maker", never, { "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; "questionTypes": "questionTypes"; "showFooter": "showFooter"; "customRules": "customRules"; "assessmentId": "assessmentId"; "assessmentInstanceId": "assessmentInstanceId"; "defaultAssessmentDTO": "defaultAssessmentDTO"; "predefinedAssessmentInstance": "predefinedAssessmentInstance"; "enableSkillsToQuestionMapping": "enableSkillsToQuestionMapping"; "assessmentContext": "assessmentContext"; "minimumRequiredSections": "minimumRequiredSections"; "checkForResponses": "checkForResponses"; "showProctoringToggle": "showProctoringToggle"; "showTimeInput": "showTimeInput"; }, { "assessmentIdChange": "assessmentIdChange"; "assessmentInstanceIdChange": "assessmentInstanceIdChange"; "snackbarMessage": "snackbarMessage"; }, never, never>;
|
|
107
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AssessmentMakerComponent, "lib-assessment-maker", never, { "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; "questionTypes": "questionTypes"; "showFooter": "showFooter"; "customRules": "customRules"; "assessmentId": "assessmentId"; "assessmentInstanceId": "assessmentInstanceId"; "defaultAssessmentDTO": "defaultAssessmentDTO"; "predefinedAssessmentInstance": "predefinedAssessmentInstance"; "enableSkillsToQuestionMapping": "enableSkillsToQuestionMapping"; "assessmentContext": "assessmentContext"; "minimumRequiredSections": "minimumRequiredSections"; "checkForResponses": "checkForResponses"; "showProctoringToggle": "showProctoringToggle"; "showTimeInput": "showTimeInput"; "enableImportFromQuestionBank": "enableImportFromQuestionBank"; "questionBankConfig": "questionBankConfig"; }, { "assessmentIdChange": "assessmentIdChange"; "assessmentInstanceIdChange": "assessmentInstanceIdChange"; "snackbarMessage": "snackbarMessage"; }, never, never>;
|
|
99
108
|
}
|
|
@@ -3,12 +3,13 @@ import * as i1 from "./assessment-maker.component";
|
|
|
3
3
|
import * as i2 from "./components/add-edit-section-introduction/add-edit-section-introduction.component";
|
|
4
4
|
import * as i3 from "./components/assessment-builder/assessment-builder.component";
|
|
5
5
|
import * as i4 from "./components/question-details/question-details.component";
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "../../shared/
|
|
9
|
-
import * as i8 from "
|
|
6
|
+
import * as i5 from "./components/question-bank-picker/question-bank-picker.component";
|
|
7
|
+
import * as i6 from "@angular/common";
|
|
8
|
+
import * as i7 from "../../shared/shared.module";
|
|
9
|
+
import * as i8 from "../../shared/material-modules";
|
|
10
|
+
import * as i9 from "@angular/forms";
|
|
10
11
|
export declare class AssessmentMakerModule {
|
|
11
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentMakerModule, never>;
|
|
12
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AssessmentMakerModule, [typeof i1.AssessmentMakerComponent, typeof i2.AddEditSectionIntroductionComponent, typeof i3.AssessmentBuilderComponent, typeof i4.QuestionDetailsComponent], [typeof
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AssessmentMakerModule, [typeof i1.AssessmentMakerComponent, typeof i2.AddEditSectionIntroductionComponent, typeof i3.AssessmentBuilderComponent, typeof i4.QuestionDetailsComponent, typeof i5.QuestionBankPickerComponent], [typeof i6.CommonModule, typeof i7.SharedModule, typeof i8.MaterialModules, typeof i9.FormsModule, typeof i9.ReactiveFormsModule], [typeof i1.AssessmentMakerComponent, typeof i3.AssessmentBuilderComponent]>;
|
|
13
14
|
static ɵinj: i0.ɵɵInjectorDeclaration<AssessmentMakerModule>;
|
|
14
15
|
}
|
package/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export declare class AssessmentBuilderComponent implements OnInit {
|
|
|
36
36
|
questionBank: Record<number, AssessmentQuestion>;
|
|
37
37
|
isChild: boolean;
|
|
38
38
|
assessmentId: number;
|
|
39
|
+
standaloneMode: boolean;
|
|
40
|
+
isLocked: boolean;
|
|
39
41
|
isSubmitting: boolean;
|
|
40
42
|
skillsList: RefData[];
|
|
41
43
|
constructor(formBuilder: FormBuilder, assessmentBuilderService: AssessmentBuilderService, assessmentMakerService: AssessmentMakerService, dialogRef: MatDialogRef<AssessmentBuilderComponent>, dialogData: any);
|
|
@@ -44,6 +46,7 @@ export declare class AssessmentBuilderComponent implements OnInit {
|
|
|
44
46
|
setupFormGroup(): void;
|
|
45
47
|
populateForm(questionDetails: AssessmentQuestion, buildChildGroups?: boolean): void;
|
|
46
48
|
onSubmit(): Promise<void>;
|
|
49
|
+
private createStandaloneQuestion;
|
|
47
50
|
createQuestion(payload: any): Promise<AssessmentQuestion>;
|
|
48
51
|
updateQuestion(payload: any): Promise<AssessmentQuestion>;
|
|
49
52
|
createOrEditAssessmentAndQuestionPaper(question: AssessmentQuestion): void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { QuestionBankConfig, QuestionType } from '../../../../shared/interfaces/assessment.interface';
|
|
4
|
+
import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
|
|
5
|
+
import { AssessmentMakerService } from '../../services/assessment-maker.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export interface QuestionBankPickerDialogData {
|
|
8
|
+
questionBankConfig: QuestionBankConfig;
|
|
9
|
+
existingQuestionIds: Set<number>;
|
|
10
|
+
labelConfig: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
imageConfig: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
};
|
|
16
|
+
questionTypes: QuestionType[];
|
|
17
|
+
targetSectionName?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class QuestionBankPickerComponent implements OnInit, OnDestroy {
|
|
20
|
+
private assessmentMakerService;
|
|
21
|
+
dialogRef: MatDialogRef<QuestionBankPickerComponent>;
|
|
22
|
+
dialogData: QuestionBankPickerDialogData;
|
|
23
|
+
labelConfig: {
|
|
24
|
+
[key: string]: string;
|
|
25
|
+
};
|
|
26
|
+
imageConfig: {
|
|
27
|
+
[key: string]: string;
|
|
28
|
+
};
|
|
29
|
+
questionTypes: QuestionType[];
|
|
30
|
+
existingQuestionIds: Set<number>;
|
|
31
|
+
targetSectionName: string;
|
|
32
|
+
allQuestions: AssessmentQuestion[];
|
|
33
|
+
filteredQuestions: AssessmentQuestion[];
|
|
34
|
+
currentPage: number;
|
|
35
|
+
pageSize: number;
|
|
36
|
+
totalElements: number;
|
|
37
|
+
hasNext: boolean;
|
|
38
|
+
isLoading: boolean;
|
|
39
|
+
isInitialLoading: boolean;
|
|
40
|
+
searchTerm: string;
|
|
41
|
+
selectedTypeCode: string;
|
|
42
|
+
selectedQuestions: Map<number, AssessmentQuestion>;
|
|
43
|
+
expandedQuestionIds: Set<number>;
|
|
44
|
+
private questionBankConfig;
|
|
45
|
+
private searchSubject$;
|
|
46
|
+
private destroy$;
|
|
47
|
+
constructor(assessmentMakerService: AssessmentMakerService, dialogRef: MatDialogRef<QuestionBankPickerComponent>, dialogData: QuestionBankPickerDialogData);
|
|
48
|
+
ngOnInit(): void;
|
|
49
|
+
ngOnDestroy(): void;
|
|
50
|
+
loadPage(page: number, append?: boolean): void;
|
|
51
|
+
loadMore(): void;
|
|
52
|
+
onScroll(event: Event): void;
|
|
53
|
+
applyFilters(): void;
|
|
54
|
+
onSearchChange(term: string): void;
|
|
55
|
+
clearSearch(): void;
|
|
56
|
+
onTypeFilterChange(typeCode: string | undefined): void;
|
|
57
|
+
selectQuickTypeFilter(typeCode: string | undefined): void;
|
|
58
|
+
toggleSelection(question: AssessmentQuestion): void;
|
|
59
|
+
isSelected(question: AssessmentQuestion): boolean;
|
|
60
|
+
isAlreadyInAssessment(questionId: number | undefined): boolean;
|
|
61
|
+
get eligibleVisibleQuestions(): AssessmentQuestion[];
|
|
62
|
+
get isAllVisibleSelected(): boolean;
|
|
63
|
+
get isSomeVisibleSelected(): boolean;
|
|
64
|
+
toggleSelectAllVisible(): void;
|
|
65
|
+
clearAllSelection(): void;
|
|
66
|
+
hasOptions(question: AssessmentQuestion): boolean;
|
|
67
|
+
toggleExpandOptions(questionId: number | undefined, event: Event): void;
|
|
68
|
+
isOptionsExpanded(questionId: number | undefined): boolean;
|
|
69
|
+
get selectedCount(): number;
|
|
70
|
+
get totalSelectedMarks(): number;
|
|
71
|
+
getTypeCount(typeCode: string | undefined): number;
|
|
72
|
+
getCategoryClass(question: AssessmentQuestion): string;
|
|
73
|
+
importSelected(): void;
|
|
74
|
+
close(): void;
|
|
75
|
+
capitalizeFirst(text: string | undefined): string;
|
|
76
|
+
getQuestionTypeLabel(question: AssessmentQuestion): string;
|
|
77
|
+
imageErrorHandler(event: any, filePath: string): void;
|
|
78
|
+
trackByQuestionId(index: number, question: AssessmentQuestion): string;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuestionBankPickerComponent, never>;
|
|
80
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuestionBankPickerComponent, "lib-question-bank-picker", never, {}, {}, never, never>;
|
|
81
|
+
}
|
package/lib/modules/assessment-maker/components/question-details/question-details.component.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare class QuestionDetailsComponent implements AfterViewInit {
|
|
|
13
13
|
[key: string]: string;
|
|
14
14
|
};
|
|
15
15
|
allowDelete: boolean;
|
|
16
|
+
isLocked: boolean;
|
|
16
17
|
editQuestion: EventEmitter<{
|
|
17
18
|
questionId: any;
|
|
18
19
|
isChildQuestion: boolean;
|
|
@@ -29,6 +30,7 @@ export declare class QuestionDetailsComponent implements AfterViewInit {
|
|
|
29
30
|
ngAfterViewInit(): void;
|
|
30
31
|
toggleText(): void;
|
|
31
32
|
checkOverflow(): void;
|
|
33
|
+
onQuestionClick(event: Event, questionId: any, isChild?: boolean): void;
|
|
32
34
|
capitalizeFirst(text: string | undefined): string;
|
|
33
35
|
imageErrorHandler(event: any, filePath: string): void;
|
|
34
36
|
childQuestionPresent(question: AssessmentQuestion): boolean | undefined;
|
|
@@ -36,5 +38,5 @@ export declare class QuestionDetailsComponent implements AfterViewInit {
|
|
|
36
38
|
trackByChildId(index: number, id: any): string;
|
|
37
39
|
trackBySkillCode(index: number, skill: any): string;
|
|
38
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<QuestionDetailsComponent, never>;
|
|
39
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<QuestionDetailsComponent, "lib-question-details", never, { "sectionQuestion": "sectionQuestion"; "question": "question"; "questionBank": "questionBank"; "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; "allowDelete": "allowDelete"; }, { "editQuestion": "editQuestion"; "duplicateQuestion": "duplicateQuestion"; "deleteParentQuestion": "deleteParentQuestion"; "deleteChildQuestion": "deleteChildQuestion"; }, never, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuestionDetailsComponent, "lib-question-details", never, { "sectionQuestion": "sectionQuestion"; "question": "question"; "questionBank": "questionBank"; "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; "allowDelete": "allowDelete"; "isLocked": "isLocked"; }, { "editQuestion": "editQuestion"; "duplicateQuestion": "duplicateQuestion"; "deleteParentQuestion": "deleteParentQuestion"; "deleteChildQuestion": "deleteChildQuestion"; }, never, never>;
|
|
40
42
|
}
|
|
@@ -4,11 +4,10 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class AssessmentMakerService {
|
|
5
5
|
private http;
|
|
6
6
|
private readonly assetsBaseUrl;
|
|
7
|
-
private configCache;
|
|
8
7
|
constructor(http: HttpClient);
|
|
9
8
|
private getHeaders;
|
|
10
9
|
createParams(params: any): HttpParams;
|
|
11
|
-
getConfigJSON(fileName: string): Observable<
|
|
10
|
+
getConfigJSON(fileName: string): Observable<Object>;
|
|
12
11
|
getResponseCount(assessmentInstanceId: number): Observable<Object>;
|
|
13
12
|
createAssessmentAndQuestionPaper(payload: any): Observable<Object>;
|
|
14
13
|
patchAssessmentAndQuestionPaper(payload: any): Observable<Object>;
|
|
@@ -22,6 +21,8 @@ export declare class AssessmentMakerService {
|
|
|
22
21
|
duplicateQuestion(sectionId: number, sectionQuestionId: number): Observable<Object>;
|
|
23
22
|
createAssessmentInstance(payload: any): Observable<Object>;
|
|
24
23
|
getRefDataByCode(code: string, params: any): Observable<Object>;
|
|
24
|
+
getQuestionBankQuestions(params: any): Observable<Object>;
|
|
25
|
+
checkQuestionsLocked(questionIds: (number | string)[], scope?: string): Observable<Record<string, boolean>>;
|
|
25
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentMakerService, never>;
|
|
26
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<AssessmentMakerService>;
|
|
27
28
|
}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
export declare class AssessmentTakerService {
|
|
5
4
|
private http;
|
|
6
5
|
private readonly assetsBaseUrl;
|
|
7
|
-
private configCache;
|
|
8
6
|
constructor(http: HttpClient);
|
|
9
7
|
private getHeaders;
|
|
10
8
|
createParams(params: any): HttpParams;
|
|
11
|
-
getConfigJSON(fileName: string): Observable<
|
|
12
|
-
getAssessmentContextById(params: any): Observable<Object>;
|
|
13
|
-
getAssessmentQuestionPaper(instanceId: number): Observable<Object>;
|
|
14
|
-
getAssessmentQuestions(instanceId: any, questionIds: any): Observable<Object>;
|
|
15
|
-
getChildQuestionsWithIdList(instanceId: any, questionIds: any): Observable<Object>;
|
|
16
|
-
uploadAttachment(fileUploadPayload: FormData, params: any): Observable<Object>;
|
|
17
|
-
getAttachments(params: any): Observable<Object>;
|
|
18
|
-
submitAssessment(payload: any): Observable<Object>;
|
|
19
|
-
patchAssessment(payload: any): Observable<Object>;
|
|
20
|
-
getAnswersByAiaId(aiaId: any): Observable<Object>;
|
|
21
|
-
updateMarks(payload: any): Observable<Object>;
|
|
22
|
-
refreshProctoringToken(assesseeId: number): Observable<Object>;
|
|
23
|
-
endProctoringSession(assesseeId: number): Observable<Object>;
|
|
24
|
-
getProctoringSessions(assesseeId: number, params: any): Observable<Object>;
|
|
25
|
-
getProctoringReportBySession(sessionId: number): Observable<Object>;
|
|
26
|
-
checkGoogleDriveLinkPublic(googleDriveLink: string): Observable<Object>;
|
|
9
|
+
getConfigJSON(fileName: string): import("rxjs").Observable<Object>;
|
|
10
|
+
getAssessmentContextById(params: any): import("rxjs").Observable<Object>;
|
|
11
|
+
getAssessmentQuestionPaper(instanceId: number): import("rxjs").Observable<Object>;
|
|
12
|
+
getAssessmentQuestions(instanceId: any, questionIds: any): import("rxjs").Observable<Object>;
|
|
13
|
+
getChildQuestionsWithIdList(instanceId: any, questionIds: any): import("rxjs").Observable<Object>;
|
|
14
|
+
uploadAttachment(fileUploadPayload: FormData, params: any): import("rxjs").Observable<Object>;
|
|
15
|
+
getAttachments(params: any): import("rxjs").Observable<Object>;
|
|
16
|
+
submitAssessment(payload: any): import("rxjs").Observable<Object>;
|
|
17
|
+
patchAssessment(payload: any): import("rxjs").Observable<Object>;
|
|
18
|
+
getAnswersByAiaId(aiaId: any): import("rxjs").Observable<Object>;
|
|
19
|
+
updateMarks(payload: any): import("rxjs").Observable<Object>;
|
|
20
|
+
refreshProctoringToken(assesseeId: number): import("rxjs").Observable<Object>;
|
|
21
|
+
endProctoringSession(assesseeId: number): import("rxjs").Observable<Object>;
|
|
22
|
+
getProctoringSessions(assesseeId: number, params: any): import("rxjs").Observable<Object>;
|
|
23
|
+
getProctoringReportBySession(sessionId: number): import("rxjs").Observable<Object>;
|
|
24
|
+
checkGoogleDriveLinkPublic(googleDriveLink: string): import("rxjs").Observable<Object>;
|
|
27
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentTakerService, never>;
|
|
28
26
|
static ɵprov: i0.ɵɵInjectableDeclaration<AssessmentTakerService>;
|
|
29
27
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
3
|
+
import { QuestionBankConfig, QuestionType, RefData } from '../../shared/interfaces/assessment.interface';
|
|
4
|
+
import { AssessmentQuestion } from '../../shared/interfaces/question.interface';
|
|
5
|
+
import { AssessmentBuilderService } from '../assessment-maker/services/assessment-builder.service';
|
|
6
|
+
import { AssessmentMakerService } from '../assessment-maker/services/assessment-maker.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class QuestionBankComponent implements OnInit, OnDestroy {
|
|
9
|
+
private assessmentMakerService;
|
|
10
|
+
private assessmentBuilderService;
|
|
11
|
+
private dialog;
|
|
12
|
+
labelConfig: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
imageConfig: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
};
|
|
18
|
+
questionTypes: QuestionType[];
|
|
19
|
+
customRules?: any;
|
|
20
|
+
questionBankConfig: QuestionBankConfig;
|
|
21
|
+
enableSkillsToQuestionMapping: boolean;
|
|
22
|
+
fetchQuestionsList: boolean;
|
|
23
|
+
autoOpenBuilder: boolean;
|
|
24
|
+
headless: boolean;
|
|
25
|
+
questionCreated: EventEmitter<AssessmentQuestion>;
|
|
26
|
+
questionUpdated: EventEmitter<AssessmentQuestion>;
|
|
27
|
+
snackbarMessage: EventEmitter<{
|
|
28
|
+
message: string;
|
|
29
|
+
type: 'success' | 'error' | 'info';
|
|
30
|
+
}>;
|
|
31
|
+
questionsList: AssessmentQuestion[];
|
|
32
|
+
questionBank: Record<number, AssessmentQuestion>;
|
|
33
|
+
configsLoaded: boolean;
|
|
34
|
+
showLoader: boolean;
|
|
35
|
+
rules: any;
|
|
36
|
+
skillsList: RefData[];
|
|
37
|
+
searchTerm: string;
|
|
38
|
+
selectedTypeCode: string;
|
|
39
|
+
currentPage: number;
|
|
40
|
+
pageSize: number;
|
|
41
|
+
totalElements: number;
|
|
42
|
+
hasNext: boolean;
|
|
43
|
+
isLoadingMore: boolean;
|
|
44
|
+
lockedQuestionsMap: Record<number, boolean>;
|
|
45
|
+
private searchSubject$;
|
|
46
|
+
private destroy$;
|
|
47
|
+
constructor(assessmentMakerService: AssessmentMakerService, assessmentBuilderService: AssessmentBuilderService, dialog: MatDialog);
|
|
48
|
+
ngOnInit(): void;
|
|
49
|
+
ngOnDestroy(): void;
|
|
50
|
+
getConfigsFromJSON(): void;
|
|
51
|
+
loadQuestions(page?: number, append?: boolean): void;
|
|
52
|
+
onSearchChange(term: string): void;
|
|
53
|
+
clearSearch(): void;
|
|
54
|
+
onTypeFilterChange(typeCode: string | undefined): void;
|
|
55
|
+
loadMore(): void;
|
|
56
|
+
onQuestionCardClick(question: AssessmentQuestion): void;
|
|
57
|
+
isQuestionLocked(question?: AssessmentQuestion): boolean;
|
|
58
|
+
createEditQuestion(questionDetails?: AssessmentQuestion): void;
|
|
59
|
+
private openBuilderDialog;
|
|
60
|
+
capitalizeFirst(text: string | undefined): string;
|
|
61
|
+
imageErrorHandler(event: any, filePath: string): void;
|
|
62
|
+
getSkillsList(): void;
|
|
63
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuestionBankComponent, never>;
|
|
64
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuestionBankComponent, "lib-question-bank", never, { "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; "questionTypes": "questionTypes"; "customRules": "customRules"; "questionBankConfig": "questionBankConfig"; "enableSkillsToQuestionMapping": "enableSkillsToQuestionMapping"; "fetchQuestionsList": "fetchQuestionsList"; "autoOpenBuilder": "autoOpenBuilder"; "headless": "headless"; }, { "questionCreated": "questionCreated"; "questionUpdated": "questionUpdated"; "snackbarMessage": "snackbarMessage"; }, never, never>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./question-bank.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../../shared/shared.module";
|
|
5
|
+
import * as i4 from "../../shared/material-modules";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "../assessment-maker/assessment-maker.module";
|
|
8
|
+
export declare class QuestionBankModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuestionBankModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<QuestionBankModule, [typeof i1.QuestionBankComponent], [typeof i2.CommonModule, typeof i3.SharedModule, typeof i4.MaterialModules, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.AssessmentMakerModule], [typeof i1.QuestionBankComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<QuestionBankModule>;
|
|
12
|
+
}
|
|
@@ -4,6 +4,10 @@ export declare const googleDriveController: {
|
|
|
4
4
|
export declare const refDataController: {
|
|
5
5
|
getRefDataByCode: string;
|
|
6
6
|
};
|
|
7
|
+
export declare const questionBankController: {
|
|
8
|
+
searchQuestions: string;
|
|
9
|
+
questionsLocked: string;
|
|
10
|
+
};
|
|
7
11
|
export declare const assessmentMakerController: {
|
|
8
12
|
assessmentAndQuestionPaper: string;
|
|
9
13
|
createQuestion: string;
|
package/lib/shared/utils.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export declare function deepClone<T>(data: T): T;
|
|
2
2
|
export declare function generateUuid(): string;
|
|
3
3
|
export declare function sortByOrder(list: any[] | undefined | null, property?: string, order?: 'asc' | 'desc'): any[];
|
|
4
|
+
/**
|
|
5
|
+
* Recursively removes a specified key (default: 'uuid') from any object or array structure.
|
|
6
|
+
*/
|
|
7
|
+
export declare function removeKeyDeep<T>(obj: T, keyToRemove?: string): T;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ export * from './lib/shared/interfaces/question.interface';
|
|
|
3
3
|
export * from './lib/shared/interfaces/question-paper.interface';
|
|
4
4
|
export * from './lib/modules/assessment-taker/assessment-taker.module';
|
|
5
5
|
export * from './lib/modules/assessment-maker/assessment-maker.module';
|
|
6
|
+
export * from './lib/modules/question-bank/question-bank.module';
|
|
6
7
|
export * from './lib/commons-assessment.module';
|
|
7
8
|
export * from './lib/modules/assessment-maker/assessment-maker.component';
|
|
9
|
+
export * from './lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component';
|
|
8
10
|
export * from './lib/modules/assessment-taker/assessment-taker.component';
|
|
11
|
+
export * from './lib/modules/question-bank/question-bank.component';
|
|
9
12
|
export * from './lib/shared/utils';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_13706_60051)">
|
|
3
|
+
<path d="M14 3V7C14 7.26522 14.1054 7.51957 14.2929 7.70711C14.4804 7.89464 14.7348 8 15 8H19" stroke="#4D89EB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M5 13V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V19C19 19.5304 18.7893 20.0391 18.4142 20.4142C18.0391 20.7893 17.5304 21 17 21H11.5M2 19H9M6 22L9 19L6 16" stroke="#4D89EB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0_13706_60051">
|
|
8
|
+
<rect width="24" height="24" fill="white"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 5V19M5 12H19" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"COMMONS_ASSESSMENT.ICON.NO_QUESTIONS": "assets/commons-assessment/images/no-questions.svg",
|
|
3
3
|
"COMMONS_ASSESSMENT.ICON.PLUS_PRIMARY": "assets/commons-assessment/images/plus-primary.svg",
|
|
4
|
+
"COMMONS_ASSESSMENT.ICON.PLUS_WHITE": "assets/commons-assessment/images/plus-white.svg",
|
|
4
5
|
"COMMONS_ASSESSMENT.ICON.KEYBOARD": "assets/commons-assessment/images/keyboard.svg",
|
|
5
6
|
"COMMONS_ASSESSMENT.ICON.DRAG_DROP": "assets/commons-assessment/images/drag-drop.svg",
|
|
6
7
|
"COMMONS_ASSESSMENT.ICON.ACTION_DOTS": "assets/commons-assessment/images/action-dots.svg",
|
|
@@ -22,5 +23,8 @@
|
|
|
22
23
|
"COMMONS_ASSESSMENT.ICON.CROSS_RED": "assets/commons-assessment/images/cross-red.svg",
|
|
23
24
|
"COMMONS_ASSESSMENT.ICON.CHECK_GREEN": "assets/commons-assessment/images/check-green.svg",
|
|
24
25
|
"COMMONS_ASSESSMENT.ICON.PROCTORING": "assets/commons-assessment/images/proctoring.svg",
|
|
25
|
-
"COMMONS_ASSESSMENT.ICON.USER": "assets/commons-assessment/images/user.svg"
|
|
26
|
+
"COMMONS_ASSESSMENT.ICON.USER": "assets/commons-assessment/images/user.svg",
|
|
27
|
+
"COMMONS_ASSESSMENT.ICON.ARROW_DOWN_BLUE": "assets/commons-assessment/images/arrow-down-blue.svg",
|
|
28
|
+
"COMMONS_ASSESSMENT.ICON.ARROW_UP_BLUE": "assets/commons-assessment/images/arrow-up-blue.svg",
|
|
29
|
+
"COMMONS_ASSESSMENT.ICON.FILE_IMPORT": "assets/commons-assessment/images/file-import.svg"
|
|
26
30
|
}
|
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
"COMMONS_ASSESSMENT.PROCTORING.WARN_NO_REFRESH": "Do not refresh or close the page during the assessment.",
|
|
110
110
|
"COMMONS_ASSESSMENT.PROCTORING.WARN_QUIET_ROOM": "Stay in a well-lit, quiet room and keep your face clearly visible.",
|
|
111
111
|
"COMMONS_ASSESSMENT.PROCTORING.CAMERA_DENIED": "Camera access is required for proctoring. Please allow camera access in your browser and try again.",
|
|
112
|
-
"COMMONS_ASSESSMENT.PROCTORING.REFERENCE_IMAGE_REJECTED": "We couldn't verify your photo — no clear face was detected. Please retake a clear, unobstructed photo of your face in good lighting.",
|
|
113
112
|
"COMMONS_ASSESSMENT.PROCTORING.SESSION_ERROR": "Could not start the proctoring session. Please try again.",
|
|
114
113
|
"COMMONS_ASSESSMENT.PROCTORING.RESULT_TITLE": "Proctoring report",
|
|
115
114
|
"COMMONS_ASSESSMENT.PROCTORING.VIEW_REPORT": "Proctoring report",
|
|
@@ -149,7 +148,6 @@
|
|
|
149
148
|
"COMMONS_ASSESSMENT.PROCTORING.EVENT.no_face.detected": "No face detected",
|
|
150
149
|
"COMMONS_ASSESSMENT.PROCTORING.EVENT.multi_face.detected": "Multiple faces detected",
|
|
151
150
|
"COMMONS_ASSESSMENT.PROCTORING.REASON.browser_activity": "Browser activity",
|
|
152
|
-
"COMMONS_ASSESSMENT.PROCTORING.REASON.liveness_gap": "Liveness gap",
|
|
153
151
|
"COMMONS_ASSESSMENT.PROCTORING.REASON.no_face": "No face detected",
|
|
154
152
|
"COMMONS_ASSESSMENT.PROCTORING.REASON.multi_face": "Multiple faces detected",
|
|
155
153
|
"COMMONS_ASSESSMENT.PROCTORING.REASON.impersonation": "Possible impersonation",
|
|
@@ -185,5 +183,38 @@
|
|
|
185
183
|
"COMMONS_ASSESSMENT.ERROR.CANNOT_BE_ZERO": "Limit cannot be 0.",
|
|
186
184
|
"COMMONS_ASSESSMENT.ERROR.MAX_LIMIT_GREATER": " Max limit should be greater than min limit",
|
|
187
185
|
"COMMONS_ASSESSMENT.ERROR.MAX_LIMIT_EXCEEDS_OPTIONS": "Max limit cannot exceed total options.",
|
|
188
|
-
"COMMONS_ASSESSMENT.TOAST.MINIMUM_REQUIRED_SECTIONS_ERROR": "Atleast $Count sections needs to be created before proceeding."
|
|
189
|
-
|
|
186
|
+
"COMMONS_ASSESSMENT.TOAST.MINIMUM_REQUIRED_SECTIONS_ERROR": "Atleast $Count sections needs to be created before proceeding.",
|
|
187
|
+
|
|
188
|
+
"COMMONS_ASSESSMENT.LABEL.QUESTION_BANK": "Question Bank",
|
|
189
|
+
"COMMONS_ASSESSMENT.LABEL.QUESTION_BANK_DESC": "Create and manage independent questions to map to assessments",
|
|
190
|
+
"COMMONS_ASSESSMENT.LABEL.CREATE_QUESTION": "Create Question",
|
|
191
|
+
"COMMONS_ASSESSMENT.LABEL.NO_QUESTIONS_IN_BANK": "No Questions in Bank!",
|
|
192
|
+
"COMMONS_ASSESSMENT.LABEL.NO_QUESTIONS_IN_BANK_DESC": "Create standalone questions to reuse across assessments",
|
|
193
|
+
"COMMONS_ASSESSMENT.TOAST.QUESTION_CREATED_SUCCESS": "Question created successfully",
|
|
194
|
+
"COMMONS_ASSESSMENT.LABEL.IMPORT_FROM_QUESTION_BANK": "Import from Question Bank",
|
|
195
|
+
"COMMONS_ASSESSMENT.LABEL.SEARCH_QUESTIONS": "Search questions...",
|
|
196
|
+
"COMMONS_ASSESSMENT.LABEL.ALL_TYPES": "All Types",
|
|
197
|
+
"COMMONS_ASSESSMENT.LABEL.ALREADY_ADDED": "Already Added",
|
|
198
|
+
"COMMONS_ASSESSMENT.LABEL.QUESTIONS_SELECTED": "questions selected",
|
|
199
|
+
"COMMONS_ASSESSMENT.LABEL.IMPORT_COUNT": "Import",
|
|
200
|
+
"COMMONS_ASSESSMENT.LABEL.LOAD_MORE": "Load More",
|
|
201
|
+
"COMMONS_ASSESSMENT.LABEL.SHOWING_OF": "Showing",
|
|
202
|
+
"COMMONS_ASSESSMENT.LABEL.NO_QUESTIONS_FOUND": "No questions found",
|
|
203
|
+
"COMMONS_ASSESSMENT.TOAST.QUESTIONS_IMPORTED_SUCCESS": "Questions imported successfully",
|
|
204
|
+
"COMMONS_ASSESSMENT.WARNING.QUESTION_LOCKED": "This question is part of a published assessment and cannot be edited.",
|
|
205
|
+
"COMMONS_ASSESSMENT.LABEL.LOCKED": "Locked",
|
|
206
|
+
"COMMONS_ASSESSMENT.LABEL.SELECTED_SECTION": "Selected Section",
|
|
207
|
+
"COMMONS_ASSESSMENT.LABEL.SEARCH_QUESTION": "Search Question",
|
|
208
|
+
"COMMONS_ASSESSMENT.LABEL.SELECT_ALL_QUESTIONS": "Select All Questions",
|
|
209
|
+
"COMMONS_ASSESSMENT.LABEL.ADDED": "Added",
|
|
210
|
+
"COMMONS_ASSESSMENT.LABEL.CLICK_TO_VIEW": "Click to view",
|
|
211
|
+
"COMMONS_ASSESSMENT.LABEL.NO_QUESTIONS_SELECTED": "No questions selected",
|
|
212
|
+
"COMMONS_ASSESSMENT.LABEL.ALL_QUESTIONS_LOADED": "All questions loaded",
|
|
213
|
+
"COMMONS_ASSESSMENT.LABEL.LOADING_MORE_QUESTIONS": "Loading more questions...",
|
|
214
|
+
"COMMONS_ASSESSMENT.LABEL.NO_MATCHING_QUESTIONS": "No matching questions found",
|
|
215
|
+
"COMMONS_ASSESSMENT.LABEL.NO_MATCHING_QUESTIONS_DESC": "Try adjusting your search terms or clearing selected question type filters.",
|
|
216
|
+
"COMMONS_ASSESSMENT.LABEL.CLEAR_FILTERS": "Clear Filters",
|
|
217
|
+
"COMMONS_ASSESSMENT.LABEL.IMPORT_QUESTIONS_INTO_NEW_SECTION": "Import questions into a new section",
|
|
218
|
+
"COMMONS_ASSESSMENT.LABEL.CREATE_NEW_QUESTION": "Create New Question",
|
|
219
|
+
"COMMONS_ASSESSMENT.LABEL.ADD_QUESTION": "Add Question"
|
|
220
|
+
}
|
|
@@ -206,16 +206,4 @@ GLOBAL stylesheet for commons-assessment library
|
|
|
206
206
|
.mat-mdc-tab-header {
|
|
207
207
|
display: none !important;
|
|
208
208
|
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
input.assessment-input-border-one,
|
|
212
|
-
textarea.assessment-input-border-one {
|
|
213
|
-
transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
|
|
214
|
-
|
|
215
|
-
&:focus {
|
|
216
|
-
background-color: var(--assessment-white) !important;
|
|
217
|
-
border: var(--assessment-input-border-one) !important;
|
|
218
|
-
border-color: var(--assessment-primary-one) !important;
|
|
219
|
-
box-shadow: var(--assessment-input-focus-box-shadow);
|
|
220
|
-
}
|
|
221
209
|
}
|