commons-assessment 12.1.0 → 12.1.1

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 (68) hide show
  1. package/README.md +11 -0
  2. package/bundles/commons-assessment.umd.js +1335 -153
  3. package/bundles/commons-assessment.umd.js.map +1 -1
  4. package/esm2015/lib/modules/assessment-maker/assessment-maker.component.js +147 -29
  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 +15 -4
  7. package/esm2015/lib/modules/assessment-maker/components/question-details/question-details.component.js +12 -2
  8. package/esm2015/lib/modules/assessment-maker/services/assessment-builder.service.js +16 -6
  9. package/esm2015/lib/modules/assessment-maker/services/assessment-maker.service.js +18 -2
  10. package/esm2015/lib/modules/assessment-taker/assessment-taker.component.js +370 -42
  11. package/esm2015/lib/modules/assessment-taker/assessment-taker.module.js +9 -3
  12. package/esm2015/lib/modules/assessment-taker/components/proctoring-consent/proctoring-consent.component.js +149 -0
  13. package/esm2015/lib/modules/assessment-taker/components/proctoring-result/proctoring-result.component.js +177 -0
  14. package/esm2015/lib/modules/assessment-taker/components/question-type-date-picker/question-type-date-picker.component.js +2 -3
  15. package/esm2015/lib/modules/assessment-taker/components/question-type-editor/question-type-editor.component.js +1 -1
  16. package/esm2015/lib/modules/assessment-taker/components/question-type-file-upload/question-type-file-upload.component.js +5 -2
  17. package/esm2015/lib/modules/assessment-taker/components/question-type-long/question-type-long.component.js +1 -1
  18. package/esm2015/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.js +7 -3
  19. package/esm2015/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.js +7 -3
  20. package/esm2015/lib/modules/assessment-taker/components/question-type-preference/question-type-preference.component.js +9 -4
  21. package/esm2015/lib/modules/assessment-taker/components/question-type-short/question-type-short.component.js +78 -8
  22. package/esm2015/lib/modules/assessment-taker/components/section-instructions/section-instructions.component.js +1 -1
  23. package/esm2015/lib/modules/assessment-taker/services/assessment-taker.service.js +32 -4
  24. package/esm2015/lib/modules/assessment-taker/services/proctoring.service.js +125 -0
  25. package/esm2015/lib/modules/assessment-taker/services/response-builder.service.js +15 -1
  26. package/esm2015/lib/shared/components/confirmation-dialog/confirmation-dialog.component.js +56 -0
  27. package/esm2015/lib/shared/components/skill-allocation/skill-allocation.component.js +5 -2
  28. package/esm2015/lib/shared/controllers.js +14 -4
  29. package/esm2015/lib/shared/interfaces/assessment.interface.js +1 -1
  30. package/esm2015/lib/shared/interfaces/proctoring.interface.js +2 -0
  31. package/esm2015/lib/shared/material-modules.js +1 -16
  32. package/esm2015/lib/shared/pipes/order-by.pipe.js +4 -3
  33. package/esm2015/lib/shared/shared.module.js +8 -3
  34. package/fesm2015/commons-assessment.js +1227 -119
  35. package/fesm2015/commons-assessment.js.map +1 -1
  36. package/lib/modules/assessment-maker/assessment-maker.component.d.ts +30 -1
  37. package/lib/modules/assessment-maker/components/assessment-builder/assessment-builder.component.d.ts +4 -0
  38. package/lib/modules/assessment-maker/components/question-details/question-details.component.d.ts +3 -0
  39. package/lib/modules/assessment-maker/services/assessment-builder.service.d.ts +10 -3
  40. package/lib/modules/assessment-maker/services/assessment-maker.service.d.ts +14 -11
  41. package/lib/modules/assessment-taker/assessment-taker.component.d.ts +81 -2
  42. package/lib/modules/assessment-taker/assessment-taker.module.d.ts +7 -5
  43. package/lib/modules/assessment-taker/components/proctoring-consent/proctoring-consent.component.d.ts +39 -0
  44. package/lib/modules/assessment-taker/components/proctoring-result/proctoring-result.component.d.ts +82 -0
  45. package/lib/modules/assessment-taker/components/question-type-file-upload/question-type-file-upload.component.d.ts +1 -0
  46. package/lib/modules/assessment-taker/components/question-type-multiselect/question-type-multiselect.component.d.ts +1 -0
  47. package/lib/modules/assessment-taker/components/question-type-objective/question-type-objective.component.d.ts +1 -0
  48. package/lib/modules/assessment-taker/components/question-type-preference/question-type-preference.component.d.ts +1 -0
  49. package/lib/modules/assessment-taker/components/question-type-short/question-type-short.component.d.ts +14 -2
  50. package/lib/modules/assessment-taker/services/assessment-taker.service.d.ts +18 -11
  51. package/lib/modules/assessment-taker/services/proctoring.service.d.ts +40 -0
  52. package/lib/modules/assessment-taker/services/response-builder.service.d.ts +9 -0
  53. package/lib/shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +36 -0
  54. package/lib/shared/components/skill-allocation/skill-allocation.component.d.ts +1 -0
  55. package/lib/shared/controllers.d.ts +10 -1
  56. package/lib/shared/interfaces/assessment.interface.d.ts +3 -0
  57. package/lib/shared/interfaces/proctoring.interface.d.ts +101 -0
  58. package/lib/shared/material-modules.d.ts +5 -8
  59. package/lib/shared/shared.module.d.ts +5 -4
  60. package/package.json +1 -1
  61. package/src/lib/assets/images/proctoring.svg +3 -0
  62. package/src/lib/assets/images/user.svg +3 -0
  63. package/src/lib/assets/json/imageConfig.json +3 -1
  64. package/src/lib/assets/json/labelConfig.json +74 -0
  65. package/src/lib/assets/theme/_theme.global.scss +7 -0
  66. package/src/lib/assets/theme/_theme.scss +17 -346
  67. package/src/lib/assets/theme/styles.global.scss +12 -0
  68. package/src/lib/assets/theme/styles.scss +13 -0
