commons-assessment 12.0.21 → 12.0.22

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 (34) hide show
  1. package/README.md +1 -0
  2. package/bundles/commons-assessment.umd.js +161 -56
  3. package/bundles/commons-assessment.umd.js.map +1 -1
  4. package/esm2015/lib/modules/assessment-maker/assessment-maker.component.js +4 -4
  5. package/esm2015/lib/modules/assessment-maker/components/add-edit-section-introduction/add-edit-section-introduction.component.js +1 -1
  6. package/esm2015/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.js +1 -1
  7. package/esm2015/lib/modules/assessment-maker/components/question-details/question-details.component.js +1 -1
  8. package/esm2015/lib/modules/assessment-maker/services/assessment-maker.service.js +3 -3
  9. package/esm2015/lib/modules/assessment-taker/assessment-taker.component.js +21 -3
  10. package/esm2015/lib/modules/assessment-taker/components/question-type-date-picker/question-type-date-picker.component.js +1 -1
  11. package/esm2015/lib/modules/assessment-taker/components/question-type-editor/question-type-editor.component.js +1 -1
  12. package/esm2015/lib/modules/assessment-taker/components/question-type-file-upload/question-type-file-upload.component.js +1 -1
  13. package/esm2015/lib/modules/assessment-taker/components/question-type-long/question-type-long.component.js +1 -1
  14. package/esm2015/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.js +49 -2
  15. package/esm2015/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.js +42 -2
  16. package/esm2015/lib/modules/assessment-taker/components/question-type-preference/question-type-preference.component.js +1 -1
  17. package/esm2015/lib/modules/assessment-taker/components/question-type-short/question-type-short.component.js +1 -1
  18. package/esm2015/lib/modules/assessment-taker/components/section-instructions/section-instructions.component.js +1 -1
  19. package/esm2015/lib/modules/assessment-taker/services/assessment-taker.service.js +3 -3
  20. package/esm2015/lib/shared/components/skill-allocation/skill-allocation.component.js +1 -1
  21. package/esm2015/lib/shared/controllers.js +3 -3
  22. package/fesm2015/commons-assessment.js +135 -30
  23. package/fesm2015/commons-assessment.js.map +1 -1
  24. package/lib/modules/assessment-maker/services/assessment-maker.service.d.ts +1 -1
  25. package/lib/modules/assessment-taker/assessment-taker.component.d.ts +3 -1
  26. package/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.d.ts +10 -1
  27. package/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.d.ts +10 -1
  28. package/lib/modules/assessment-taker/services/assessment-taker.service.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/src/lib/assets/images/check-green.svg +3 -0
  31. package/src/lib/assets/images/cross-red.svg +3 -0
  32. package/src/lib/assets/json/imageConfig.json +3 -1
  33. package/src/lib/assets/theme/_theme.global.scss +1 -0
  34. package/src/lib/assets/theme/styles.global.scss +16 -0
