commons-assessment 12.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.
Files changed (100) hide show
  1. package/README.md +191 -0
  2. package/bundles/commons-assessment.umd.js +3968 -0
  3. package/bundles/commons-assessment.umd.js.map +1 -0
  4. package/commons-assessment.d.ts +5 -0
  5. package/esm2015/commons-assessment.js +5 -0
  6. package/esm2015/lib/commons-assessment.module.js +28 -0
  7. package/esm2015/lib/configuration.js +4 -0
  8. package/esm2015/lib/modules/assessment-maker/assessment-maker.component.js +409 -0
  9. package/esm2015/lib/modules/assessment-maker/assessment-maker.module.js +52 -0
  10. package/esm2015/lib/modules/assessment-maker/components/add-edit-section-introduction/add-edit-section-introduction.component.js +55 -0
  11. package/esm2015/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.js +551 -0
  12. package/esm2015/lib/modules/assessment-maker/components/question-details/question-details.component.js +75 -0
  13. package/esm2015/lib/modules/assessment-maker/services/assessment-builder.service.js +150 -0
  14. package/esm2015/lib/modules/assessment-maker/services/assessment-maker.service.js +55 -0
  15. package/esm2015/lib/modules/assessment-taker/assessment-taker.component.js +618 -0
  16. package/esm2015/lib/modules/assessment-taker/assessment-taker.module.js +70 -0
  17. package/esm2015/lib/modules/assessment-taker/components/question-type-editor/question-type-editor.component.js +70 -0
  18. package/esm2015/lib/modules/assessment-taker/components/question-type-file-upload/question-type-file-upload.component.js +153 -0
  19. package/esm2015/lib/modules/assessment-taker/components/question-type-long/question-type-long.component.js +74 -0
  20. package/esm2015/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.js +105 -0
  21. package/esm2015/lib/modules/assessment-taker/components/question-type-number/question-type-number.component.js +47 -0
  22. package/esm2015/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.js +91 -0
  23. package/esm2015/lib/modules/assessment-taker/components/question-type-preference/question-type-preference.component.js +105 -0
  24. package/esm2015/lib/modules/assessment-taker/components/question-type-short/question-type-short.component.js +98 -0
  25. package/esm2015/lib/modules/assessment-taker/components/section-instructions/section-instructions.component.js +61 -0
  26. package/esm2015/lib/modules/assessment-taker/services/assessment-taker.service.js +58 -0
  27. package/esm2015/lib/modules/assessment-taker/services/response-builder.service.js +202 -0
  28. package/esm2015/lib/shared/components/text-editor/text-editor.component.js +119 -0
  29. package/esm2015/lib/shared/controllers.js +21 -0
  30. package/esm2015/lib/shared/interfaces/assessment.interface.js +2 -0
  31. package/esm2015/lib/shared/interfaces/question-paper.interface.js +2 -0
  32. package/esm2015/lib/shared/interfaces/question.interface.js +2 -0
  33. package/esm2015/lib/shared/material-modules.js +74 -0
  34. package/esm2015/lib/shared/pipes/order-by.pipe.js +25 -0
  35. package/esm2015/lib/shared/shared.module.js +48 -0
  36. package/esm2015/lib/shared/utils.js +16 -0
  37. package/esm2015/public-api.js +13 -0
  38. package/fesm2015/commons-assessment.js +3278 -0
  39. package/fesm2015/commons-assessment.js.map +1 -0
  40. package/lib/commons-assessment.module.d.ts +10 -0
  41. package/lib/configuration.d.ts +5 -0
  42. package/lib/modules/assessment-maker/assessment-maker.component.d.ts +64 -0
  43. package/lib/modules/assessment-maker/assessment-maker.module.d.ts +14 -0
  44. package/lib/modules/assessment-maker/components/add-edit-section-introduction/add-edit-section-introduction.component.d.ts +24 -0
  45. package/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.d.ts +70 -0
  46. package/lib/modules/assessment-maker/components/question-details/question-details.component.d.ts +36 -0
  47. package/lib/modules/assessment-maker/services/assessment-builder.service.d.ts +43 -0
  48. package/lib/modules/assessment-maker/services/assessment-maker.service.d.ts +22 -0
  49. package/lib/modules/assessment-taker/assessment-taker.component.d.ts +81 -0
  50. package/lib/modules/assessment-taker/assessment-taker.module.d.ts +20 -0
  51. package/lib/modules/assessment-taker/components/question-type-editor/question-type-editor.component.d.ts +22 -0
  52. package/lib/modules/assessment-taker/components/question-type-file-upload/question-type-file-upload.component.d.ts +38 -0
  53. package/lib/modules/assessment-taker/components/question-type-long/question-type-long.component.d.ts +23 -0
  54. package/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.d.ts +25 -0
  55. package/lib/modules/assessment-taker/components/question-type-number/question-type-number.component.d.ts +13 -0
  56. package/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.d.ts +23 -0
  57. package/lib/modules/assessment-taker/components/question-type-preference/question-type-preference.component.d.ts +25 -0
  58. package/lib/modules/assessment-taker/components/question-type-short/question-type-short.component.d.ts +25 -0
  59. package/lib/modules/assessment-taker/components/section-instructions/section-instructions.component.d.ts +24 -0
  60. package/lib/modules/assessment-taker/services/assessment-taker.service.d.ts +20 -0
  61. package/lib/modules/assessment-taker/services/response-builder.service.d.ts +16 -0
  62. package/lib/shared/components/text-editor/text-editor.component.d.ts +24 -0
  63. package/lib/shared/controllers.d.ts +19 -0
  64. package/lib/shared/interfaces/assessment.interface.d.ts +133 -0
  65. package/lib/shared/interfaces/question-paper.interface.d.ts +73 -0
  66. package/lib/shared/interfaces/question.interface.d.ts +82 -0
  67. package/lib/shared/material-modules.d.ts +18 -0
  68. package/lib/shared/pipes/order-by.pipe.d.ts +7 -0
  69. package/lib/shared/shared.module.d.ts +12 -0
  70. package/lib/shared/utils.d.ts +2 -0
  71. package/package.json +22 -0
  72. package/public-api.d.ts +9 -0
  73. package/src/lib/assets/images/action-dots.svg +5 -0
  74. package/src/lib/assets/images/add-section.svg +4 -0
  75. package/src/lib/assets/images/arrow-down-black.svg +3 -0
  76. package/src/lib/assets/images/arrow-ramp-left.svg +3 -0
  77. package/src/lib/assets/images/close.svg +3 -0
  78. package/src/lib/assets/images/copy.svg +3 -0
  79. package/src/lib/assets/images/delete.svg +1 -0
  80. package/src/lib/assets/images/drag-drop.svg +8 -0
  81. package/src/lib/assets/images/file.svg +5 -0
  82. package/src/lib/assets/images/go-back.svg +3 -0
  83. package/src/lib/assets/images/info.svg +3 -0
  84. package/src/lib/assets/images/jpeg.svg +5 -0
  85. package/src/lib/assets/images/jpg.svg +5 -0
  86. package/src/lib/assets/images/keyboard.svg +3 -0
  87. package/src/lib/assets/images/no-questions.svg +14 -0
  88. package/src/lib/assets/images/pdf.svg +5 -0
  89. package/src/lib/assets/images/pencil.svg +3 -0
  90. package/src/lib/assets/images/plus-primary.svg +3 -0
  91. package/src/lib/assets/images/png.svg +5 -0
  92. package/src/lib/assets/images/svg.svg +5 -0
  93. package/src/lib/assets/json/imageConfig.json +22 -0
  94. package/src/lib/assets/json/labelConfig.json +96 -0
  95. package/src/lib/assets/json/question-builder-rules.json +97 -0
  96. package/src/lib/assets/json/questionTypes.json +50 -0
  97. package/src/lib/assets/theme/_theme.global.scss +63 -0
  98. package/src/lib/assets/theme/_theme.scss +568 -0
  99. package/src/lib/assets/theme/styles.global.scss +191 -0
  100. package/src/lib/assets/theme/styles.scss +63 -0