package/README.md CHANGED
@@ -25,6 +25,8 @@ Import the following modules in your application:
25
25
  - `AssessmentMakerModule` (If creating assessments)
26
26
  - `AssessmentTakerModule` (If rendering assessments)
27
27
 
28
+ **Proctoring (optional):** the library does **not** import `@proctorlink/sdk` directly, so apps that don't use proctoring need not install it and build cleanly. If you use proctoring, install it (`npm install @proctorlink/sdk`) and pass a loader to the taker via `[proctorLinkLoader]="() => import('@proctorlink/sdk')"` — the SDK is then fetched on demand only when a proctored session starts, and the module reference stays in your app's bundle. Also allow the proctoring enclave in your app's `Content-Security-Policy`: `frame-src https://app-dev.proctorlink.com;`.
29
+
28
30
  ## Installation & Configuration
29
31
 
30
32
  ### 1. Import Modules
@@ -169,10 +171,15 @@ export class Component {
169
171
  | `[predefinedAssessmentInstance]` | `@Input` | `AssessmentInstance` | The default contextual configuration object for creating new assessment instances. |
170
172
  | `[minimumRequiredSections]` | `@Input` | `number` | Minimum number of sections needed before assessment can be published. Default is 0. |
171
173
  | `[assessmentContext]` | `@Input` | `AssessmentContext` | (Optional) Pre-loaded assessment context data to bypass the initial data load API call. |
174
+ | `[checkForResponses]` | `@Input` | `boolean` | If true, show a warning on deletion of sections and questions if any responses are linked to them. Default is false. |
175
+ | `[showProctoringToggle]` | `@Input` | `boolean` | (Optional) If true, shows a toggle to enable/disable proctoring. Default is false. Works only when partial response submission is allowed. |
176
+ | `[showTimeInput]` | `@Input` | `boolean` | (Optional) If true, shows an optional duration (minutes) input. The value is saved (in seconds) to the assessment instance's `duration` — bundled into the patch API when the instance exists, or set on the created instance otherwise. Leave it empty for an untimed assessment. Default is false. |
172
177
  | `(assessmentIdChange)` | `@Output` | `EventEmitter<number>` | Emits the new `assessmentId` when an assessment is successfully created. |
173
178
  | `(assessmentInstanceIdChange)` | `@Output` | `EventEmitter<number>` | Emits the new instance ID integer when an assessment is published. |
174
179
  | `(snackbarMessage)` | `@Output` | `EventEmitter<{ message: string, type: 'success' \| 'error' \| 'info' }>` | Emits message status updates representing errors and workflow successes from the service. |
175
180
 
181
+ > **Assessment configuration (e.g. allowing partial responses):** behavioral flags such as allowing partial responses are set via `assessmentConfigs` on the assessment DTO. See [Assessment Configuration](../../documentation/assessment-maker.md#assessment-configuration-assessmentconfigs) in the maker documentation for the available config keys and examples.
182
+
176
183
  ### Assessment Taker
177
184
 
178
185
  To render the assessment taker interface, use the `<lib-assessment-taker>` component in your template.
@@ -220,7 +227,11 @@ To render the assessment taker interface, use the `<lib-assessment-taker>` compo
220
227
  | `[showOverallRemarks]` | `@Input` | `boolean` | (Optional) Shows overall remarks field. Default is false. |
221
228
  | `[showCorrectAnswers]` | `@Input` | `boolean` | (Optional) Shows correct and incorrect answers for objective and multiselect type questions. Default is false. |
222
229
  | `[enableSkillsToQuestionMapping]` | `@Input` | `boolean` | (Optional) Enables ability to map skills to questions. Default is false. |
230
+ | `[proctorLinkLoader]` | `@Input` | `() => Promise<any>` | (Optional) Loader for the optional `@proctorlink/sdk`, e.g. `() => import('@proctorlink/sdk')`. Required only when proctoring is enabled; keeps the SDK out of the library bundle so non-proctoring apps don't need the package installed. |
231
+ | `[resumeTimerAcrossVisits]` | `@Input` | `boolean` | (Optional) For timed assessments, anchors the countdown to the assessee's first-visit time (`assesseeResponse.createdAt`) so it keeps elapsing across reloads/absences instead of restarting each visit. On begin, the assessee is created up front (already created when proctoring is enabled) so `createdAt` exists. On return, remaining time = `duration - elapsedSinceCreatedAt`; if it has already elapsed, the timer shows `00:00` and the assessment auto-submits. Default is false. |
232
+ | `[warnOnLeaveDuringProctoring]` | `@Input` | `boolean` | (Optional) While a proctoring session is running, warn the candidate before they refresh/close/navigate away (the browser's native "Leave site?" prompt) or press the in-app Back button (a custom confirmation dialog). Set `false` to disable both warnings. Default is true. |
223
233
  | `(stepChanged)` | `@Output` | `EventEmitter<{ currentStepIndex: number, totalSteps: number, isLastStep: boolean }>` | Emits initially and on every step change. Provides the current step index, total steps, and indicating boolean. |
234
+ | `(consentToProceed)` | `@Output` | `EventEmitter<boolean>` | A full-screen intro gate is shown before the assessment starts when proctoring is enabled, or when `[resumeTimerAcrossVisits]` is set on a timed assessment. It presents the assessment details/warnings (and, for proctoring, the consent notice + reference-photo capture). On proceed, the assessee is created (and the proctoring session started, when proctored) with a loader; emits `true` once the candidate agrees and the assessment begins. |
224
235
  | `(submitAssessment)` | `@Output` | `EventEmitter<{ assesseeId: number, completed: boolean }>` | Emits when the assessment is submitted, containing the `assesseeId` and a `completed` flag indicating if the taker finished the entire assessment. |
225
236
  | `(snackbarMessage)` | `@Output` | `EventEmitter<{ message: string, type: 'success' \| 'error' \| 'info' }>` | Emits message status updates representing errors and workflow successes from the service. |
226
237