@@ -14,7 +14,7 @@ export declare class AssessmentMakerService {
14
14
  getQuestionsByIds(params: {
15
15
  questionIds: number[];
16
16
  }): import("rxjs").Observable<Object>;
17
- getAssessmentContext(assessmentId: number): import("rxjs").Observable<Object>;
17
+ getAssessmentContext(params: any): import("rxjs").Observable<Object>;
18
18
  duplicateSection(questionPaperId: number, sectionId: number): import("rxjs").Observable<Object>;
19
19
  duplicateQuestion(sectionId: number, sectionQuestionId: number): import("rxjs").Observable<Object>;
20
20
  createAssessmentInstance(payload: any): import("rxjs").Observable<Object>;
@@ -37,6 +37,7 @@ export declare class AssessmentTakerComponent implements OnInit {
37
37
  [sectionId: number]: SectionScore;
38
38
  };
39
39
  showOverallRemarks: boolean;
40
+ showCorrectAnswers: boolean;
40
41
  snackbarMessage: EventEmitter<{
41
42
  message: string;
42
43
  type: 'success' | 'error' | 'info';
@@ -71,6 +72,7 @@ export declare class AssessmentTakerComponent implements OnInit {
71
72
  emitStepDetails(): void;
72
73
  addControlForQuestion(group: any, question: AssessmentQuestion, isMandatory?: boolean, isChild?: boolean, parentId?: number, parentOptionId?: number): void;
73
74
  getPrefilledMark(qId: number, isChild?: boolean, parentId?: number, parentOptionId?: number): any;
75
+ getQuestionAnswerObj(qId: number, parentOptionId?: number | null, parentQuestionId?: number | null): any;
74
76
  getQuestionWeight(qId: number): number;
75
77
  shouldShowMarksDropdown(question: AssessmentQuestion): boolean;
76
78
  getPrefilledAnswer(qId: number, isChild?: boolean, parentId?: number, parentOptionId?: number): any;
@@ -93,5 +95,5 @@ export declare class AssessmentTakerComponent implements OnInit {
93
95
  checkMaxVal(event: any, control: any, maxVal: number | undefined): void;
94
96
  openSkillAllocationDialog(skillList?: SkillScore[]): void;
95
97
  static ɵfac: i0.ɵɵFactoryDeclaration<AssessmentTakerComponent, never>;
96
- 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"; "hideSectionTabs": "hideSectionTabs"; "assessmentContext": "assessmentContext"; "assesseeResponse": "assesseeResponse"; "markAsCompleted": "markAsCompleted"; "sectionWiseScore": "sectionWiseScore"; "showOverallRemarks": "showOverallRemarks"; }, { "snackbarMessage": "snackbarMessage"; "submitAssessment": "submitAssessment"; "stepChanged": "stepChanged"; }, never, never>;
98
+ 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"; "hideSectionTabs": "hideSectionTabs"; "assessmentContext": "assessmentContext"; "assesseeResponse": "assesseeResponse"; "markAsCompleted": "markAsCompleted"; "sectionWiseScore": "sectionWiseScore"; "showOverallRemarks": "showOverallRemarks"; "showCorrectAnswers": "showCorrectAnswers"; }, { "snackbarMessage": "snackbarMessage"; "submitAssessment": "submitAssessment"; "stepChanged": "stepChanged"; }, never, never>;
97
99
  }
@@ -6,6 +6,11 @@ export declare class QuestionTypeMultiselectComponent implements ControlValueAcc
6
6
  ngControl: NgControl;
7
7
  required: any;
8
8
  question: AssessmentQuestion;
9
+ showCorrectAnswers: boolean;
10
+ imageConfig: {
11
+ [key: string]: string;
12
+ };
13
+ answerObj: any;
9
14
  viewChild: EventEmitter<any>;
10
15
  selectData: Array<any>;
11
16
  formControl: FormControl;
@@ -20,6 +25,10 @@ export declare class QuestionTypeMultiselectComponent implements ControlValueAcc
20
25
  onTouched(): void;
21
26
  checkFormControlValid(): "" | "assessment-error-text assessment-text-danger";
22
27
  optionDetection(obj: any, detectFromEdit: boolean): void;
28
+ getSelectedOptionIds(): number[];
29
+ isEvaluationEnabled(): boolean;
30
+ getSelectionStatus(option: any): string | null;
31
+ imageErrorHandler(event: any, filePath: string): void;
23
32
  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>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeMultiselectComponent, "lib-question-type-multiselect", never, { "required": "required"; "question": "question"; "showCorrectAnswers": "showCorrectAnswers"; "imageConfig": "imageConfig"; "answerObj": "answerObj"; }, { "viewChild": "viewChild"; }, never, never>;
25
34
  }
@@ -6,6 +6,11 @@ export declare class QuestionTypeObjectiveComponent implements ControlValueAcces
6
6
  ngControl: NgControl;
7
7
  required: any;
8
8
  question: AssessmentQuestion;
9
+ showCorrectAnswers: boolean;
10
+ imageConfig: {
11
+ [key: string]: string;
12
+ };
13
+ answerObj: any;
9
14
  viewChild: EventEmitter<any>;
10
15
  formControl: FormControl;
11
16
  onTouchedFn: () => void;
@@ -18,6 +23,10 @@ export declare class QuestionTypeObjectiveComponent implements ControlValueAcces
18
23
  optionDetection(obj: any, detectFromEdit: boolean): void;
19
24
  onTouched(): void;
20
25
  checkFormControlValid(): "" | "assessment-error-text assessment-text-danger";
26
+ getSelectedOptionId(): number | null | undefined;
27
+ isEvaluationEnabled(): boolean;
28
+ getSelectionStatus(option: any): string | null;
29
+ imageErrorHandler(event: any, filePath: string): void;
21
30
  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>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<QuestionTypeObjectiveComponent, "lib-question-type-objective", never, { "required": "required"; "question": "question"; "showCorrectAnswers": "showCorrectAnswers"; "imageConfig": "imageConfig"; "answerObj": "answerObj"; }, { "viewChild": "viewChild"; }, never, never>;
23
32
  }
@@ -7,7 +7,7 @@ export declare class AssessmentTakerService {
7
7
  constructor(config: LibraryConfig, http: HttpClient);
8
8
  createParams(params: any): HttpParams;
9
9
  getConfigJSON(fileName: string): import("rxjs").Observable<Object>;
10
- getAssessmentContextById(assessmentId: number): import("rxjs").Observable<Object>;
10
+ getAssessmentContextById(params: any): import("rxjs").Observable<Object>;
11
11
  getAssessmentQuestionPaper(instanceId: number): import("rxjs").Observable<Object>;
12
12
  getAssessmentQuestions(instanceId: any, questionIds: any): import("rxjs").Observable<Object>;
13
13
  getChildQuestionsWithIdList(instanceId: any, questionIds: any): import("rxjs").Observable<Object>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-assessment",
3
- "version": "12.0.21",
3
+ "version": "12.0.22",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=12.0.0",
6
6
  "@angular/core": ">=12.0.0",
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5 12L10 17L20 7" stroke="#14A35B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M18 6L6 18M6 6L18 18" stroke="#E83E05" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -18,5 +18,7 @@
18
18
  "COMMONS_ASSESSMENT.ICON.JPG": "assets/commons-assessment/images/jpg.svg",
19
19
  "COMMONS_ASSESSMENT.ICON.JPEG": "assets/commons-assessment/images/jpeg.svg",
20
20
  "COMMONS_ASSESSMENT.ICON.SVG": "assets/commons-assessment/images/svg.svg",
21
- "COMMONS_ASSESSMENT.ICON.DEFAULT_FILE": "assets/commons-assessment/images/file.svg"
21
+ "COMMONS_ASSESSMENT.ICON.DEFAULT_FILE": "assets/commons-assessment/images/file.svg",
22
+ "COMMONS_ASSESSMENT.ICON.CROSS_RED": "assets/commons-assessment/images/cross-red.svg",
23
+ "COMMONS_ASSESSMENT.ICON.CHECK_GREEN": "assets/commons-assessment/images/check-green.svg"
22
24
  }
@@ -17,6 +17,7 @@ $default-config: (
17
17
  black: #000,
18
18
 
19
19
  danger: #ff5252,
20
+ danger-bg: #FFECE6,
20
21
 
21
22
  primary-one: #467DD6,
22
23
  primary-four: #295eb7,
@@ -195,6 +195,10 @@ GLOBAL stylesheet for commons-assessment library
195
195
  /* Angular <= v14 (legacy) */
196
196
  .mat-radio-button {
197
197
 
198
+ .mat-radio-label-content {
199
+ width: 100%;
200
+ }
201
+
198
202
  &.mat-accent {
199
203
  .mat-radio-inner-circle {
200
204
  background-color: var(--assessment-primary-one) !important;
@@ -232,6 +236,18 @@ GLOBAL stylesheet for commons-assessment library
232
236
  /* Angular <= v14 (legacy) */
233
237
  .mat-checkbox {
234
238
 
239
+ .mat-checkbox-layout {
240
+ width: 100%;
241
+
242
+ .mat-checkbox-inner-container {
243
+ margin-left: 0 !important;
244
+ }
245
+
246
+ .mat-checkbox-label {
247
+ width: 100%;
248
+ }
249
+ }
250
+
235
251
  &.mat-accent {
236
252
 
237
253
  &.mat-checkbox-checked .mat-checkbox-background,