@@ -0,0 +1,10 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { LibraryConfig } from './configuration';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/common";
5
+ export declare class CommonsAssessmentModule {
6
+ static forRoot(config: LibraryConfig): ModuleWithProviders<CommonsAssessmentModule>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommonsAssessmentModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CommonsAssessmentModule, never, [typeof i1.CommonModule], never>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<CommonsAssessmentModule>;
10
+ }
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export interface LibraryConfig {
3
+ baseURL: string;
4
+ }
5
+ export declare const LIBRARY_CONFIG: InjectionToken<LibraryConfig>;
@@ -0,0 +1,64 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
3
+ import { MatDialog } from '@angular/material/dialog';
4
+ import { QuestionType, Assessment } from '../../shared/interfaces/assessment.interface';
5
+ import { AssessmentQuestionPaper, SectionQuestion, QuestionPaperSection } from '../../shared/interfaces/question-paper.interface';
6
+ import { AssessmentQuestion } from '../../shared/interfaces/question.interface';
7
+ import { AssessmentBuilderService } from './services/assessment-builder.service';
8
+ import { AssessmentMakerService } from './services/assessment-maker.service';
9
+ import * as i0 from "@angular/core";
10
+ export declare class AssessmentMakerComponent implements OnInit {
11
+ private assessmentMakerService;
12
+ private assessmentBuilderService;
13
+ private dialog;
14
+ labelConfig: {
15
+ [key: string]: string;
16
+ };
17
+ imageConfig: {
18
+ [key: string]: string;
19
+ };
20
+ questionTypes: QuestionType[];
21
+ showFooter: boolean;
22
+ customRules?: any;
23
+ assessmentId: number;
24
+ assessmentInstanceId: number;
25
+ defaultAssessmentDTO: Assessment;
26
+ assessmentIdChange: EventEmitter<number>;
27
+ assessmentInstanceIdChange: EventEmitter<number>;
28
+ snackbarMessage: EventEmitter<{
29
+ message: string;
30
+ type: 'success' | 'error' | 'info';
31
+ }>;
32
+ showLoader: boolean;
33
+ questionBank: Record<number, AssessmentQuestion>;
34
+ assessmentQuestionPaperData: AssessmentQuestionPaper;
35
+ configsLoaded: boolean;
36
+ rules: any;
37
+ isSubmitting: boolean;
38
+ constructor(assessmentMakerService: AssessmentMakerService, assessmentBuilderService: AssessmentBuilderService, dialog: MatDialog);
39
+ ngOnInit(): void;
40
+ getConfigsFromJSON(): void;
41
+ loadAssessmentData(): void;
42
+ generateQuestionBank(): void;
43
+ imageErrorHandler(event: any, filePath: string): void;
44
+ focusSectionInput(sectionIndex: number, event: Event): void;
45
+ dropSection(event: CdkDragDrop<any[]>): void;
46
+ dropQuestion(event: CdkDragDrop<any[]>): void;
47
+ addInstruction(section: any): void;
48
+ deleteChildQuestion(option: any, childIdToRemove: number | any): void;
49
+ deleteParentQuestion(sectionQuestion: SectionQuestion): void;
50
+ deleteSection(section: QuestionPaperSection): void;
51
+ createEditQuestion(sectionDetails?: any, sectionQuestionId?: number, isChild?: boolean): void;
52
+ duplicateSection(sectionId: number): void;
53
+ duplicateQuestion(section: QuestionPaperSection, sectionQuestion: SectionQuestion): void;
54
+ patchAssessmentAndQuestionPaper(successMessage?: string): void;
55
+ finalSubmit(): void;
56
+ createAssessmentInstance(): void;
57
+ discardChanges(): void;
58
+ getQuestionFromBank(questionId?: number): AssessmentQuestion;
59
+ updateAssessmentQuestionPaperData(newData: any): void;
60
+ filterInactiveSectionsAndQuestions(): void;
61
+ capitalizeFirst(text: string | undefined): string;
62
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentMakerComponent, never>;
63
+ 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"; }, { "assessmentIdChange": "assessmentIdChange"; "assessmentInstanceIdChange": "assessmentInstanceIdChange"; "snackbarMessage": "snackbarMessage"; }, never, never>;
64
+ }
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./assessment-maker.component";
3
+ import * as i2 from "./components/add-edit-section-introduction/add-edit-section-introduction.component";
4
+ import * as i3 from "./components/assessment-builder/assessment-builder.component";
5
+ import * as i4 from "./components/question-details/question-details.component";
6
+ import * as i5 from "@angular/common";
7
+ import * as i6 from "../../shared/shared.module";
8
+ import * as i7 from "../../shared/material-modules";
9
+ import * as i8 from "@angular/forms";
10
+ export declare class AssessmentMakerModule {
11
+ 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 i5.CommonModule, typeof i6.SharedModule, typeof i7.MaterialModules, typeof i8.FormsModule, typeof i8.ReactiveFormsModule], [typeof i1.AssessmentMakerComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<AssessmentMakerModule>;
14
+ }
@@ -0,0 +1,24 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { QuestionPaperSection } from '../../../../shared/interfaces/question-paper.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class AddEditSectionIntroductionComponent implements OnInit {
6
+ dialogRef: MatDialogRef<AddEditSectionIntroductionComponent>;
7
+ dialogData: any;
8
+ imageConfig: {
9
+ [key: string]: string;
10
+ };
11
+ labelConfig: {
12
+ [key: string]: string;
13
+ };
14
+ sectionDescription: string;
15
+ sectionDetails: QuestionPaperSection | null;
16
+ videoUrl: string;
17
+ constructor(dialogRef: MatDialogRef<AddEditSectionIntroductionComponent>, dialogData: any);
18
+ ngOnInit(): void;
19
+ imageErrorHandler(event: any, filePath: string): void;
20
+ get isVideoUrlValid(): boolean;
21
+ onSubmit(): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<AddEditSectionIntroductionComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<AddEditSectionIntroductionComponent, "lib-add-edit-section-introduction", never, {}, {}, never, never>;
24
+ }
@@ -0,0 +1,70 @@
1
+ import { ElementRef, OnInit } from '@angular/core';
2
+ import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
3
+ import { MatDialogRef } from '@angular/material/dialog';
4
+ import { QuestionType } from '../../../../shared/interfaces/assessment.interface';
5
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
6
+ import { AssessmentMakerService } from '../../services/assessment-maker.service';
7
+ import { AssessmentBuilderService } from '../../services/assessment-builder.service';
8
+ import * as i0 from "@angular/core";
9
+ export declare class AssessmentBuilderComponent implements OnInit {
10
+ private formBuilder;
11
+ private assessmentBuilderService;
12
+ private assessmentMakerService;
13
+ dialogRef: MatDialogRef<AssessmentBuilderComponent>;
14
+ dialogData: any;
15
+ labelConfig: {
16
+ [key: string]: string;
17
+ };
18
+ imageConfig: {
19
+ [key: string]: string;
20
+ };
21
+ questionTypes: QuestionType[];
22
+ questionDetails: AssessmentQuestion | null;
23
+ rules: any;
24
+ questionStack: {
25
+ parentFormValue: AssessmentQuestion;
26
+ editingQuestionIndex?: number;
27
+ addingToGroupId?: string;
28
+ }[];
29
+ scrollContainer: ElementRef;
30
+ childQuestionGroups: {
31
+ id: string;
32
+ optionId: string | number | null;
33
+ questionIds: (string | number)[];
34
+ }[];
35
+ questionsFormGroup: FormGroup;
36
+ questionBank: Record<number, AssessmentQuestion>;
37
+ isChild: boolean;
38
+ assessmentId: number;
39
+ isSubmitting: boolean;
40
+ constructor(formBuilder: FormBuilder, assessmentBuilderService: AssessmentBuilderService, assessmentMakerService: AssessmentMakerService, dialogRef: MatDialogRef<AssessmentBuilderComponent>, dialogData: any);
41
+ ngOnInit(): void;
42
+ generateChildQuestionList(): AssessmentQuestion[];
43
+ setupFormGroup(): void;
44
+ populateForm(questionDetails: AssessmentQuestion, buildChildGroups?: boolean): void;
45
+ onSubmit(): Promise<void>;
46
+ createQuestion(payload: any): Promise<AssessmentQuestion>;
47
+ updateQuestion(payload: any): Promise<AssessmentQuestion>;
48
+ createOrEditAssessmentAndQuestionPaper(question: AssessmentQuestion): void;
49
+ applyDynamicValidators(): void;
50
+ showField(fieldName: string, nestedProp?: string): boolean;
51
+ get options(): FormArray;
52
+ addOption(): void;
53
+ removeOption(index: number): void;
54
+ createOption(): FormGroup;
55
+ allowOnlyNumbers(event: any): void;
56
+ imageErrorHandler(event: any, filePath: string): void;
57
+ addEditChildQuestion(childQuestion?: AssessmentQuestion, index?: number, groupId?: string): void;
58
+ deleteChildQuestion(index: number, event: Event): void;
59
+ getOptionId(opt: any): string | number;
60
+ getChildQuestionById(id: string | number): AssessmentQuestion | undefined;
61
+ getChildQuestionIndex(id: number | undefined): number;
62
+ deleteChildQuestionById(id: number | undefined, event: Event): void;
63
+ buildChildQuestionGroups(childQuestions: AssessmentQuestion[]): void;
64
+ onGroupOptionChange(groupId: string, newOptionId: string | number | null): void;
65
+ goBack(): void;
66
+ private resetAndPopulate;
67
+ private scrollToTop;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentBuilderComponent, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<AssessmentBuilderComponent, "lib-app-assessment-builder", never, {}, {}, never, never>;
70
+ }
@@ -0,0 +1,36 @@
1
+ import { AfterViewInit, ElementRef, EventEmitter } from '@angular/core';
2
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
3
+ import { SectionQuestion } from '../../../../shared/interfaces/question-paper.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class QuestionDetailsComponent implements AfterViewInit {
6
+ sectionQuestion: SectionQuestion;
7
+ question: AssessmentQuestion;
8
+ questionBank: Record<number, AssessmentQuestion>;
9
+ labelConfig: {
10
+ [key: string]: string;
11
+ };
12
+ imageConfig: {
13
+ [key: string]: string;
14
+ };
15
+ editQuestion: EventEmitter<{
16
+ questionId: any;
17
+ isChildQuestion: boolean;
18
+ }>;
19
+ duplicateQuestion: EventEmitter<SectionQuestion>;
20
+ deleteParentQuestion: EventEmitter<SectionQuestion>;
21
+ deleteChildQuestion: EventEmitter<{
22
+ option: any;
23
+ childQuestionId: number;
24
+ }>;
25
+ expanded: boolean;
26
+ showToggle: boolean;
27
+ questionText: ElementRef;
28
+ ngAfterViewInit(): void;
29
+ toggleText(): void;
30
+ checkOverflow(): void;
31
+ capitalizeFirst(text: string | undefined): string;
32
+ imageErrorHandler(event: any, filePath: string): void;
33
+ childQuestionPresent(question: AssessmentQuestion): boolean | undefined;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionDetailsComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionDetailsComponent, "lib-question-details", never, { "sectionQuestion": "sectionQuestion"; "question": "question"; "questionBank": "questionBank"; "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; }, { "editQuestion": "editQuestion"; "duplicateQuestion": "duplicateQuestion"; "deleteParentQuestion": "deleteParentQuestion"; "deleteChildQuestion": "deleteChildQuestion"; }, never, never>;
36
+ }
@@ -0,0 +1,43 @@
1
+ import { Assessment, AssessmentInstance } from '../../../shared/interfaces/assessment.interface';
2
+ import { QuestionPaperSection, SectionQuestion, AssessmentQuestionPaper } from '../../../shared/interfaces/question-paper.interface';
3
+ import { AssessmentQuestion } from '../../../shared/interfaces/question.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class AssessmentBuilderService {
6
+ private defaultAssessmentDTO;
7
+ setDefaultAssessmentDTO(value: Assessment): void;
8
+ constructor();
9
+ setQuestionDTO(formData: any, existingQuestion?: AssessmentQuestion | null): AssessmentQuestion;
10
+ getQuestionDTO(questionData: AssessmentQuestion): {
11
+ id: number | undefined;
12
+ questionText: string;
13
+ questionType: string;
14
+ isMandatory: boolean;
15
+ totalMarks: number;
16
+ hintText: string;
17
+ questionMedia: string;
18
+ minCharacterCount: number | null;
19
+ maxCharacterCount: number | null;
20
+ minimumNumberOfOption: number | null;
21
+ maximumNumberOfOption: number | null;
22
+ maxFileSize: number | null;
23
+ maxNoOfFiles: number | null;
24
+ customRegex: string | undefined;
25
+ options: {
26
+ id: number | undefined;
27
+ uuid: string | undefined;
28
+ optionLabel: string;
29
+ weight: number;
30
+ remarksRequired: boolean;
31
+ isActive: boolean;
32
+ childQuestionList: number[];
33
+ }[];
34
+ childQuestions: AssessmentQuestion[];
35
+ };
36
+ createNewSection(sequence: number): QuestionPaperSection;
37
+ generateSectionQuestion(question: AssessmentQuestion, sectionQuestion?: SectionQuestion): SectionQuestion;
38
+ generateQuestionPaperDTO(questionPaper: AssessmentQuestionPaper, questionBank: Record<number, AssessmentQuestion>): AssessmentQuestionPaper;
39
+ generateAssessmentDTO(assessmentId: number, questionPaper: AssessmentQuestionPaper): Assessment;
40
+ generateAssessmentInstanceDTO(assessmentId: number): AssessmentInstance;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentBuilderService, never>;
42
+ static ɵprov: i0.ɵɵInjectableDeclaration<AssessmentBuilderService>;
43
+ }
@@ -0,0 +1,22 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { LibraryConfig } from '../../../configuration';
3
+ import * as i0 from "@angular/core";
4
+ export declare class AssessmentMakerService {
5
+ private config;
6
+ private http;
7
+ constructor(config: LibraryConfig, http: HttpClient);
8
+ getConfigJSON(fileName: string): import("rxjs").Observable<Object>;
9
+ createAssessmentAndQuestionPaper(payload: any): import("rxjs").Observable<Object>;
10
+ patchAssessmentAndQuestionPaper(payload: any): import("rxjs").Observable<Object>;
11
+ createQuestion(payload: any): import("rxjs").Observable<Object>;
12
+ patchQuestion(payload: any): import("rxjs").Observable<Object>;
13
+ getQuestionsByIds(params: {
14
+ questionIds: number[];
15
+ }): import("rxjs").Observable<Object>;
16
+ getAssessmentContext(assessmentId: number): import("rxjs").Observable<Object>;
17
+ duplicateSection(questionPaperId: number, sectionId: number): import("rxjs").Observable<Object>;
18
+ duplicateQuestion(sectionId: number, sectionQuestionId: number): import("rxjs").Observable<Object>;
19
+ createAssessmentInstance(payload: any): import("rxjs").Observable<Object>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentMakerService, never>;
21
+ static ɵprov: i0.ɵɵInjectableDeclaration<AssessmentMakerService>;
22
+ }
@@ -0,0 +1,81 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { MatDialog } from '@angular/material/dialog';
3
+ import { FormBuilder, FormGroup } from '@angular/forms';
4
+ import { DomSanitizer } from '@angular/platform-browser';
5
+ import { AssessmentTakerService } from './services/assessment-taker.service';
6
+ import { ResponseBuilderService } from './services/response-builder.service';
7
+ import { AssesseeDTO, AssessorDTO, Assessment, AssessmentInstanceAssesseDTO } from '../../shared/interfaces/assessment.interface';
8
+ import { AssessmentQuestion } from '../../shared/interfaces/question.interface';
9
+ import { AssessmentQuestionPaper, QuestionPaperSection } from '../../shared/interfaces/question-paper.interface';
10
+ import * as i0 from "@angular/core";
11
+ export declare class AssessmentTakerComponent implements OnInit {
12
+ private assessmentTakerService;
13
+ private fb;
14
+ private responseBuilderService;
15
+ private sanitizer;
16
+ private dialog;
17
+ labelConfig: {
18
+ [key: string]: string;
19
+ };
20
+ imageConfig: {
21
+ [key: string]: string;
22
+ };
23
+ showFooter: boolean;
24
+ assessmentId: number;
25
+ assessmentInstanceId: number;
26
+ assesseeData: AssesseeDTO;
27
+ assessorData: AssessorDTO;
28
+ disabled: boolean;
29
+ previewMode: boolean;
30
+ verticalView: boolean;
31
+ enableMarks: boolean;
32
+ snackbarMessage: EventEmitter<{
33
+ message: string;
34
+ type: 'success' | 'error' | 'info';
35
+ }>;
36
+ submitAssessment: EventEmitter<any>;
37
+ showLoader: boolean;
38
+ questionBank: Record<number, AssessmentQuestion>;
39
+ assessmentQuestionPaperData: AssessmentQuestionPaper;
40
+ assessmentData: Assessment;
41
+ assesseeResponse: AssessmentInstanceAssesseDTO;
42
+ configsLoaded: boolean;
43
+ isSubmitting: boolean;
44
+ sectionFormGroups: {
45
+ sectionId: number;
46
+ formGroup: FormGroup;
47
+ }[];
48
+ selectedTabIndex: number;
49
+ sectionErrors: boolean[];
50
+ tenantId: number;
51
+ tooltipState: Record<number, boolean>;
52
+ constructor(assessmentTakerService: AssessmentTakerService, fb: FormBuilder, responseBuilderService: ResponseBuilderService, sanitizer: DomSanitizer, dialog: MatDialog);
53
+ ngOnInit(): void;
54
+ getConfigsFromJSON(): void;
55
+ loadAssessmentData(): void;
56
+ formSetup(): void;
57
+ addControlForQuestion(group: any, question: AssessmentQuestion, isMandatory?: boolean, isChild?: boolean, parentId?: number, parentOptionId?: number): void;
58
+ getPrefilledMark(qId: number, isChild?: boolean, parentId?: number, parentOptionId?: number): any;
59
+ getQuestionWeight(qId: number): number;
60
+ getMarksRange(qId: number): number[];
61
+ shouldShowMarksDropdown(question: AssessmentQuestion): boolean;
62
+ getPrefilledAnswer(qId: number, isChild?: boolean, parentId?: number, parentOptionId?: number): any;
63
+ getValidatorsForQuestion(question: AssessmentQuestion, isMandatory: boolean): any[];
64
+ imageErrorHandler(event: any, filePath: string): void;
65
+ isOptionSelected(formGroup: FormGroup, question: AssessmentQuestion, optionId: number | undefined): boolean;
66
+ getMaxCharCount(question: AssessmentQuestion): number;
67
+ getRemainingChars(question: AssessmentQuestion, control: any): number;
68
+ goBack(): void;
69
+ shouldDisableTab(index: number): boolean;
70
+ goNext(markAsCompleted?: boolean): void;
71
+ expandedState: boolean[];
72
+ processSubmit(markAsCompleted?: boolean): void;
73
+ scrollToFirstInvalidField(sectionIndex: number): void;
74
+ save(goNext?: boolean, markAsCompleted?: boolean): void;
75
+ getAnswersByAiaId(assesseeId: number): void;
76
+ addYoutubeIframeSrc(videoUrl: string): import("@angular/platform-browser").SafeResourceUrl;
77
+ getVideoId(videoUrl: string): string | null;
78
+ openInstructionsDialog(section: QuestionPaperSection): void;
79
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentTakerComponent, never>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<AssessmentTakerComponent, "lib-assessment-taker", never, { "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; "showFooter": "showFooter"; "assessmentId": "assessmentId"; "assessmentInstanceId": "assessmentInstanceId"; "assesseeData": "assesseeData"; "assessorData": "assessorData"; "disabled": "disabled"; "previewMode": "previewMode"; "verticalView": "verticalView"; "enableMarks": "enableMarks"; }, { "snackbarMessage": "snackbarMessage"; "submitAssessment": "submitAssessment"; }, never, never>;
81
+ }
@@ -0,0 +1,20 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./assessment-taker.component";
3
+ import * as i2 from "./components/question-type-editor/question-type-editor.component";
4
+ import * as i3 from "./components/question-type-file-upload/question-type-file-upload.component";
5
+ import * as i4 from "./components/question-type-long/question-type-long.component";
6
+ import * as i5 from "./components/question-type-multiselect/question-type-multiselect.component";
7
+ import * as i6 from "./components/question-type-number/question-type-number.component";
8
+ import * as i7 from "./components/question-type-objective/question-type-objective.component";
9
+ import * as i8 from "./components/question-type-preference/question-type-preference.component";
10
+ import * as i9 from "./components/question-type-short/question-type-short.component";
11
+ import * as i10 from "./components/section-instructions/section-instructions.component";
12
+ import * as i11 from "@angular/common";
13
+ import * as i12 from "../../shared/shared.module";
14
+ import * as i13 from "../../shared/material-modules";
15
+ import * as i14 from "@angular/forms";
16
+ export declare class AssessmentTakerModule {
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentTakerModule, never>;
18
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AssessmentTakerModule, [typeof i1.AssessmentTakerComponent, typeof i2.QuestionTypeEditorComponent, typeof i3.QuestionTypeFileUploadComponent, typeof i4.QuestionTypeLongComponent, typeof i5.QuestionTypeMultiselectComponent, typeof i6.QuestionTypeNumberComponent, typeof i7.QuestionTypeObjectiveComponent, typeof i8.QuestionTypePreferenceComponent, typeof i9.QuestionTypeShortComponent, typeof i10.SectionInstructionsComponent], [typeof i11.CommonModule, typeof i12.SharedModule, typeof i13.MaterialModules, typeof i14.FormsModule, typeof i14.ReactiveFormsModule], [typeof i1.AssessmentTakerComponent]>;
19
+ static ɵinj: i0.ɵɵInjectorDeclaration<AssessmentTakerModule>;
20
+ }
@@ -0,0 +1,22 @@
1
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
2
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
3
+ import * as i0 from "@angular/core";
4
+ export declare class QuestionTypeEditorComponent implements ControlValueAccessor {
5
+ ngControl: NgControl;
6
+ required: any;
7
+ question: AssessmentQuestion;
8
+ previewMode: boolean;
9
+ labelConfig: {
10
+ [key: string]: string;
11
+ };
12
+ formControl: FormControl;
13
+ onTouched: () => void;
14
+ constructor(ngControl: NgControl);
15
+ checkFormControlValid(): "" | "assessment-input-border-invalid";
16
+ writeValue(value: any): void;
17
+ registerOnChange(fn: Function): void;
18
+ registerOnTouched(fn: Function): void;
19
+ setDisabledState(isDisabled: boolean): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeEditorComponent, [{ optional: true; self: true; }]>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeEditorComponent, "lib-question-type-editor", never, { "required": "required"; "question": "question"; "previewMode": "previewMode"; "labelConfig": "labelConfig"; }, {}, never, never>;
22
+ }
@@ -0,0 +1,38 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
3
+ import { AssessmentTakerService } from '../../services/assessment-taker.service';
4
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
5
+ import { Attachment } from '../../../../shared/interfaces/assessment.interface';
6
+ import * as i0 from "@angular/core";
7
+ export declare class QuestionTypeFileUploadComponent implements ControlValueAccessor {
8
+ ngControl: NgControl;
9
+ private assessmentService;
10
+ required: any;
11
+ question: AssessmentQuestion;
12
+ labelConfig: {
13
+ [key: string]: string;
14
+ };
15
+ imageConfig: {
16
+ [key: string]: string;
17
+ };
18
+ fileInput: ElementRef;
19
+ files: Attachment[];
20
+ formControl: FormControl;
21
+ onTouched: () => void;
22
+ constructor(ngControl: NgControl, assessmentService: AssessmentTakerService);
23
+ writeValue(value: any): void;
24
+ registerOnChange(fn: Function): void;
25
+ registerOnTouched(fn: Function): void;
26
+ setDisabledState(isDisabled: boolean): void;
27
+ get maxFiles(): number;
28
+ get maxFileSize(): number;
29
+ get allowMultiple(): boolean;
30
+ onFileChange(event: any): void;
31
+ uploadFile(file: File): void;
32
+ removeFile(index: number): void;
33
+ imageErrorHandler(event: any, filePath: string): void;
34
+ getFileIcon(attachment: Attachment): string;
35
+ viewFile(url: string): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeFileUploadComponent, [{ optional: true; self: true; }, null]>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeFileUploadComponent, "lib-question-type-file-upload", never, { "required": "required"; "question": "question"; "labelConfig": "labelConfig"; "imageConfig": "imageConfig"; }, {}, never, never>;
38
+ }
@@ -0,0 +1,23 @@
1
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
2
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
3
+ import * as i0 from "@angular/core";
4
+ export declare class QuestionTypeLongComponent implements ControlValueAccessor {
5
+ ngControl: NgControl;
6
+ required: any;
7
+ question: AssessmentQuestion;
8
+ previewMode: boolean;
9
+ labelConfig: {
10
+ [key: string]: string;
11
+ };
12
+ formControl: FormControl;
13
+ onTouched: () => void;
14
+ constructor(ngControl: NgControl);
15
+ checkFormControlValid(): "" | "assessment-input-border-invalid";
16
+ writeValue(value: any): void;
17
+ registerOnChange(fn: Function): void;
18
+ registerOnTouched(fn: Function): void;
19
+ setDisabledState(isDisabled: boolean): void;
20
+ get maxCharCount(): number;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeLongComponent, [{ optional: true; self: true; }]>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeLongComponent, "lib-question-type-long", never, { "required": "required"; "question": "question"; "previewMode": "previewMode"; "labelConfig": "labelConfig"; }, {}, never, never>;
23
+ }
@@ -0,0 +1,25 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
3
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class QuestionTypeMultiselectComponent implements ControlValueAccessor {
6
+ ngControl: NgControl;
7
+ required: any;
8
+ question: AssessmentQuestion;
9
+ viewChild: EventEmitter<any>;
10
+ selectData: Array<any>;
11
+ formControl: FormControl;
12
+ onTouchedFn: () => void;
13
+ constructor(ngControl: NgControl);
14
+ toggleSelection(event: any, data: any): void;
15
+ writeValue(value: any): void;
16
+ getSelection(option: any): boolean;
17
+ registerOnChange(fn: Function): void;
18
+ registerOnTouched(fn: Function): void;
19
+ setDisabledState(isDisabled: boolean): void;
20
+ onTouched(): void;
21
+ checkFormControlValid(): "" | "assessment-error-text assessment-text-danger";
22
+ optionDetection(obj: any, detectFromEdit: boolean): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeMultiselectComponent, [{ optional: true; self: true; }]>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeMultiselectComponent, "lib-question-type-multiselect", never, { "required": "required"; "question": "question"; }, { "viewChild": "viewChild"; }, never, never>;
25
+ }
@@ -0,0 +1,13 @@
1
+ import { ControlValueAccessor, FormControl } from '@angular/forms';
2
+ import * as i0 from "@angular/core";
3
+ export declare class QuestionTypeNumberComponent implements ControlValueAccessor {
4
+ required: any;
5
+ optionsList: any;
6
+ formControl: FormControl;
7
+ constructor();
8
+ writeValue(value: any): void;
9
+ registerOnChange(fn: Function): void;
10
+ registerOnTouched(fn: Function): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeNumberComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeNumberComponent, "lib-question-type-number", never, { "required": "required"; "optionsList": "optionsList"; }, {}, never, never>;
13
+ }
@@ -0,0 +1,23 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
3
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class QuestionTypeObjectiveComponent implements ControlValueAccessor {
6
+ ngControl: NgControl;
7
+ required: any;
8
+ question: AssessmentQuestion;
9
+ viewChild: EventEmitter<any>;
10
+ formControl: FormControl;
11
+ onTouchedFn: () => void;
12
+ constructor(ngControl: NgControl);
13
+ writeValue(value: any): void;
14
+ registerOnChange(fn: Function): void;
15
+ registerOnTouched(fn: Function): void;
16
+ setDisabledState(isDisabled: boolean): void;
17
+ onChildDataChanged(data: any): void;
18
+ optionDetection(obj: any, detectFromEdit: boolean): void;
19
+ onTouched(): void;
20
+ checkFormControlValid(): "" | "assessment-error-text assessment-text-danger";
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeObjectiveComponent, [{ optional: true; self: true; }]>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeObjectiveComponent, "lib-question-type-objective", never, { "required": "required"; "question": "question"; }, { "viewChild": "viewChild"; }, never, never>;
23
+ }
@@ -0,0 +1,25 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
3
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class QuestionTypePreferenceComponent implements ControlValueAccessor {
6
+ ngControl: NgControl;
7
+ required: any;
8
+ question: AssessmentQuestion;
9
+ viewChild: EventEmitter<any>;
10
+ selectData: Array<any>;
11
+ formControl: FormControl;
12
+ onTouchedFn: () => void;
13
+ constructor(ngControl: NgControl);
14
+ toggleSelection(data: any): void;
15
+ writeValue(value: any): void;
16
+ getSelectionIndex(option: any): number;
17
+ registerOnChange(fn: Function): void;
18
+ registerOnTouched(fn: Function): void;
19
+ setDisabledState(isDisabled: boolean): void;
20
+ onTouched(): void;
21
+ checkFormControlValid(): "" | "assessment-error-text assessment-text-danger";
22
+ optionDetection(obj: any, detectFromEdit: boolean): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypePreferenceComponent, [{ optional: true; self: true; }]>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypePreferenceComponent, "lib-question-type-preference", never, { "required": "required"; "question": "question"; }, { "viewChild": "viewChild"; }, never, never>;
25
+ }
@@ -0,0 +1,25 @@
1
+ import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
2
+ import { AssessmentQuestion } from '../../../../shared/interfaces/question.interface';
3
+ import * as i0 from "@angular/core";
4
+ export declare class QuestionTypeShortComponent implements ControlValueAccessor {
5
+ ngControl: NgControl;
6
+ required: any;
7
+ question: AssessmentQuestion;
8
+ previewMode: boolean;
9
+ labelConfig: {
10
+ [key: string]: string;
11
+ };
12
+ formControl: FormControl;
13
+ onTouched: () => void;
14
+ constructor(ngControl: NgControl);
15
+ checkFormControlValid(): "" | "assessment-input-border-invalid";
16
+ writeValue(value: any): void;
17
+ registerOnChange(fn: Function): void;
18
+ registerOnTouched(fn: Function): void;
19
+ setDisabledState(isDisabled: boolean): void;
20
+ get maxCharCount(): number;
21
+ get inputType(): string;
22
+ restrictNumberOnly(event: KeyboardEvent): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuestionTypeShortComponent, [{ optional: true; self: true; }]>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeShortComponent, "lib-question-type-short", never, { "required": "required"; "question": "question"; "previewMode": "previewMode"; "labelConfig": "labelConfig"; }, {}, never, never>;
25
+ }
@@ -0,0 +1,24 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { DomSanitizer } from '@angular/platform-browser';
4
+ import { QuestionPaperSection } from '../../../../shared/interfaces/question-paper.interface';
5
+ import * as i0 from "@angular/core";
6
+ export declare class SectionInstructionsComponent implements OnInit {
7
+ dialogRef: MatDialogRef<SectionInstructionsComponent>;
8
+ dialogData: any;
9
+ private sanitizer;
10
+ imageConfig: {
11
+ [key: string]: string;
12
+ };
13
+ labelConfig: {
14
+ [key: string]: string;
15
+ };
16
+ sectionDetails: QuestionPaperSection | null;
17
+ constructor(dialogRef: MatDialogRef<SectionInstructionsComponent>, dialogData: any, sanitizer: DomSanitizer);
18
+ ngOnInit(): void;
19
+ addYoutubeIframeSrc(videoUrl: string): import("@angular/platform-browser").SafeResourceUrl;
20
+ getVideoId(videoUrl: string): string | null;
21
+ imageErrorHandler(event: any, filePath: string): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SectionInstructionsComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<SectionInstructionsComponent, "lib-section-instructions", never, {}, {}, never, never>;
24
+ }