QuML player is an angular library built with Angular version 9, and it exports some modules and components.
Component: quml-main-player
This is the main player Component that accepts some configuration (here playerConfig
) based on it will render the player.
While rendering the player it also emits some events such as playerEvent
and telemetryEvent
Let's deep dive into the player input configuration:
Code Block | ||
---|---|---|
| ||
export interface QumlPlayerConfig = { config: Config; context: Context; metadata: Metadata; } |
Config -
Required
This Required property from theplayerConfig
provides the configuration for the player to enable/disable some functionalities.
Along with this it also provides the state of the content, if available.
Code Block | ||
---|---|---|
| ||
export interface Config { traceId?: string; sideMenu?: { enable?: boolean; showShare?: boolean; showDownload?: boolean; showReplay?: boolean; showExit?: boolean; }; progressBar: any[]; questions: any[]; lastQuestionId: string; duration: number; } |
Description of the properties for the config
Property | Default Value | Required | Description |
---|---|---|---|
traceId | null | false | To trace the error |
sideMenu.enable | true | false | To show the sidebar menu / hamburger menu |
sideMenu.showShare | true | false | To enable the share functionality |
sideMenu.showDownload | true | false | To enable the Download functionality |
sideMenu.showReplay | true | false | To enable the Replay functionality |
sideMenu.showExit | true | false | To enable the exit functionality |
progressBar | [ ] | true | Previous saved state for progressBar |
questions | [ ] | true | Previous saved state for questions |
lastQuestionId | null | true | Last accessed question Identifier |
duration | 0 | true | Last player duration |
Context -
Required
This Required property from the playerConfig provides the context to the player mostly in terms of the telemetry.
Along with this it also provides the state of the content, if available.
Code Block | ||
---|---|---|
| ||
export interface Context { mode: string; threshold?: number; authToken?: string; sid: string; did: string; uid: string; channel: string; pdata: Pdata; contextRollup: ContextRollup; tags: string[]; cdata?: Cdata[]; timeDiff?: number; objectRollup?: ObjectRollup; host?: string; endpoint?: string; userData?: { firstName: string; lastName: string; }; } |
Description of the properties for the config
Property | Required | Description |
---|---|---|
mode | true | Mode is |
threshold | false | Threshold number to fetch the questions with question API |
authToken | false | Authentication token |
sid | true | session id of the requestor stamped by portal |
did | true | uuid of the device |
channel | true | Channel which has produced the event |
pdata | true | Producer of the event |
contextRollup | true | oontext Rollups upto level 4 |
tags | true | Encrypted dimension tags passed by respective channels |
cdata | false | Correlation data |
timeDiff | false | Last player duration |
objectRollup | false | Object Rollup up to level 4 |
host | false | Host URL |
endpoint | false | Telemetry API endpoint |
userData.firstName | false | User's first name |
userData.lastName | false | User's last name |
Metadata:
Required
Following is the interface for the metadata:
Code Block | ||
---|---|---|
| ||
export interface Metadata { instructions: Object; // May Contain default instructions showStartPage: boolean; timeLimits: Object; // Contains maxTime and warningTime in number of seconds navigationMode: string; maxScore: number; showTimer: string, name: string; description: string; allowSkip: string; primaryCategory: string; mimeType: string; objectType: string; maxAttempts: number; showHints: string; showFeedback: string; requiresSubmit: string; showSolutions: string; shuffle: boolean; [propName: string]: any; } |
The followings are some of the properties related to the question set response, it will have other properties of content as well.
Property | Description |
---|---|
instructions | These are instructions that will be placed on the first page of the question set or the section |
showStartPage | This config used to show or hide the start page in questionset |
timeLimits | This config used to show the maximum time to attempt the test with the warning time |
navigationMode | Navigation of the questionset such as Linear, non-linear |
maxScore | Total maxscore of the questionset |
showTimer | To show the timer in descending order |
name | Name of the Questionset |
description | Description of the questionset |
allowSkip | COnfig to tell the player if skipping the questions are allowed |
primaryCategory | Primary Category of the questionset e.g. Practice Question Set |
mimeType | MimeType of the questionset which is 'application/vnd.sunbird.questionset' |
maxAttempts | Maximum number of attempts one can take |
showHints | Config to show/hide the hint button |
showFeedback | COnfig to show/hide feedback page |
requiresSubmit | Config to show/hide the submit button |
showSolutions | COnfig to show/hide the solution button |
shuffle | Config to enable/disable the shuffle in questions |