From 494a7bf35603bfb8c4121b27dfdadd5dd13ecfbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Mon, 10 Jul 2023 16:04:49 +0100 Subject: [PATCH 01/12] refactor model --- projects/ngx-xapi/model/src/lib/about.ts | 4 +- projects/ngx-xapi/model/src/lib/account.ts | 4 + .../model/src/lib/activity-definition.ts | 42 ----- projects/ngx-xapi/model/src/lib/activity.ts | 95 ++++++++++- projects/ngx-xapi/model/src/lib/actor.ts | 49 +++++- projects/ngx-xapi/model/src/lib/agent.ts | 10 -- projects/ngx-xapi/model/src/lib/attachment.ts | 15 ++ .../model/src/lib/context-activities.ts | 8 - projects/ngx-xapi/model/src/lib/context.ts | 16 -- projects/ngx-xapi/model/src/lib/group.ts | 12 -- .../model/src/lib/interaction-component.ts | 6 - projects/ngx-xapi/model/src/lib/person.ts | 11 ++ projects/ngx-xapi/model/src/lib/result.ts | 25 ++- projects/ngx-xapi/model/src/lib/score.ts | 23 --- .../model/src/lib/statement-object.ts | 3 - .../model/src/lib/statement-reference.ts | 4 - projects/ngx-xapi/model/src/lib/statement.ts | 38 ++++- projects/ngx-xapi/model/src/lib/verb.ts | 150 ++++++++++++++++++ projects/ngx-xapi/model/src/public-api.ts | 12 +- projects/ngx-xapi/src/public-api.ts | 6 + target/npmlist.json | 1 + 21 files changed, 386 insertions(+), 148 deletions(-) create mode 100644 projects/ngx-xapi/model/src/lib/account.ts delete mode 100644 projects/ngx-xapi/model/src/lib/activity-definition.ts delete mode 100644 projects/ngx-xapi/model/src/lib/agent.ts create mode 100644 projects/ngx-xapi/model/src/lib/attachment.ts delete mode 100644 projects/ngx-xapi/model/src/lib/context-activities.ts delete mode 100644 projects/ngx-xapi/model/src/lib/context.ts delete mode 100644 projects/ngx-xapi/model/src/lib/group.ts delete mode 100644 projects/ngx-xapi/model/src/lib/interaction-component.ts create mode 100644 projects/ngx-xapi/model/src/lib/person.ts delete mode 100644 projects/ngx-xapi/model/src/lib/score.ts delete mode 100644 projects/ngx-xapi/model/src/lib/statement-object.ts delete mode 100644 projects/ngx-xapi/model/src/lib/statement-reference.ts create mode 100644 target/npmlist.json diff --git a/projects/ngx-xapi/model/src/lib/about.ts b/projects/ngx-xapi/model/src/lib/about.ts index d2dcea3..342a6fe 100644 --- a/projects/ngx-xapi/model/src/lib/about.ts +++ b/projects/ngx-xapi/model/src/lib/about.ts @@ -1,4 +1,6 @@ +import { Extensions } from './extensions'; + export interface About { version: string[]; - extensions?: object; + extensions?: Extensions; } diff --git a/projects/ngx-xapi/model/src/lib/account.ts b/projects/ngx-xapi/model/src/lib/account.ts new file mode 100644 index 0000000..29199ed --- /dev/null +++ b/projects/ngx-xapi/model/src/lib/account.ts @@ -0,0 +1,4 @@ +export interface Account { + homePage?: string; + name?: string; +} diff --git a/projects/ngx-xapi/model/src/lib/activity-definition.ts b/projects/ngx-xapi/model/src/lib/activity-definition.ts deleted file mode 100644 index d71be37..0000000 --- a/projects/ngx-xapi/model/src/lib/activity-definition.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Extensions } from './extensions'; -import { InteractionComponent } from './interaction-component'; -import { LanguageMap } from './language-map'; - -export interface ActivityDefinition { - name?: LanguageMap; - - description?: LanguageMap; - - type?: string; // Should be IRI - - moreInfo?: string; // Should be IRI - - interactionType?: InteractionType; - - correctResponsesPattern?: string[]; - - choices?: InteractionComponent[]; - - scale?: InteractionComponent[]; - - source?: InteractionComponent[]; - - target?: InteractionComponent[]; - - steps?: InteractionComponent[]; - - extensions?: Extensions; -} - -enum InteractionType { - TrueFalse = 'true-false', - Choice = 'choice', - FillIn = 'fill-in', - LongFillIn = 'long-fill-in', - Matching = 'matching', - Performance = 'performance', - Sequencing = 'sequencing', - Likert = 'likert', - Numeric = 'numeric', - Other = 'other', -} diff --git a/projects/ngx-xapi/model/src/lib/activity.ts b/projects/ngx-xapi/model/src/lib/activity.ts index a212c3b..68d0e1f 100644 --- a/projects/ngx-xapi/model/src/lib/activity.ts +++ b/projects/ngx-xapi/model/src/lib/activity.ts @@ -1,7 +1,96 @@ -import { ActivityDefinition } from './activity-definition'; -import { StatementObject } from './statement-object'; +import { Extensions } from './extensions'; +import { LanguageMap } from './language-map'; -export interface Activity extends StatementObject { +interface ActivityDefinitionType { + name?: LanguageMap; + description?: LanguageMap; + type?: string; // Should be IRI + moreInfo?: string; // Should be IRI + extensions?: Extensions; +} + +interface InteractionActivityDefinitionType extends ActivityDefinitionType { + type: 'http://adlnet.gov/expapi/activities/cmi.interaction'; + correctResponsesPattern?: string[]; +} + +export interface InteractionComponent { + id: string; + description: LanguageMap; +} + +export interface TrueFalseInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'true-false'; + correctResponsesPattern?: ['true'] | ['false']; +} + +export interface ChoiceInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'choice'; + choices?: InteractionComponent[]; +} + +export interface FillInInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'fill-in'; +} + +export interface LongFillInInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'long-fill-in'; +} + +export interface LikertInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'likert'; + scale?: InteractionComponent[]; +} + +export interface MatchingInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'matching'; + source?: InteractionComponent[]; + target?: InteractionComponent[]; +} + +export interface PerformanceInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'performance'; + steps?: InteractionComponent[]; +} + +export interface SequencingInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'sequencing'; + choices?: InteractionComponent[]; +} + +export interface NumericInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'numeric'; +} + +export interface OtherInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'other'; +} + +export type ActivityDefinition = + | ActivityDefinitionType + | TrueFalseInteractionActivityDefinition + | ChoiceInteractionActivityDefinition + | FillInInteractionActivityDefinition + | LongFillInInteractionActivityDefinition + | LikertInteractionActivityDefinition + | MatchingInteractionActivityDefinition + | PerformanceInteractionActivityDefinition + | SequencingInteractionActivityDefinition + | NumericInteractionActivityDefinition + | OtherInteractionActivityDefinition; + +export interface Activity { + objectType: 'Activity'; id: string; // Should be IRI definition?: ActivityDefinition; } diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index a017a96..3f196d5 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -1,13 +1,50 @@ -/** - * The Actor defines who performed the action. The Actor of a Statement can be - * an Agent or a Group. - */ -export interface Actor { +import { Account } from './account'; + +interface IdentifiedActor { objectType?: string; name?: string; mbox?: string; mbox_sha1sum?: string; openid?: string; - account?: { name: string; homePage: string }; + account?: Account; +} + +/** + * An Agent (an individual) is a persona or system. + */ +export interface Agent extends IdentifiedActor { + objectType: 'Agent'; +} + +/** + * An Anonymous Group is used to describe a cluster of people where there is + * no ready identifier for this cluster, e.g. an ad hoc team. + */ +export interface AnonymousGroup { + objectType: 'Group'; + name?: string; + member: Agent[]; } + +/** + * An Identified Group is used to uniquely identify a cluster of Agents. + */ +export interface IdentifiedGroup extends IdentifiedActor { + objectType: 'Group'; + name?: string; + member?: Agent[]; +} + +/** + * A Group represents a collection of Agents and can be used in most of the + * same situations an Agent can be used. There are two types of Groups: + * Anonymous Groups and Identified Groups. + */ +export type Group = AnonymousGroup | IdentifiedGroup; + +/** + * The Actor defines who performed the action. The Actor of a Statement can be + * an Agent or a Group. + */ +export type Actor = Agent | Group; diff --git a/projects/ngx-xapi/model/src/lib/agent.ts b/projects/ngx-xapi/model/src/lib/agent.ts deleted file mode 100644 index 1e9d89c..0000000 --- a/projects/ngx-xapi/model/src/lib/agent.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Actor } from './actor'; - -/** - * An Agent (an individual) is a persona or system. - */ -export interface Agent extends Actor { - invalid?: string; // TODO remove property - - // TODO make lint -} diff --git a/projects/ngx-xapi/model/src/lib/attachment.ts b/projects/ngx-xapi/model/src/lib/attachment.ts new file mode 100644 index 0000000..adb2124 --- /dev/null +++ b/projects/ngx-xapi/model/src/lib/attachment.ts @@ -0,0 +1,15 @@ +import { LanguageMap } from './language-map'; + +export interface Attachment { + usageType: AttachmentUsageType | string; + display: LanguageMap; + contentType: string; + length: number; + sha2: string; + description?: LanguageMap; + fileUrl?: string; +} + +export enum AttachmentUsageType { + SIGNATURE = 'http://adlnet.gov/expapi/attachments/signature', +} diff --git a/projects/ngx-xapi/model/src/lib/context-activities.ts b/projects/ngx-xapi/model/src/lib/context-activities.ts deleted file mode 100644 index 72e175c..0000000 --- a/projects/ngx-xapi/model/src/lib/context-activities.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Activity } from './activity'; - -export interface ContextActivities { - parent?: Activity[]; - grouping?: Activity[]; - category?: Activity[]; - other?: Activity[]; -} diff --git a/projects/ngx-xapi/model/src/lib/context.ts b/projects/ngx-xapi/model/src/lib/context.ts deleted file mode 100644 index c583e7b..0000000 --- a/projects/ngx-xapi/model/src/lib/context.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ContextActivities } from './context-activities'; -import { Extensions } from './extensions'; -import { Group } from './group'; -import { StatementReference } from './statement-reference'; - -export interface Context { - registration?: string; // UUID - // TODO add optional instructor - team?: Group; - contextActivities?: ContextActivities; - revision?: string; - platform?: string; - language?: string; - statement?: StatementReference; - extensions?: Extensions; -} diff --git a/projects/ngx-xapi/model/src/lib/group.ts b/projects/ngx-xapi/model/src/lib/group.ts deleted file mode 100644 index 677e981..0000000 --- a/projects/ngx-xapi/model/src/lib/group.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Actor } from './actor'; -import { Agent } from './agent'; - -/** - * A Group represents a collection of Agents and can be used in most of the - * same situations an Agent can be used. There are two types of Groups: - * Anonymous Groups and Identified Groups. - */ -export interface Group extends Actor { - name?: string; - member?: Agent[]; -} diff --git a/projects/ngx-xapi/model/src/lib/interaction-component.ts b/projects/ngx-xapi/model/src/lib/interaction-component.ts deleted file mode 100644 index 23d09d2..0000000 --- a/projects/ngx-xapi/model/src/lib/interaction-component.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { LanguageMap } from './language-map'; - -export interface InteractionComponent { - id: string; - description: LanguageMap; -} diff --git a/projects/ngx-xapi/model/src/lib/person.ts b/projects/ngx-xapi/model/src/lib/person.ts new file mode 100644 index 0000000..d51daf0 --- /dev/null +++ b/projects/ngx-xapi/model/src/lib/person.ts @@ -0,0 +1,11 @@ +import { Account } from './account'; + +export interface Person { + objectType: 'Person'; + name?: string[]; + + mbox?: string[]; + mbox_sha1sum?: string[]; + openid?: string[]; + account?: Account[]; +} diff --git a/projects/ngx-xapi/model/src/lib/result.ts b/projects/ngx-xapi/model/src/lib/result.ts index 6f3947e..583cae6 100644 --- a/projects/ngx-xapi/model/src/lib/result.ts +++ b/projects/ngx-xapi/model/src/lib/result.ts @@ -1,5 +1,28 @@ import { Extensions } from './extensions'; -import { Score } from './score'; + +export interface Score { + /** + * The score related to the experience as modified by scaling and/or + * normalization. + */ + scaled?: number; + + /** + * The score achieved by the Actor in the experience described by the + * Statement. This is not modified by any scaling or normalization. + */ + raw?: number; + + /** + * The lowest possible score for the experience described by the Statement. + */ + min?: number; + + /** + * The highest possible score for the experience described by the Statement. + */ + max?: number; +} export interface Result { score?: Score; diff --git a/projects/ngx-xapi/model/src/lib/score.ts b/projects/ngx-xapi/model/src/lib/score.ts deleted file mode 100644 index f448315..0000000 --- a/projects/ngx-xapi/model/src/lib/score.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface Score { - /** - * The score related to the experience as modified by scaling and/or - * normalization. - */ - scaled?: number; - - /** - * The score achieved by the Actor in the experience described by the - * Statement. This is not modified by any scaling or normalization. - */ - raw?: number; - - /** - * The lowest possible score for the experience described by the Statement. - */ - min?: number; - - /** - * The highest possible score for the experience described by the Statement. - */ - max?: number; -} diff --git a/projects/ngx-xapi/model/src/lib/statement-object.ts b/projects/ngx-xapi/model/src/lib/statement-object.ts deleted file mode 100644 index 2d22ff9..0000000 --- a/projects/ngx-xapi/model/src/lib/statement-object.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface StatementObject { - objectType?: string; -} diff --git a/projects/ngx-xapi/model/src/lib/statement-reference.ts b/projects/ngx-xapi/model/src/lib/statement-reference.ts deleted file mode 100644 index de7e679..0000000 --- a/projects/ngx-xapi/model/src/lib/statement-reference.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface StatementReference { - objectType: string; - id: string; // UUID -} diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index 0236a05..330960e 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -1,17 +1,47 @@ import { Activity } from './activity'; -import { Actor } from './actor'; -import { Context } from './context'; +import { Actor, Group } from './actor'; +import { Attachment } from './attachment'; +import { Extensions } from './extensions'; import { Result } from './result'; import { Verb } from './verb'; +export interface StatementReference { + objectType: 'StatementRef'; + id: string; // UUID +} + +export interface ContextActivities { + parent?: Activity[]; + grouping?: Activity[]; + category?: Activity[]; + other?: Activity[]; +} + +export interface Context { + registration?: string; // UUID + instructor?: Actor; + team?: Group; + contextActivities?: ContextActivities; + revision?: string; + platform?: string; + language?: string; + statement?: StatementReference; + extensions?: Extensions; +} + export interface Statement { id?: string; // UUID actor: Actor; verb: Verb; - object: Activity; // TODO add other types + object: Activity | StatementReference | Actor | SubStatement; result?: Result; context?: Context; timestamp?: string; // Timestamp + stored?: string; // Timestamp + authority?: Actor; + attachments?: Attachment[]; +} - // TODO add other properties +export interface SubStatement extends Statement { + object: Activity | StatementReference | Actor; } diff --git a/projects/ngx-xapi/model/src/lib/verb.ts b/projects/ngx-xapi/model/src/lib/verb.ts index 4719652..d9c8069 100644 --- a/projects/ngx-xapi/model/src/lib/verb.ts +++ b/projects/ngx-xapi/model/src/lib/verb.ts @@ -5,3 +5,153 @@ export interface Verb { display?: LanguageMap; } + +export const answered: Verb = { + id: 'http://adlnet.gov/expapi/verbs/answered', + display: { en: 'answered' }, +}; + +export const asked: Verb = { + id: 'http://adlnet.gov/expapi/verbs/asked', + display: { en: 'asked' }, +}; + +export const attempted: Verb = { + id: 'http://adlnet.gov/expapi/verbs/attempted', + display: { en: 'attempted' }, +}; + +export const attended: Verb = { + id: 'http://adlnet.gov/expapi/verbs/attended', + display: { en: 'attended' }, +}; + +export const commented: Verb = { + id: 'http://adlnet.gov/expapi/verbs/commented', + display: { en: 'commented' }, +}; + +export const completed: Verb = { + id: 'http://adlnet.gov/expapi/verbs/completed', + display: { en: 'completed' }, +}; + +export const exited: Verb = { + id: 'http://adlnet.gov/expapi/verbs/exited', + display: { en: 'exited' }, +}; + +export const experienced: Verb = { + id: 'http://adlnet.gov/expapi/verbs/experienced', + display: { en: 'experienced' }, +}; + +export const failed: Verb = { + id: 'http://adlnet.gov/expapi/verbs/failed', + display: { en: 'failed' }, +}; + +export const imported: Verb = { + id: 'http://adlnet.gov/expapi/verbs/imported', + display: { en: 'imported' }, +}; + +export const initialized: Verb = { + id: 'http://adlnet.gov/expapi/verbs/initialized', + display: { en: 'initialized' }, +}; + +export const interacted: Verb = { + id: 'http://adlnet.gov/expapi/verbs/interacted', + display: { en: 'interacted' }, +}; + +export const launched: Verb = { + id: 'http://adlnet.gov/expapi/verbs/launched', + display: { en: 'launched' }, +}; + +export const mastered: Verb = { + id: 'http://adlnet.gov/expapi/verbs/mastered', + display: { en: 'mastered' }, +}; + +export const passed: Verb = { + id: 'http://adlnet.gov/expapi/verbs/passed', + display: { en: 'passed' }, +}; + +export const preferred: Verb = { + id: 'http://adlnet.gov/expapi/verbs/preferred', + display: { en: 'preferred' }, +}; + +export const progressed: Verb = { + id: 'http://adlnet.gov/expapi/verbs/progressed', + display: { en: 'progressed' }, +}; + +export const registered: Verb = { + id: 'http://adlnet.gov/expapi/verbs/registered', + display: { en: 'registered' }, +}; + +export const responded: Verb = { + id: 'http://adlnet.gov/expapi/verbs/responded', + display: { en: 'responded' }, +}; + +export const resumed: Verb = { + id: 'http://adlnet.gov/expapi/verbs/resumed', + display: { en: 'resumed' }, +}; + +export const scored: Verb = { + id: 'http://adlnet.gov/expapi/verbs/scored', + display: { en: 'scored' }, +}; + +export const shared: Verb = { + id: 'http://adlnet.gov/expapi/verbs/shared', + display: { en: 'shared' }, +}; + +export const suspended: Verb = { + id: 'http://adlnet.gov/expapi/verbs/suspended', + display: { en: 'suspended' }, +}; + +export const terminated: Verb = { + id: 'http://adlnet.gov/expapi/verbs/terminated', + display: { en: 'terminated' }, +}; + +export const voided: Verb = { + id: 'http://adlnet.gov/expapi/verbs/voided', + display: { en: 'voided' }, +}; + +export const abandoned: Verb = { + id: 'https://w3id.org/xapi/adl/verbs/abandoned', + display: { en: 'abandoned' }, +}; + +export const loggedIn: Verb = { + id: 'https://w3id.org/xapi/adl/verbs/logged-in', + display: { en: 'logged in' }, +}; + +export const loggedOut: Verb = { + id: 'https://w3id.org/xapi/adl/verbs/logged-out', + display: { en: 'logged out' }, +}; + +export const satisfied: Verb = { + id: 'https://w3id.org/xapi/adl/verbs/satisfied', + display: { en: 'satisfied' }, +}; + +export const waived: Verb = { + id: 'https://w3id.org/xapi/adl/verbs/waived', + display: { en: 'waived' }, +}; diff --git a/projects/ngx-xapi/model/src/public-api.ts b/projects/ngx-xapi/model/src/public-api.ts index 4baa680..f8ab297 100644 --- a/projects/ngx-xapi/model/src/public-api.ts +++ b/projects/ngx-xapi/model/src/public-api.ts @@ -3,20 +3,14 @@ */ export * from './lib/about'; -export * from './lib/activity-definition'; +export * from './lib/account'; export * from './lib/activity'; export * from './lib/actor'; -export * from './lib/agent'; -export * from './lib/context-activities'; -export * from './lib/context'; +export * from './lib/attachment'; export * from './lib/extensions'; -export * from './lib/group'; -export * from './lib/interaction-component'; export * from './lib/language-map'; +export * from './lib/person'; export * from './lib/result'; -export * from './lib/score'; -export * from './lib/statement-object'; -export * from './lib/statement-reference'; export * from './lib/statement-result'; export * from './lib/statement'; export * from './lib/verb'; diff --git a/projects/ngx-xapi/src/public-api.ts b/projects/ngx-xapi/src/public-api.ts index 4037539..31a8dfe 100644 --- a/projects/ngx-xapi/src/public-api.ts +++ b/projects/ngx-xapi/src/public-api.ts @@ -3,3 +3,9 @@ */ export const XAPI_VERSION = '1.0.3'; + +export * from '@berry-cloud/ngx-xapi/model'; +export { + LanguageMapPipe, + LanguageMapPipeModule, +} from '@berry-cloud/ngx-xapi/client'; diff --git a/target/npmlist.json b/target/npmlist.json new file mode 100644 index 0000000..4bd7041 --- /dev/null +++ b/target/npmlist.json @@ -0,0 +1 @@ +{"version":"0.0.0","name":"@berry-cloud/ngx-xapi","dependencies":{"@angular/animations":{"version":"16.1.4"},"@angular/common":{"version":"16.1.4"},"@angular/compiler":{"version":"16.1.4"},"@angular/core":{"version":"16.1.4"},"@angular/forms":{"version":"16.1.4"},"@angular/platform-browser-dynamic":{"version":"16.1.4"},"@angular/platform-browser":{"version":"16.1.4"},"@angular/router":{"version":"16.1.4"},"@types/uuid":{"version":"9.0.2"},"rxjs":{"version":"7.8.1"},"tslib":{"version":"2.6.0"},"uuid":{"version":"9.0.0"},"zone.js":{"version":"0.13.1"}}} \ No newline at end of file From 755f2a5c63724c96c28a20386d679bf41e8b23ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 08:44:28 +0100 Subject: [PATCH 02/12] fixup --- projects/ngx-xapi/client/src/public-api.ts | 1 + projects/ngx-xapi/model/src/lib/activity.ts | 41 +++++++++----------- projects/ngx-xapi/model/src/lib/actor.ts | 15 ++++--- projects/ngx-xapi/model/src/lib/statement.ts | 1 + projects/ngx-xapi/src/public-api.ts | 5 +-- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/projects/ngx-xapi/client/src/public-api.ts b/projects/ngx-xapi/client/src/public-api.ts index 45878c1..8ec51a0 100644 --- a/projects/ngx-xapi/client/src/public-api.ts +++ b/projects/ngx-xapi/client/src/public-api.ts @@ -4,6 +4,7 @@ export * from './lib/language-map/language-map.module'; export * from './lib/language-map/language-map.pipe'; +export * from './lib/language-map/format-language-map'; export * from './lib/agent-profile-params'; export * from './lib/lrs-client'; export * from './lib/state-params'; diff --git a/projects/ngx-xapi/model/src/lib/activity.ts b/projects/ngx-xapi/model/src/lib/activity.ts index 68d0e1f..217c9ac 100644 --- a/projects/ngx-xapi/model/src/lib/activity.ts +++ b/projects/ngx-xapi/model/src/lib/activity.ts @@ -1,17 +1,25 @@ import { Extensions } from './extensions'; import { LanguageMap } from './language-map'; -interface ActivityDefinitionType { +interface ActivityDefinition { name?: LanguageMap; description?: LanguageMap; type?: string; // Should be IRI moreInfo?: string; // Should be IRI extensions?: Extensions; + + interactionType?: string; + correctResponsesPattern?: string[]; + + choices?: InteractionComponent[]; + scale?: InteractionComponent[]; + source?: InteractionComponent[]; + target?: InteractionComponent[]; + steps?: InteractionComponent[]; } -interface InteractionActivityDefinitionType extends ActivityDefinitionType { +interface InteractionActivityDefinitionType extends ActivityDefinition { type: 'http://adlnet.gov/expapi/activities/cmi.interaction'; - correctResponsesPattern?: string[]; } export interface InteractionComponent { @@ -28,7 +36,7 @@ export interface TrueFalseInteractionActivityDefinition export interface ChoiceInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'choice'; - choices?: InteractionComponent[]; + choices: InteractionComponent[]; } export interface FillInInteractionActivityDefinition @@ -44,26 +52,26 @@ export interface LongFillInInteractionActivityDefinition export interface LikertInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'likert'; - scale?: InteractionComponent[]; + scale: InteractionComponent[]; } export interface MatchingInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'matching'; - source?: InteractionComponent[]; - target?: InteractionComponent[]; + source: InteractionComponent[]; + target: InteractionComponent[]; } export interface PerformanceInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'performance'; - steps?: InteractionComponent[]; + steps: InteractionComponent[]; } export interface SequencingInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'sequencing'; - choices?: InteractionComponent[]; + choices: InteractionComponent[]; } export interface NumericInteractionActivityDefinition @@ -76,21 +84,8 @@ export interface OtherInteractionActivityDefinition interactionType: 'other'; } -export type ActivityDefinition = - | ActivityDefinitionType - | TrueFalseInteractionActivityDefinition - | ChoiceInteractionActivityDefinition - | FillInInteractionActivityDefinition - | LongFillInInteractionActivityDefinition - | LikertInteractionActivityDefinition - | MatchingInteractionActivityDefinition - | PerformanceInteractionActivityDefinition - | SequencingInteractionActivityDefinition - | NumericInteractionActivityDefinition - | OtherInteractionActivityDefinition; - export interface Activity { - objectType: 'Activity'; + objectType?: 'Activity'; id: string; // Should be IRI definition?: ActivityDefinition; } diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index 3f196d5..960c499 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -1,6 +1,6 @@ import { Account } from './account'; -interface IdentifiedActor { +interface ActorType { objectType?: string; name?: string; @@ -13,24 +13,29 @@ interface IdentifiedActor { /** * An Agent (an individual) is a persona or system. */ -export interface Agent extends IdentifiedActor { - objectType: 'Agent'; +export interface Agent extends ActorType { + objectType?: 'Agent'; } /** * An Anonymous Group is used to describe a cluster of people where there is * no ready identifier for this cluster, e.g. an ad hoc team. */ -export interface AnonymousGroup { +export interface AnonymousGroup extends ActorType { objectType: 'Group'; name?: string; member: Agent[]; + + mbox: undefined; + mbox_sha1sum: undefined; + openid: undefined; + account: undefined; } /** * An Identified Group is used to uniquely identify a cluster of Agents. */ -export interface IdentifiedGroup extends IdentifiedActor { +export interface IdentifiedGroup extends ActorType { objectType: 'Group'; name?: string; member?: Agent[]; diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index 330960e..98dea9f 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -43,5 +43,6 @@ export interface Statement { } export interface SubStatement extends Statement { + objectType: 'SubStatement'; object: Activity | StatementReference | Actor; } diff --git a/projects/ngx-xapi/src/public-api.ts b/projects/ngx-xapi/src/public-api.ts index 31a8dfe..49cdfef 100644 --- a/projects/ngx-xapi/src/public-api.ts +++ b/projects/ngx-xapi/src/public-api.ts @@ -5,7 +5,4 @@ export const XAPI_VERSION = '1.0.3'; export * from '@berry-cloud/ngx-xapi/model'; -export { - LanguageMapPipe, - LanguageMapPipeModule, -} from '@berry-cloud/ngx-xapi/client'; +export * from '@berry-cloud/ngx-xapi/client'; From 59e5494c441d08b38366e3da2c8f1f2b7119388f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 08:50:54 +0100 Subject: [PATCH 03/12] sss --- target/npmlist.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 target/npmlist.json diff --git a/target/npmlist.json b/target/npmlist.json deleted file mode 100644 index 4bd7041..0000000 --- a/target/npmlist.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"0.0.0","name":"@berry-cloud/ngx-xapi","dependencies":{"@angular/animations":{"version":"16.1.4"},"@angular/common":{"version":"16.1.4"},"@angular/compiler":{"version":"16.1.4"},"@angular/core":{"version":"16.1.4"},"@angular/forms":{"version":"16.1.4"},"@angular/platform-browser-dynamic":{"version":"16.1.4"},"@angular/platform-browser":{"version":"16.1.4"},"@angular/router":{"version":"16.1.4"},"@types/uuid":{"version":"9.0.2"},"rxjs":{"version":"7.8.1"},"tslib":{"version":"2.6.0"},"uuid":{"version":"9.0.0"},"zone.js":{"version":"0.13.1"}}} \ No newline at end of file From 507f0f9c928daee31b1da2aa1c0323ea1bcf279b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 10:22:25 +0100 Subject: [PATCH 04/12] refine the actor model --- package-lock.json | 6 +++ package.json | 1 + projects/ngx-xapi/model/src/lib/actor.ts | 53 ++++++++++++++---------- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95b9005..d1c2409 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@angular/router": "^16.1.0", "@types/uuid": "^9.0.2", "rxjs": "~7.8.0", + "ts-xor": "^1.1.0", "tslib": "^2.3.0", "uuid": "^9.0.0", "zone.js": "~0.13.0" @@ -10800,6 +10801,11 @@ "tree-kill": "cli.js" } }, + "node_modules/ts-xor": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ts-xor/-/ts-xor-1.1.0.tgz", + "integrity": "sha512-9vtspo9gVrmJR0XQyuNySpr6DhZztCDWS8LT5CO4gSeifILDRi4e8QZ0ixnvCyob9hMYRaOeo+OyW3ovhngjuA==" + }, "node_modules/tslib": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", diff --git a/package.json b/package.json index 1ec4cd7..2cebf9d 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@angular/router": "^16.1.0", "@types/uuid": "^9.0.2", "rxjs": "~7.8.0", + "ts-xor": "^1.1.0", "tslib": "^2.3.0", "uuid": "^9.0.0", "zone.js": "~0.13.0" diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index 960c499..44c34ab 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -1,45 +1,52 @@ +import { XOR } from 'ts-xor'; import { Account } from './account'; -interface ActorType { +type ActorType = { objectType?: string; name?: string; - - mbox?: string; - mbox_sha1sum?: string; - openid?: string; - account?: Account; -} +}; + +type IdentifiedActor = XOR< + { + mbox: string; + }, + XOR< + { + mbox_sha1sum: string; + }, + XOR< + { + openid: string; + }, + { + account: Account; + } + > + > +>; /** * An Agent (an individual) is a persona or system. */ -export interface Agent extends ActorType { - objectType?: 'Agent'; -} +export type Agent = ActorType & IdentifiedActor & { objectType?: 'Agent' }; /** * An Anonymous Group is used to describe a cluster of people where there is * no ready identifier for this cluster, e.g. an ad hoc team. */ -export interface AnonymousGroup extends ActorType { +export type AnonymousGroup = ActorType & { objectType: 'Group'; - name?: string; member: Agent[]; - - mbox: undefined; - mbox_sha1sum: undefined; - openid: undefined; - account: undefined; -} +}; /** * An Identified Group is used to uniquely identify a cluster of Agents. */ -export interface IdentifiedGroup extends ActorType { - objectType: 'Group'; - name?: string; - member?: Agent[]; -} +export type IdentifiedGroup = ActorType & + IdentifiedActor & { + objectType: 'Group'; + member?: Agent[]; + }; /** * A Group represents a collection of Agents and can be used in most of the From 1a81a01d7a27de22f9d501d56c157e124dd2159a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 10:36:33 +0100 Subject: [PATCH 05/12] remove ts-xor dependency --- package-lock.json | 6 ---- package.json | 1 - projects/ngx-xapi/model/src/lib/actor.ts | 41 ++++++++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1c2409..95b9005 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "@angular/router": "^16.1.0", "@types/uuid": "^9.0.2", "rxjs": "~7.8.0", - "ts-xor": "^1.1.0", "tslib": "^2.3.0", "uuid": "^9.0.0", "zone.js": "~0.13.0" @@ -10801,11 +10800,6 @@ "tree-kill": "cli.js" } }, - "node_modules/ts-xor": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ts-xor/-/ts-xor-1.1.0.tgz", - "integrity": "sha512-9vtspo9gVrmJR0XQyuNySpr6DhZztCDWS8LT5CO4gSeifILDRi4e8QZ0ixnvCyob9hMYRaOeo+OyW3ovhngjuA==" - }, "node_modules/tslib": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", diff --git a/package.json b/package.json index 2cebf9d..1ec4cd7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "@angular/router": "^16.1.0", "@types/uuid": "^9.0.2", "rxjs": "~7.8.0", - "ts-xor": "^1.1.0", "tslib": "^2.3.0", "uuid": "^9.0.0", "zone.js": "~0.13.0" diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index 44c34ab..f6c08d3 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -6,24 +6,31 @@ type ActorType = { name?: string; }; -type IdentifiedActor = XOR< - { - mbox: string; - }, - XOR< - { +type IdentifiedActor = + | { + mbox: string; + mbox_sha1sum?: undefined; + openid?: undefined; + account?: undefined; + } + | { + mbox?: undefined; mbox_sha1sum: string; - }, - XOR< - { - openid: string; - }, - { - account: Account; - } - > - > ->; + openid?: undefined; + account?: undefined; + } + | { + mbox?: undefined; + mbox_sha1sum?: undefined; + openid: string; + account?: undefined; + } + | { + mbox?: undefined; + mbox_sha1sum?: undefined; + openid?: undefined; + account: Account; + }; /** * An Agent (an individual) is a persona or system. From 12f60a052d8d737f14b7627a881326f9d8e68b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 11:13:55 +0100 Subject: [PATCH 06/12] sss --- projects/ngx-xapi/model/src/lib/actor.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index f6c08d3..fc7b51e 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -1,4 +1,3 @@ -import { XOR } from 'ts-xor'; import { Account } from './account'; type ActorType = { From 799e46e2f44e4945e379686dc97f7393c40018f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 12:19:18 +0100 Subject: [PATCH 07/12] remove Verbs --- .../ngx-xapi/client/src/lib/statements.ts | 16 +++-- projects/ngx-xapi/client/src/lib/verbs.ts | 65 ------------------- projects/ngx-xapi/client/src/public-api.ts | 1 - 3 files changed, 10 insertions(+), 72 deletions(-) delete mode 100644 projects/ngx-xapi/client/src/lib/verbs.ts diff --git a/projects/ngx-xapi/client/src/lib/statements.ts b/projects/ngx-xapi/client/src/lib/statements.ts index d6d53af..f69cf21 100644 --- a/projects/ngx-xapi/client/src/lib/statements.ts +++ b/projects/ngx-xapi/client/src/lib/statements.ts @@ -1,11 +1,15 @@ import { v4 as uuidv4 } from 'uuid'; -import { Verbs } from './verbs'; import { Activity, Agent, Context, Statement, Verb, + completed, + initialized, + progressed, + registered, + terminated, } from '@berry-cloud/ngx-xapi/model'; export class Statements { @@ -27,7 +31,7 @@ export class Statements { return { id: uuidv4().toString(), // Registration might not be unique actor: agent, - verb: Verbs.registered, + verb: registered, object: activity, timestamp: timestamp?.toISOString() || new Date().toISOString(), context: { registration }, @@ -52,7 +56,7 @@ export class Statements { ): Statement { return this.statement( agent, - Verbs.initialized, + initialized, activity, context, registration, @@ -80,7 +84,7 @@ export class Statements { ): Statement { const statement = this.statement( agent, - Verbs.completed, + completed, activity, context, registration, @@ -112,7 +116,7 @@ export class Statements { ): Statement { const statement = this.statement( agent, - Verbs.terminated, + terminated, activity, context, registration, @@ -144,7 +148,7 @@ export class Statements { ): Statement { const statement = this.statement( agent, - Verbs.progressed, + progressed, activity, context, registration, diff --git a/projects/ngx-xapi/client/src/lib/verbs.ts b/projects/ngx-xapi/client/src/lib/verbs.ts deleted file mode 100644 index ae6f1fb..0000000 --- a/projects/ngx-xapi/client/src/lib/verbs.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Verb } from '@berry-cloud/ngx-xapi/model'; - -export class Verbs { - static readonly launched: Verb = { - id: 'http://adlnet.gov/expapi/verbs/launched', - display: { en: 'launched' }, - }; - - static readonly registered: Verb = { - id: 'http://adlnet.gov/expapi/verbs/registered', - display: { en: 'registered' }, - }; - - static readonly initialized: Verb = { - id: 'http://adlnet.gov/expapi/verbs/initialized', - display: { en: 'initialized' }, - }; - - static readonly terminated: Verb = { - id: 'http://adlnet.gov/expapi/verbs/terminated', - display: { - en: 'terminated', - }, - }; - - static readonly progressed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/progressed', - display: { - en: 'progressed', - }, - }; - - static readonly answered: Verb = { - id: 'http://adlnet.gov/expapi/verbs/answered', - display: { - en: 'answered', - }, - }; - - static readonly experienced: Verb = { - id: 'http://adlnet.gov/expapi/verbs/experienced', - display: { - en: 'experienced', - }, - }; - - static readonly completed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/completed', - display: { en: 'completed' }, - }; - - static readonly passed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/passed', - display: { - en: 'passed', - }, - }; - - static readonly failed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/failed', - display: { - en: 'failed', - }, - }; -} diff --git a/projects/ngx-xapi/client/src/public-api.ts b/projects/ngx-xapi/client/src/public-api.ts index 8ec51a0..f6ee1da 100644 --- a/projects/ngx-xapi/client/src/public-api.ts +++ b/projects/ngx-xapi/client/src/public-api.ts @@ -10,4 +10,3 @@ export * from './lib/lrs-client'; export * from './lib/state-params'; export * from './lib/statements-params'; export * from './lib/statements'; -export * from './lib/verbs'; From 525e1cb1ade5dfc23941bee84f7fc0f630ee1558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 15:53:15 +0100 Subject: [PATCH 08/12] Add javadoc to all classes and properties --- projects/ngx-xapi/model/src/lib/about.ts | 7 + projects/ngx-xapi/model/src/lib/account.ts | 16 +- projects/ngx-xapi/model/src/lib/activity.ts | 216 +++++++++++++++- projects/ngx-xapi/model/src/lib/actor.ts | 69 ++++- projects/ngx-xapi/model/src/lib/attachment.ts | 38 ++- projects/ngx-xapi/model/src/lib/extensions.ts | 13 + .../ngx-xapi/model/src/lib/language-map.ts | 7 + projects/ngx-xapi/model/src/lib/person.ts | 25 ++ projects/ngx-xapi/model/src/lib/result.ts | 32 +++ .../model/src/lib/statement-result.ts | 15 ++ projects/ngx-xapi/model/src/lib/statement.ts | 131 ++++++++++ projects/ngx-xapi/model/src/lib/verb.ts | 240 ++++++++++++++++++ 12 files changed, 793 insertions(+), 16 deletions(-) diff --git a/projects/ngx-xapi/model/src/lib/about.ts b/projects/ngx-xapi/model/src/lib/about.ts index 342a6fe..a541e5c 100644 --- a/projects/ngx-xapi/model/src/lib/about.ts +++ b/projects/ngx-xapi/model/src/lib/about.ts @@ -1,5 +1,12 @@ import { Extensions } from './extensions'; +/** + * This interface represents the xAPI About object. + * + * @see xAPI + * About + */ export interface About { version: string[]; extensions?: Extensions; diff --git a/projects/ngx-xapi/model/src/lib/account.ts b/projects/ngx-xapi/model/src/lib/account.ts index 29199ed..7e652aa 100644 --- a/projects/ngx-xapi/model/src/lib/account.ts +++ b/projects/ngx-xapi/model/src/lib/account.ts @@ -1,4 +1,18 @@ +/** + * This interface represents the xAPI Account object. + * + * @see xAPI + * Account + */ export interface Account { - homePage?: string; + /** + * The canonical home page for the system the account is on. + */ + homePage: string; + + /** + * The unique id or name used to log in to this account. + */ name?: string; } diff --git a/projects/ngx-xapi/model/src/lib/activity.ts b/projects/ngx-xapi/model/src/lib/activity.ts index 217c9ac..4fd87a8 100644 --- a/projects/ngx-xapi/model/src/lib/activity.ts +++ b/projects/ngx-xapi/model/src/lib/activity.ts @@ -1,60 +1,191 @@ import { Extensions } from './extensions'; import { LanguageMap } from './language-map'; +/** + * This interface represents the xAPI Activity Definition object. + *

+ * Upon receiving a Statement with an Activity Definition that differs from the one stored, an LRS + * SHOULD ... change the definition and SHOULD update the stored Activity Definition. + *

+ *

+ * When two ActivityDefinitions are merged, the properties and lists are replaced and the maps are + * merged. + *

+ * + * @see xAPI + * Activity Definition + * @see LRS + * Requirements + */ interface ActivityDefinition { + /** + * The human readable/visual name of the Activity. + */ name?: LanguageMap; + + /** + * A description of the Activity. + */ description?: LanguageMap; + + /** + * The type of Activity. + */ type?: string; // Should be IRI + + /** + * Resolves to a document with human-readable information about the Activity, which could include + * a way to launch the activity. + */ moreInfo?: string; // Should be IRI - extensions?: Extensions; + /** + * The type of interaction. + */ interactionType?: string; + + /** + * A pattern representing the correct response to the interaction. The structure of this pattern + * varies depending on the interactionType. + */ correctResponsesPattern?: string[]; + /** + * A list of the options available in the interaction for selection or ordering. + */ choices?: InteractionComponent[]; + + /** + * A list of the options on the likert scale. + */ scale?: InteractionComponent[]; + + /** + * Lists of sources to be matched. + */ source?: InteractionComponent[]; + + /** + * Lists of targets to be matched. + */ target?: InteractionComponent[]; + + /** + * A list of the elements making up the performance interaction. + */ steps?: InteractionComponent[]; + + /** + * A map of other properties as needed. + */ + extensions?: Extensions; } interface InteractionActivityDefinitionType extends ActivityDefinition { type: 'http://adlnet.gov/expapi/activities/cmi.interaction'; } +/** + * This interface represents the xAPI Interaction Component object. + * + * @see xAPI + * Interaction Components + */ export interface InteractionComponent { + /** + * Identifies the interaction component within the list. + */ id: string; + + /** + * A description of the interaction component. + */ description: LanguageMap; } +/** + * This interface represents the xAPI Activity Definition object for a True/False interaction. + *

+ * An interaction with two possible responses: true or false. + *

+ * + * @see + * Interaction Types + */ export interface TrueFalseInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'true-false'; correctResponsesPattern?: ['true'] | ['false']; } +/** + * This interface represents the xAPI Activity Definition object for a Multiple Choice interaction. + *

+ * An interaction with a number of possible choices from which the learner can select. + * This includes interactions in which the learner can select only one answer from the list and + * those where the learner can select multiple items. + *

+ * @see + * Interaction Types + */ export interface ChoiceInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'choice'; choices: InteractionComponent[]; } +/** + * This interface represents the xAPI Activity Definition object for a Fill-in interaction. + *

+ * An interaction which requires the learner to supply a short response in the form of one or + * more strings of characters. Typically, the correct response consists of part of a word, + * one word or a few words. "Short" means that the correct responses pattern and learner + * response strings will normally be 250 characters or less. + *

+ * + * @see + * Interaction Types + */ export interface FillInInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'fill-in'; } +/** + * This interface represents the xAPI Activity Definition object for a Long Fill-in interaction. + *

+ * An interaction which requires the learner to supply a response in the form of a long + * string of characters. "Long" means that the correct responses pattern and learner response + * strings will normally be more than 250 characters. + *

+ * + * @see + * Interaction Types + */ export interface LongFillInInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'long-fill-in'; } -export interface LikertInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'likert'; - scale: InteractionComponent[]; -} - +/** + * This interface represents the xAPI Activity Definition object for a Matching interaction. + *

+ * An interaction where the learner is asked to match items in one set (the source set) to + * items in another set (the target set). Items do not have to pair off exactly and it is + * possible for multiple or zero source items to be matched to a given target and vice versa. + *

+ * + * @see + * Interaction Types + */ export interface MatchingInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'matching'; @@ -62,30 +193,101 @@ export interface MatchingInteractionActivityDefinition target: InteractionComponent[]; } +/** + * This interface represents the xAPI Activity Definition object for a Performance interaction. + *

+ * An interaction that requires the learner to perform a task that requires multiple steps. + *

+ * + * @see + * Interaction Types + */ export interface PerformanceInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'performance'; steps: InteractionComponent[]; } +/** + * This interface represents the xAPI Activity Definition object for a Sequencing interaction. + *

+ * An interaction where the learner is asked to order items in a set. + *

+ * + * @see + * Interaction Types + */ export interface SequencingInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'sequencing'; choices: InteractionComponent[]; } +/** + * This interface represents the xAPI Activity Definition object for a Likert interaction. + *

+ * An interaction which asks the learner to select from a discrete set of choices on a scale/ + *

+ * + * @see + * Interaction Types + */ +export interface LikertInteractionActivityDefinition + extends InteractionActivityDefinitionType { + interactionType: 'likert'; + scale: InteractionComponent[]; +} + +/** + * This interface represents the xAPI Activity Definition object for a Numeric interaction. + *

+ * Any interaction which requires a numeric response from the learner. + *

+ * + * @see + * Interaction Types + */ export interface NumericInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'numeric'; } +/** + * This interface represents the xAPI Activity Definition object for a Other interaction. + *

+ * Another type of interaction that does not fit into other defined types. + *

+ * + * @see + * Interaction Types + */ export interface OtherInteractionActivityDefinition extends InteractionActivityDefinitionType { interactionType: 'other'; } +/** + * This class represents the xAPI Activity object. + * + * @see xAPI + * Activity + */ export interface Activity { objectType?: 'Activity'; + + /** + * An identifier for a single unique Activity. + */ id: string; // Should be IRI + + /** + * Metadata for the Activity. + */ definition?: ActivityDefinition; } diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index fc7b51e..fc6c153 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -2,11 +2,18 @@ import { Account } from './account'; type ActorType = { objectType?: string; + + /** + * Name of the Agent or Group. + */ name?: string; }; type IdentifiedActor = | { + /** + * An email address. The required format is "mailto:email address". + */ mbox: string; mbox_sha1sum?: undefined; openid?: undefined; @@ -14,6 +21,9 @@ type IdentifiedActor = } | { mbox?: undefined; + /** + * Hex-encoded SHA1 hash of a mailto IRI. + */ mbox_sha1sum: string; openid?: undefined; account?: undefined; @@ -21,6 +31,9 @@ type IdentifiedActor = | { mbox?: undefined; mbox_sha1sum?: undefined; + /** + * An openID. + */ openid: string; account?: undefined; } @@ -28,41 +41,83 @@ type IdentifiedActor = mbox?: undefined; mbox_sha1sum?: undefined; openid?: undefined; + /** + * An account on an existing system e.g. an LMS or intranet. + */ account: Account; }; /** - * An Agent (an individual) is a persona or system. + * This type represents the xAPI Agent object. + * + * @see xAPI Agent */ -export type Agent = ActorType & IdentifiedActor & { objectType?: 'Agent' }; +export type Agent = ActorType & + IdentifiedActor & { + /** + * This property is optional except when the Agent is used as a Statement's object. + */ + objectType?: 'Agent'; + }; /** + * Sub-type for the Anonymous Group. + *

* An Anonymous Group is used to describe a cluster of people where there is * no ready identifier for this cluster, e.g. an ad hoc team. + *

+ * + * @see + * Requirements for Anonymous Groups */ export type AnonymousGroup = ActorType & { + /** + * Mandatory property for Groups. + */ objectType: 'Group'; + /** + * The members of this Group. This is an unordered list. + */ member: Agent[]; }; /** + * Sub-type for the Identified Group. + *

* An Identified Group is used to uniquely identify a cluster of Agents. + *

+ * + * @see + * Requirements for Identified Groups */ export type IdentifiedGroup = ActorType & IdentifiedActor & { + /** + * Mandatory property for Groups. + */ objectType: 'Group'; + /** + * The members of this Group. This is an unordered list. + */ member?: Agent[]; }; /** - * A Group represents a collection of Agents and can be used in most of the - * same situations an Agent can be used. There are two types of Groups: - * Anonymous Groups and Identified Groups. + * This type represents the xAPI Group object. + *

+ * A Group is used to identify a set of Agents. A Group can be anonymous or identified. + *

+ * + * @see xAPI Group */ export type Group = AnonymousGroup | IdentifiedGroup; /** - * The Actor defines who performed the action. The Actor of a Statement can be - * an Agent or a Group. + * This class represents the xAPI Actor object. + *

+ * An Actor is used to identify the Agent or Group that performed the action. + *

+ * + * @see xAPI Actor */ export type Actor = Agent | Group; diff --git a/projects/ngx-xapi/model/src/lib/attachment.ts b/projects/ngx-xapi/model/src/lib/attachment.ts index adb2124..3fb4324 100644 --- a/projects/ngx-xapi/model/src/lib/attachment.ts +++ b/projects/ngx-xapi/model/src/lib/attachment.ts @@ -1,15 +1,51 @@ import { LanguageMap } from './language-map'; +/** + * This interface represents the xAPI Attachment object. + * + * @see xAPI + * Attachment + */ export interface Attachment { + /** + * Identifies the usage of this Attachment. + */ usageType: AttachmentUsageType | string; + + /** + * Display name of this Attachment. + */ display: LanguageMap; + + /** + * A description of the Attachment. + */ + description?: LanguageMap; + + /** + * The content type of the Attachment. + */ contentType: string; + + /** + * The length of the Attachment data in octets. + */ length: number; + + /** + * The SHA-2 hash of the Attachment data. + */ sha2: string; - description?: LanguageMap; + + /** + * An IRL at which the Attachment data can be retrieved, or from which it used to be retrievable. + */ fileUrl?: string; } +/** + * Predefined Attachment Usage Types. + */ export enum AttachmentUsageType { SIGNATURE = 'http://adlnet.gov/expapi/attachments/signature', } diff --git a/projects/ngx-xapi/model/src/lib/extensions.ts b/projects/ngx-xapi/model/src/lib/extensions.ts index 308eb43..9db2d24 100644 --- a/projects/ngx-xapi/model/src/lib/extensions.ts +++ b/projects/ngx-xapi/model/src/lib/extensions.ts @@ -1,3 +1,16 @@ +/** + * This interface represents the xAPI Extensions object. + *

+ * Extensions are available as part of Activity Definitions, as part of a Statement's "context" + * property, or as part of a Statement's "result" property. In each case, extensions are intended + * to provide a natural way to extend those properties for some specialized use. The contents of + * these extensions might be something valuable to just one application, or it might be a + * convention used by an entire Community of Practice. + *

+ * + * @see xAPI + * Extensions + */ export interface Extensions { [key: string]: any; } diff --git a/projects/ngx-xapi/model/src/lib/language-map.ts b/projects/ngx-xapi/model/src/lib/language-map.ts index aa8cba3..bfac79f 100644 --- a/projects/ngx-xapi/model/src/lib/language-map.ts +++ b/projects/ngx-xapi/model/src/lib/language-map.ts @@ -1,3 +1,10 @@ +/** + * A language map is a dictionary where the key is a RFC 5646 Language Tag, and the value is a + * string in the language specified in the tag. + * + * @see Language + * Maps + */ export interface LanguageMap { [key: string]: string; } diff --git a/projects/ngx-xapi/model/src/lib/person.ts b/projects/ngx-xapi/model/src/lib/person.ts index d51daf0..392dae8 100644 --- a/projects/ngx-xapi/model/src/lib/person.ts +++ b/projects/ngx-xapi/model/src/lib/person.ts @@ -1,11 +1,36 @@ import { Account } from './account'; +/** + * This interface represents the xAPI Person object. + * + * @see xAPI + * Person + */ export interface Person { objectType: 'Person'; + /** + * List of names. + */ name?: string[]; + /** + * List of e-mail addresses. + */ mbox?: string[]; + + /** + * List of the SHA1 hashes of mailto IRIs. + */ mbox_sha1sum?: string[]; + + /** + * List of openids that uniquely identify the Agents retrieved. + */ openid?: string[]; + + /** + * List of accounts. + */ account?: Account[]; } diff --git a/projects/ngx-xapi/model/src/lib/result.ts b/projects/ngx-xapi/model/src/lib/result.ts index 583cae6..c7e328b 100644 --- a/projects/ngx-xapi/model/src/lib/result.ts +++ b/projects/ngx-xapi/model/src/lib/result.ts @@ -1,5 +1,11 @@ import { Extensions } from './extensions'; +/** + * This interface represents the xAPI Score object. + * + * @see xAPI + * Score + */ export interface Score { /** * The score related to the experience as modified by scaling and/or @@ -24,11 +30,37 @@ export interface Score { max?: number; } +/** + * This interface represents the xAPI Result object. + * + * @see xAPI + * Result + */ export interface Result { + /** + * The score of the Agent in relation to the success or quality of the experience. + */ score?: Score; + + /** + * Indicates whether or not the attempt on the Activity was successful. + */ success?: boolean; + + /** + * Indicates whether or not the Activity was completed. + */ completion?: boolean; + + /** + * A response appropriately formatted for the given Activity. + */ response?: string; + + /** + * Period of time over which the Statement occurred. + */ duration?: string; // This should be a duration + extensions?: Extensions; } diff --git a/projects/ngx-xapi/model/src/lib/statement-result.ts b/projects/ngx-xapi/model/src/lib/statement-result.ts index 6b43338..f561dcd 100644 --- a/projects/ngx-xapi/model/src/lib/statement-result.ts +++ b/projects/ngx-xapi/model/src/lib/statement-result.ts @@ -1,6 +1,21 @@ import { Statement } from './statement'; +/** + * This interface represents the xAPI Statement Result object. + * + * @see xAPI + * Statement Result + */ export interface StatementResult { + /** + * List of Statements. Where no matching Statements are found, this property will contain an empty + * array. + */ statements: Statement[]; + + /** + * Relative IRL that can be used to fetch more results. + */ more: string | null; // IRL } diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index 98dea9f..0f83169 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -5,43 +5,174 @@ import { Extensions } from './extensions'; import { Result } from './result'; import { Verb } from './verb'; +/** + * This interface represents the xAPI Statement Reference object. + * + * @see xAPI + * Statement Reference + */ export interface StatementReference { + /** + * Mandatory. The type of the Statement Reference. Must be set to "StatementRef". + */ objectType: 'StatementRef'; + + /** + * The UUID of a Statement. + */ id: string; // UUID } +/** + * This interface represents the xAPI Context Activities object. + * + * @see xAPI + * Context Activities + */ export interface ContextActivities { + /** + * Activity with a direct relation to the Activity which is the Object of the Statement. + */ parent?: Activity[]; + + /** + * Activities with an indirect relation to the Activity which is the Object of the Statement. + */ grouping?: Activity[]; + + /** + * Activities used to categorize the Statement. + */ category?: Activity[]; + + /** + * Activities that do not fit one of the other properties. + */ other?: Activity[]; } +/** + * This interface represents the xAPI Context object. + * + * @see xAPI + * Context + */ export interface Context { + /** + * The registration that the Statement is associated with. + */ registration?: string; // UUID + + /** + * Instructor that the Statement relates to, if not included as the Actor of the Statement. + */ instructor?: Actor; + + /** + * Team that this Statement relates to, if not included as the Actor of the Statement. + */ team?: Group; + + /** + * A map of the types of learning activity context that this Statement is related to. + */ contextActivities?: ContextActivities; + + /** + * Revision of the learning activity associated with this Statement. Format is free. + */ revision?: string; + + /** + * Platform used in the experience of this learning activity. + */ platform?: string; + + /** + * The language in which the experience being recorded in this Statement (mainly) occurred in. + */ language?: string; + + /** + * Another Statement to be considered as context for this Statement. + */ statement?: StatementReference; + extensions?: Extensions; } +/** + * This interface represents the xAPI Statement object. + * + * @see xAPI + * Statement + */ export interface Statement { + /** + * UUID assigned by LRS if not set by the Learning Record Provider. + */ id?: string; // UUID + + /** + * Whom the Statement is about, as an Agent or Group Object. + */ actor: Actor; + + /** + * Action taken by the Actor. + */ verb: Verb; + + /** + * Activity, Actor, or another Statement that is the Object of the Statement. + */ object: Activity | StatementReference | Actor | SubStatement; + + /** + * Result Object, further details representing a measured outcome. + */ result?: Result; + + /** + * Context that gives the Statement more meaning. + */ context?: Context; + + /** + * Timestamp of when the events described within this Statement occurred. + */ timestamp?: string; // Timestamp + + /** + * Timestamp of when this Statement was recorded. + */ stored?: string; // Timestamp + + /** + * Agent or Group who is asserting this Statement is true. + */ authority?: Actor; + + /** + * The Statement’s associated xAPI version. + */ + version?: string; + + /** + * Headers for Attachments to the Statement. + */ attachments?: Attachment[]; } +/** + * This interface represents the xAPI SubStatement object. + * + * @see xAPI + * SubStatement + */ export interface SubStatement extends Statement { objectType: 'SubStatement'; object: Activity | StatementReference | Actor; diff --git a/projects/ngx-xapi/model/src/lib/verb.ts b/projects/ngx-xapi/model/src/lib/verb.ts index d9c8069..1265eab 100644 --- a/projects/ngx-xapi/model/src/lib/verb.ts +++ b/projects/ngx-xapi/model/src/lib/verb.ts @@ -1,156 +1,396 @@ import { LanguageMap } from './language-map'; +/** + * The Verb defines the action between an Actor and an Activity. + * + * @see xAPI + * Verb + */ export interface Verb { + /** + * Corresponds to a Verb definition. Each Verb definition corresponds to the meaning of a Verb, + * not the word. + */ id: string; // Should be IRI + /** + * The human readable representation of the Verb in one or more languages. This does not have any + * impact on the meaning of the Statement, but serves to give a human-readable display of the + * meaning already determined by the chosen Verb. + */ display?: LanguageMap; } +/** + * Indicates the actor replied to a question, where the object is generally an activity + * representing the question. The text of the answer will often be included in the response inside + * result. + * + * @see ADL + * Vocabulary + */ export const answered: Verb = { id: 'http://adlnet.gov/expapi/verbs/answered', display: { en: 'answered' }, }; +/** + * Indicates an inquiry by an actor with the expectation of a response or answer to a question. + * + * @see ADL + * Vocabulary + */ export const asked: Verb = { id: 'http://adlnet.gov/expapi/verbs/asked', display: { en: 'asked' }, }; +/** + * Indicates the actor made an effort to access the object. An attempt statement without + * additional activities could be considered incomplete in some cases. + * + * @see ADL + * Vocabulary + */ export const attempted: Verb = { id: 'http://adlnet.gov/expapi/verbs/attempted', display: { en: 'attempted' }, }; +/** + * Indicates the actor was present at a virtual or physical event or activity. + * + * @see ADL + * Vocabulary + */ export const attended: Verb = { id: 'http://adlnet.gov/expapi/verbs/attended', display: { en: 'attended' }, }; +/** + * Indicates the actor provided digital or written annotations on or about an object. + * + * @see ADL + * Vocabulary + */ export const commented: Verb = { id: 'http://adlnet.gov/expapi/verbs/commented', display: { en: 'commented' }, }; +/** + * Indicates the actor finished or concluded the activity normally. + * + * @see SCORM + * Profile + */ export const completed: Verb = { id: 'http://adlnet.gov/expapi/verbs/completed', display: { en: 'completed' }, }; +/** + * Indicates the actor intentionally departed from the activity or object. + * + * @see ADL + * Vocabulary + */ export const exited: Verb = { id: 'http://adlnet.gov/expapi/verbs/exited', display: { en: 'exited' }, }; +/** + * Indicates the actor only encountered the object, and is applicable in situations where a + * specific achievement or completion is not required. + * + * @see ADL + * Vocabulary + */ export const experienced: Verb = { id: 'http://adlnet.gov/expapi/verbs/experienced', display: { en: 'experienced' }, }; +/** + * Indicates the actor did not successfully pass an activity to a level of predetermined + * satisfaction. + * + * @see SCORM + * Profile + */ +publ; export const failed: Verb = { id: 'http://adlnet.gov/expapi/verbs/failed', display: { en: 'failed' }, }; +/** + * Indicates the actor introduced an object into a physical or virtual location. + * + * @see ADL + * Vocabulary + */ export const imported: Verb = { id: 'http://adlnet.gov/expapi/verbs/imported', display: { en: 'imported' }, }; +/** + * Indicates the activity provider has determined that the actor successfully started an activity. + * + * @see SCORM + * Profile + */ export const initialized: Verb = { id: 'http://adlnet.gov/expapi/verbs/initialized', display: { en: 'initialized' }, }; +/** + * Indicates the actor engaged with a physical or virtual object. + * + * @see ADL + * Vocabulary + */ export const interacted: Verb = { id: 'http://adlnet.gov/expapi/verbs/interacted', display: { en: 'interacted' }, }; +/** + * Indicates the actor attempted to start an activity. + * + * @see ADL + * Vocabulary + */ export const launched: Verb = { id: 'http://adlnet.gov/expapi/verbs/launched', display: { en: 'launched' }, }; +/** + * Indicates the highest level of comprehension or competence the actor performed in an activity. + * + * @see ADL + * Vocabulary + */ export const mastered: Verb = { id: 'http://adlnet.gov/expapi/verbs/mastered', display: { en: 'mastered' }, }; +/** + * Indicates the actor successfully passed an activity to a level of predetermined satisfaction. + * + * @see SCORM + * Profile + */ export const passed: Verb = { id: 'http://adlnet.gov/expapi/verbs/passed', display: { en: 'passed' }, }; +/** + * Indicates the selected choices, favoured options or settings of an actor in relation to an + * object or activity. + * + * @see ADL + * Vocabulary + */ export const preferred: Verb = { id: 'http://adlnet.gov/expapi/verbs/preferred', display: { en: 'preferred' }, }; +/** + * Indicates a value of how much of an actor has advanced or moved through an activity. + * + * @see ADL + * Vocabulary + */ export const progressed: Verb = { id: 'http://adlnet.gov/expapi/verbs/progressed', display: { en: 'progressed' }, }; +/** + * Indicates the actor is officially enrolled or inducted in an activity. + * + * @see ADL + * Vocabulary + */ export const registered: Verb = { id: 'http://adlnet.gov/expapi/verbs/registered', display: { en: 'registered' }, }; +/** + * Indicates an actor reacted or replied to an object. + * + * @see SCORM + * Profile + */ export const responded: Verb = { id: 'http://adlnet.gov/expapi/verbs/responded', display: { en: 'responded' }, }; +/** + * Indicates the application has determined that the actor continued or reopened a suspended + * attempt on an activity. + * + * @see SCORM + * Profile + */ export const resumed: Verb = { id: 'http://adlnet.gov/expapi/verbs/resumed', display: { en: 'resumed' }, }; +/** + * Indicates a numerical value related to an actor's performance on an activity. + * + * @see SCORM + * Profile + */ export const scored: Verb = { id: 'http://adlnet.gov/expapi/verbs/scored', display: { en: 'scored' }, }; +/** + * Indicates the actor's intent to openly provide access to an object of common interest to other + * actors or groups. + * + * @see ADL + * Vocabulary + */ export const shared: Verb = { id: 'http://adlnet.gov/expapi/verbs/shared', display: { en: 'shared' }, }; +/** + * Indicates the status of a temporarily halted activity when an actor's intent is returning to + * the or object activity at a later time. + * + * @see SCORM + * Profile + */ export const suspended: Verb = { id: 'http://adlnet.gov/expapi/verbs/suspended', display: { en: 'suspended' }, }; +/** + * Indicates that the actor successfully ended an activity. + * + * @see SCORM + * Profile + */ export const terminated: Verb = { id: 'http://adlnet.gov/expapi/verbs/terminated', display: { en: 'terminated' }, }; +/** + * A special reserved verb used by a LRS or application to mark a statement as invalid. See the + * xAPI specification for details on Voided statements. + * + * @see ADL + * Vocabulary + */ export const voided: Verb = { id: 'http://adlnet.gov/expapi/verbs/voided', display: { en: 'voided' }, }; +/** + * Indicates that the AU session was abnormally terminated by a learner's action (or due to a + * system failure). + * + * @see cmi5 + * Profile + */ export const abandoned: Verb = { id: 'https://w3id.org/xapi/adl/verbs/abandoned', display: { en: 'abandoned' }, }; +/** + * Indicates the actor gained access to a system or service by identifying and authenticating with + * the credentials provided by the actor. + * + * @see ADL + * Vocabulary + */ export const loggedIn: Verb = { id: 'https://w3id.org/xapi/adl/verbs/logged-in', display: { en: 'logged in' }, }; +/** + * Indicates the actor either lost or discontinued access to a system or service. + * + * @see ADL + * Vocabulary + */ export const loggedOut: Verb = { id: 'https://w3id.org/xapi/adl/verbs/logged-out', display: { en: 'logged out' }, }; +/** + * Indicates that the authority or activity provider determined the actor has fulfilled the + * criteria of the object or activity. + * + * @see cmi5 + * Profile + */ export const satisfied: Verb = { id: 'https://w3id.org/xapi/adl/verbs/satisfied', display: { en: 'satisfied' }, }; +/** + * Indicates that the learning activity requirements were met by means other than completing the + * activity. A waived statement is used to indicate that the activity may be skipped by the actor. + * + * @see cmi5 + * Profile + */ export const waived: Verb = { id: 'https://w3id.org/xapi/adl/verbs/waived', display: { en: 'waived' }, From 36e90bd339e5499e8be675b3e354a3cd087b649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 16:10:40 +0100 Subject: [PATCH 09/12] sss --- projects/ngx-xapi/model/src/lib/about.ts | 3 - projects/ngx-xapi/model/src/lib/account.ts | 5 - projects/ngx-xapi/model/src/lib/activity.ts | 88 ----------- projects/ngx-xapi/model/src/lib/actor.ts | 65 -------- projects/ngx-xapi/model/src/lib/attachment.ts | 13 -- projects/ngx-xapi/model/src/lib/person.ts | 10 -- projects/ngx-xapi/model/src/lib/result.ts | 27 ---- projects/ngx-xapi/model/src/lib/statement.ts | 38 ----- projects/ngx-xapi/model/src/lib/verb.ts | 149 ------------------ 9 files changed, 398 deletions(-) diff --git a/projects/ngx-xapi/model/src/lib/about.ts b/projects/ngx-xapi/model/src/lib/about.ts index 21b7b23..a541e5c 100644 --- a/projects/ngx-xapi/model/src/lib/about.ts +++ b/projects/ngx-xapi/model/src/lib/about.ts @@ -1,6 +1,5 @@ import { Extensions } from './extensions'; -<<<<<<< HEAD /** * This interface represents the xAPI About object. * @@ -8,8 +7,6 @@ import { Extensions } from './extensions'; * "https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#24-agents-resource">xAPI * About */ -======= ->>>>>>> refs/remotes/origin/main export interface About { version: string[]; extensions?: Extensions; diff --git a/projects/ngx-xapi/model/src/lib/account.ts b/projects/ngx-xapi/model/src/lib/account.ts index f3f919f..7e652aa 100644 --- a/projects/ngx-xapi/model/src/lib/account.ts +++ b/projects/ngx-xapi/model/src/lib/account.ts @@ -1,4 +1,3 @@ -<<<<<<< HEAD /** * This interface represents the xAPI Account object. * @@ -15,9 +14,5 @@ export interface Account { /** * The unique id or name used to log in to this account. */ -======= -export interface Account { - homePage?: string; ->>>>>>> refs/remotes/origin/main name?: string; } diff --git a/projects/ngx-xapi/model/src/lib/activity.ts b/projects/ngx-xapi/model/src/lib/activity.ts index ccdfb4b..4fd87a8 100644 --- a/projects/ngx-xapi/model/src/lib/activity.ts +++ b/projects/ngx-xapi/model/src/lib/activity.ts @@ -1,7 +1,6 @@ import { Extensions } from './extensions'; import { LanguageMap } from './language-map'; -<<<<<<< HEAD /** * This interface represents the xAPI Activity Definition object. *

@@ -285,93 +284,6 @@ export interface Activity { /** * An identifier for a single unique Activity. */ -======= -interface ActivityDefinition { - name?: LanguageMap; - description?: LanguageMap; - type?: string; // Should be IRI - moreInfo?: string; // Should be IRI - extensions?: Extensions; - - interactionType?: string; - correctResponsesPattern?: string[]; - - choices?: InteractionComponent[]; - scale?: InteractionComponent[]; - source?: InteractionComponent[]; - target?: InteractionComponent[]; - steps?: InteractionComponent[]; -} - -interface InteractionActivityDefinitionType extends ActivityDefinition { - type: 'http://adlnet.gov/expapi/activities/cmi.interaction'; -} - -export interface InteractionComponent { - id: string; - description: LanguageMap; -} - -export interface TrueFalseInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'true-false'; - correctResponsesPattern?: ['true'] | ['false']; -} - -export interface ChoiceInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'choice'; - choices: InteractionComponent[]; -} - -export interface FillInInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'fill-in'; -} - -export interface LongFillInInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'long-fill-in'; -} - -export interface LikertInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'likert'; - scale: InteractionComponent[]; -} - -export interface MatchingInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'matching'; - source: InteractionComponent[]; - target: InteractionComponent[]; -} - -export interface PerformanceInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'performance'; - steps: InteractionComponent[]; -} - -export interface SequencingInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'sequencing'; - choices: InteractionComponent[]; -} - -export interface NumericInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'numeric'; -} - -export interface OtherInteractionActivityDefinition - extends InteractionActivityDefinitionType { - interactionType: 'other'; -} - -export interface Activity { - objectType?: 'Activity'; ->>>>>>> refs/remotes/origin/main id: string; // Should be IRI /** diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index e12a925..fc6c153 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -2,7 +2,6 @@ import { Account } from './account'; type ActorType = { objectType?: string; -<<<<<<< HEAD /** * Name of the Agent or Group. @@ -120,69 +119,5 @@ export type Group = AnonymousGroup | IdentifiedGroup; *

* * @see xAPI Actor -======= - name?: string; -}; - -type IdentifiedActor = - | { - mbox: string; - mbox_sha1sum?: undefined; - openid?: undefined; - account?: undefined; - } - | { - mbox?: undefined; - mbox_sha1sum: string; - openid?: undefined; - account?: undefined; - } - | { - mbox?: undefined; - mbox_sha1sum?: undefined; - openid: string; - account?: undefined; - } - | { - mbox?: undefined; - mbox_sha1sum?: undefined; - openid?: undefined; - account: Account; - }; - -/** - * An Agent (an individual) is a persona or system. - */ -export type Agent = ActorType & IdentifiedActor & { objectType?: 'Agent' }; - -/** - * An Anonymous Group is used to describe a cluster of people where there is - * no ready identifier for this cluster, e.g. an ad hoc team. - */ -export type AnonymousGroup = ActorType & { - objectType: 'Group'; - member: Agent[]; -}; - -/** - * An Identified Group is used to uniquely identify a cluster of Agents. - */ -export type IdentifiedGroup = ActorType & - IdentifiedActor & { - objectType: 'Group'; - member?: Agent[]; - }; - -/** - * A Group represents a collection of Agents and can be used in most of the - * same situations an Agent can be used. There are two types of Groups: - * Anonymous Groups and Identified Groups. - */ -export type Group = AnonymousGroup | IdentifiedGroup; - -/** - * The Actor defines who performed the action. The Actor of a Statement can be - * an Agent or a Group. ->>>>>>> refs/remotes/origin/main */ export type Actor = Agent | Group; diff --git a/projects/ngx-xapi/model/src/lib/attachment.ts b/projects/ngx-xapi/model/src/lib/attachment.ts index 051b083..3fb4324 100644 --- a/projects/ngx-xapi/model/src/lib/attachment.ts +++ b/projects/ngx-xapi/model/src/lib/attachment.ts @@ -1,6 +1,5 @@ import { LanguageMap } from './language-map'; -<<<<<<< HEAD /** * This interface represents the xAPI Attachment object. * @@ -47,18 +46,6 @@ export interface Attachment { /** * Predefined Attachment Usage Types. */ -======= -export interface Attachment { - usageType: AttachmentUsageType | string; - display: LanguageMap; - contentType: string; - length: number; - sha2: string; - description?: LanguageMap; - fileUrl?: string; -} - ->>>>>>> refs/remotes/origin/main export enum AttachmentUsageType { SIGNATURE = 'http://adlnet.gov/expapi/attachments/signature', } diff --git a/projects/ngx-xapi/model/src/lib/person.ts b/projects/ngx-xapi/model/src/lib/person.ts index 069e782..392dae8 100644 --- a/projects/ngx-xapi/model/src/lib/person.ts +++ b/projects/ngx-xapi/model/src/lib/person.ts @@ -1,6 +1,5 @@ import { Account } from './account'; -<<<<<<< HEAD /** * This interface represents the xAPI Person object. * @@ -33,14 +32,5 @@ export interface Person { /** * List of accounts. */ -======= -export interface Person { - objectType: 'Person'; - name?: string[]; - - mbox?: string[]; - mbox_sha1sum?: string[]; - openid?: string[]; ->>>>>>> refs/remotes/origin/main account?: Account[]; } diff --git a/projects/ngx-xapi/model/src/lib/result.ts b/projects/ngx-xapi/model/src/lib/result.ts index d8b3dcb..c7e328b 100644 --- a/projects/ngx-xapi/model/src/lib/result.ts +++ b/projects/ngx-xapi/model/src/lib/result.ts @@ -1,31 +1,4 @@ import { Extensions } from './extensions'; -<<<<<<< HEAD -======= - -export interface Score { - /** - * The score related to the experience as modified by scaling and/or - * normalization. - */ - scaled?: number; - - /** - * The score achieved by the Actor in the experience described by the - * Statement. This is not modified by any scaling or normalization. - */ - raw?: number; - - /** - * The lowest possible score for the experience described by the Statement. - */ - min?: number; - - /** - * The highest possible score for the experience described by the Statement. - */ - max?: number; -} ->>>>>>> refs/remotes/origin/main /** * This interface represents the xAPI Score object. diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index 8c33eb6..0f83169 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -5,7 +5,6 @@ import { Extensions } from './extensions'; import { Result } from './result'; import { Verb } from './verb'; -<<<<<<< HEAD /** * This interface represents the xAPI Statement Reference object. * @@ -111,32 +110,6 @@ export interface Context { * "https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#statement-properties">xAPI * Statement */ -======= -export interface StatementReference { - objectType: 'StatementRef'; - id: string; // UUID -} - -export interface ContextActivities { - parent?: Activity[]; - grouping?: Activity[]; - category?: Activity[]; - other?: Activity[]; -} - -export interface Context { - registration?: string; // UUID - instructor?: Actor; - team?: Group; - contextActivities?: ContextActivities; - revision?: string; - platform?: string; - language?: string; - statement?: StatementReference; - extensions?: Extensions; -} - ->>>>>>> refs/remotes/origin/main export interface Statement { /** * UUID assigned by LRS if not set by the Learning Record Provider. @@ -152,7 +125,6 @@ export interface Statement { * Action taken by the Actor. */ verb: Verb; -<<<<<<< HEAD /** * Activity, Actor, or another Statement that is the Object of the Statement. @@ -162,9 +134,6 @@ export interface Statement { /** * Result Object, further details representing a measured outcome. */ -======= - object: Activity | StatementReference | Actor | SubStatement; ->>>>>>> refs/remotes/origin/main result?: Result; /** @@ -176,12 +145,7 @@ export interface Statement { * Timestamp of when the events described within this Statement occurred. */ timestamp?: string; // Timestamp - stored?: string; // Timestamp - authority?: Actor; - attachments?: Attachment[]; -} -<<<<<<< HEAD /** * Timestamp of when this Statement was recorded. */ @@ -209,8 +173,6 @@ export interface Statement { * @see xAPI * SubStatement */ -======= ->>>>>>> refs/remotes/origin/main export interface SubStatement extends Statement { objectType: 'SubStatement'; object: Activity | StatementReference | Actor; diff --git a/projects/ngx-xapi/model/src/lib/verb.ts b/projects/ngx-xapi/model/src/lib/verb.ts index b1dd315..4019234 100644 --- a/projects/ngx-xapi/model/src/lib/verb.ts +++ b/projects/ngx-xapi/model/src/lib/verb.ts @@ -21,7 +21,6 @@ export interface Verb { display?: LanguageMap; } -<<<<<<< HEAD /** * Indicates the actor replied to a question, where the object is generally an activity * representing the question. The text of the answer will often be included in the response inside @@ -130,7 +129,6 @@ export const experienced: Verb = { * "https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15">SCORM * Profile */ -publ; export const failed: Verb = { id: 'http://adlnet.gov/expapi/verbs/failed', display: { en: 'failed' }, @@ -392,153 +390,6 @@ export const satisfied: Verb = { * "https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/582cbd06-8920-4748-917f-5c1af8244a82">cmi5 * Profile */ -======= -export const answered: Verb = { - id: 'http://adlnet.gov/expapi/verbs/answered', - display: { en: 'answered' }, -}; - -export const asked: Verb = { - id: 'http://adlnet.gov/expapi/verbs/asked', - display: { en: 'asked' }, -}; - -export const attempted: Verb = { - id: 'http://adlnet.gov/expapi/verbs/attempted', - display: { en: 'attempted' }, -}; - -export const attended: Verb = { - id: 'http://adlnet.gov/expapi/verbs/attended', - display: { en: 'attended' }, -}; - -export const commented: Verb = { - id: 'http://adlnet.gov/expapi/verbs/commented', - display: { en: 'commented' }, -}; - -export const completed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/completed', - display: { en: 'completed' }, -}; - -export const exited: Verb = { - id: 'http://adlnet.gov/expapi/verbs/exited', - display: { en: 'exited' }, -}; - -export const experienced: Verb = { - id: 'http://adlnet.gov/expapi/verbs/experienced', - display: { en: 'experienced' }, -}; - -export const failed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/failed', - display: { en: 'failed' }, -}; - -export const imported: Verb = { - id: 'http://adlnet.gov/expapi/verbs/imported', - display: { en: 'imported' }, -}; - -export const initialized: Verb = { - id: 'http://adlnet.gov/expapi/verbs/initialized', - display: { en: 'initialized' }, -}; - -export const interacted: Verb = { - id: 'http://adlnet.gov/expapi/verbs/interacted', - display: { en: 'interacted' }, -}; - -export const launched: Verb = { - id: 'http://adlnet.gov/expapi/verbs/launched', - display: { en: 'launched' }, -}; - -export const mastered: Verb = { - id: 'http://adlnet.gov/expapi/verbs/mastered', - display: { en: 'mastered' }, -}; - -export const passed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/passed', - display: { en: 'passed' }, -}; - -export const preferred: Verb = { - id: 'http://adlnet.gov/expapi/verbs/preferred', - display: { en: 'preferred' }, -}; - -export const progressed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/progressed', - display: { en: 'progressed' }, -}; - -export const registered: Verb = { - id: 'http://adlnet.gov/expapi/verbs/registered', - display: { en: 'registered' }, -}; - -export const responded: Verb = { - id: 'http://adlnet.gov/expapi/verbs/responded', - display: { en: 'responded' }, -}; - -export const resumed: Verb = { - id: 'http://adlnet.gov/expapi/verbs/resumed', - display: { en: 'resumed' }, -}; - -export const scored: Verb = { - id: 'http://adlnet.gov/expapi/verbs/scored', - display: { en: 'scored' }, -}; - -export const shared: Verb = { - id: 'http://adlnet.gov/expapi/verbs/shared', - display: { en: 'shared' }, -}; - -export const suspended: Verb = { - id: 'http://adlnet.gov/expapi/verbs/suspended', - display: { en: 'suspended' }, -}; - -export const terminated: Verb = { - id: 'http://adlnet.gov/expapi/verbs/terminated', - display: { en: 'terminated' }, -}; - -export const voided: Verb = { - id: 'http://adlnet.gov/expapi/verbs/voided', - display: { en: 'voided' }, -}; - -export const abandoned: Verb = { - id: 'https://w3id.org/xapi/adl/verbs/abandoned', - display: { en: 'abandoned' }, -}; - -export const loggedIn: Verb = { - id: 'https://w3id.org/xapi/adl/verbs/logged-in', - display: { en: 'logged in' }, -}; - -export const loggedOut: Verb = { - id: 'https://w3id.org/xapi/adl/verbs/logged-out', - display: { en: 'logged out' }, -}; - -export const satisfied: Verb = { - id: 'https://w3id.org/xapi/adl/verbs/satisfied', - display: { en: 'satisfied' }, -}; - ->>>>>>> refs/remotes/origin/main export const waived: Verb = { id: 'https://w3id.org/xapi/adl/verbs/waived', display: { en: 'waived' }, From b0203765a5be9f9b01625317ecc3980f36b9281a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 16:16:54 +0100 Subject: [PATCH 10/12] sss --- projects/ngx-xapi/model/src/lib/account.ts | 2 +- projects/ngx-xapi/model/src/lib/statement.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/ngx-xapi/model/src/lib/account.ts b/projects/ngx-xapi/model/src/lib/account.ts index 7e652aa..d89725d 100644 --- a/projects/ngx-xapi/model/src/lib/account.ts +++ b/projects/ngx-xapi/model/src/lib/account.ts @@ -14,5 +14,5 @@ export interface Account { /** * The unique id or name used to log in to this account. */ - name?: string; + name: string; } diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index 0f83169..b660f22 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -146,6 +146,8 @@ export interface Statement { */ timestamp?: string; // Timestamp +} + /** * Timestamp of when this Statement was recorded. */ From 28a45bdd644c9eefc86c33809cb63b3d5ea116ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Tue, 11 Jul 2023 20:15:12 +0100 Subject: [PATCH 11/12] fix --- projects/ngx-xapi/model/src/lib/statement.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index b660f22..0f83169 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -146,8 +146,6 @@ export interface Statement { */ timestamp?: string; // Timestamp -} - /** * Timestamp of when this Statement was recorded. */ From 1dbf5e11780e53b82b25e0b2942aeef6f1b3d12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Wed, 12 Jul 2023 08:55:19 +0100 Subject: [PATCH 12/12] refactor javadoc formatting --- .../lib/language-map/format-language-map.ts | 13 ++ .../src/lib/language-map/language-map.pipe.ts | 41 ++++-- projects/ngx-xapi/model/src/lib/about.ts | 4 +- projects/ngx-xapi/model/src/lib/account.ts | 4 +- projects/ngx-xapi/model/src/lib/activity.ts | 106 ++++++--------- projects/ngx-xapi/model/src/lib/actor.ts | 29 ++--- projects/ngx-xapi/model/src/lib/attachment.ts | 3 +- projects/ngx-xapi/model/src/lib/extensions.ts | 7 +- .../ngx-xapi/model/src/lib/language-map.ts | 3 +- projects/ngx-xapi/model/src/lib/person.ts | 4 +- projects/ngx-xapi/model/src/lib/result.ts | 6 +- .../model/src/lib/statement-result.ts | 4 +- projects/ngx-xapi/model/src/lib/statement.ts | 18 +-- projects/ngx-xapi/model/src/lib/verb.ts | 123 +++++------------- 14 files changed, 146 insertions(+), 219 deletions(-) diff --git a/projects/ngx-xapi/client/src/lib/language-map/format-language-map.ts b/projects/ngx-xapi/client/src/lib/language-map/format-language-map.ts index f1c1831..34ed4fe 100644 --- a/projects/ngx-xapi/client/src/lib/language-map/format-language-map.ts +++ b/projects/ngx-xapi/client/src/lib/language-map/format-language-map.ts @@ -1,5 +1,18 @@ import { LanguageMap } from '@berry-cloud/ngx-xapi/model'; +/** + * Calculates the most appropriate language map value for the given locale. + * + * The algorithm is as follows: + * 1. If the locale is found in the language map, return the value. + * 2. If the locale has a subtag, remove the subtag and try again. + * 3. If the UND locale is found in the language map, return the value. + * 4. Return the first value in the language map or an empty string. + * + * @param languageMap a language map + * @param locale the preferred locale + * @returns the most appropriate language map value + */ export function formatLanguageMap( languageMap: LanguageMap, locale: string diff --git a/projects/ngx-xapi/client/src/lib/language-map/language-map.pipe.ts b/projects/ngx-xapi/client/src/lib/language-map/language-map.pipe.ts index ca6df16..0934820 100644 --- a/projects/ngx-xapi/client/src/lib/language-map/language-map.pipe.ts +++ b/projects/ngx-xapi/client/src/lib/language-map/language-map.pipe.ts @@ -2,6 +2,31 @@ import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core'; import { LanguageMap } from '@berry-cloud/ngx-xapi/model'; import { formatLanguageMap } from './format-language-map'; +/** + * This pipe transforms the parameter (potentially a language map) into a string. + * + * @remarks + * If the parameter is a string, it is returned as is. + * + * If the parameter is a language map, the most appropriate value is returned. + * + * If the parameter is an array of language maps, the most appropriate value of each language map is concatenated. + * + * If the parameter is an array of strings, the strings are concatenated. + * + * If the parameter is an array of language maps and strings, the most appropriate value of each language map and the strings are concatenated. + * + * @param parameter a string or a language map or an array of language maps or an array of strings + * @param htmlConversion if true, the spaces and new lines in the returned string are converted to HTML tags + * + * @returns a string + * + * @example + *

{{ 'Hello World' | languageMap }}

+ *

{{ { en: 'Hello World' } | languageMap }}

+ *

{{ { en: 'Hello World', fr: 'Bonjour le monde' } | languageMap:false }}

+ * + */ @Pipe({ name: 'languageMap', }) @@ -9,25 +34,25 @@ export class LanguageMapPipe implements PipeTransform { constructor(@Inject(LOCALE_ID) private locale: string) {} transform( - languageMap: string | LanguageMap | (string | LanguageMap)[] | undefined, + parameter: string | LanguageMap | (string | LanguageMap)[] | undefined, htmlConversion = true ): string | null { - if (typeof languageMap == 'string') { - return languageMap; + if (typeof parameter == 'string') { + return parameter; } - if (!languageMap || Object.keys(languageMap).length === 0) { + if (!parameter || Object.keys(parameter).length === 0) { return null; } let text = ''; - if (Array.isArray(languageMap)) { - if (languageMap.length == 0) { + if (Array.isArray(parameter)) { + if (parameter.length == 0) { return null; } - for (const lm of languageMap) { + for (const lm of parameter) { text += this.transform(lm); } } else { - text = formatLanguageMap(languageMap, this.locale); + text = formatLanguageMap(parameter, this.locale); } if (htmlConversion) { diff --git a/projects/ngx-xapi/model/src/lib/about.ts b/projects/ngx-xapi/model/src/lib/about.ts index a541e5c..9a64223 100644 --- a/projects/ngx-xapi/model/src/lib/about.ts +++ b/projects/ngx-xapi/model/src/lib/about.ts @@ -3,9 +3,7 @@ import { Extensions } from './extensions'; /** * This interface represents the xAPI About object. * - * @see xAPI - * About + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#24-agents-resource | xAPI About} */ export interface About { version: string[]; diff --git a/projects/ngx-xapi/model/src/lib/account.ts b/projects/ngx-xapi/model/src/lib/account.ts index d89725d..ffdc7e5 100644 --- a/projects/ngx-xapi/model/src/lib/account.ts +++ b/projects/ngx-xapi/model/src/lib/account.ts @@ -1,9 +1,7 @@ /** * This interface represents the xAPI Account object. * - * @see xAPI - * Account + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#2424-account-object | xAPI Account } */ export interface Account { /** diff --git a/projects/ngx-xapi/model/src/lib/activity.ts b/projects/ngx-xapi/model/src/lib/activity.ts index 4fd87a8..ec4a620 100644 --- a/projects/ngx-xapi/model/src/lib/activity.ts +++ b/projects/ngx-xapi/model/src/lib/activity.ts @@ -3,23 +3,18 @@ import { LanguageMap } from './language-map'; /** * This interface represents the xAPI Activity Definition object. - *

+ * + * @remarks * Upon receiving a Statement with an Activity Definition that differs from the one stored, an LRS * SHOULD ... change the definition and SHOULD update the stored Activity Definition. - *

- *

+ * * When two ActivityDefinitions are merged, the properties and lists are replaced and the maps are * merged. - *

* - * @see xAPI - * Activity Definition - * @see LRS - * Requirements + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#activity-definition | xAPI Activity Definition} + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#lrs-requirements-1 | LRS Requirements} */ -interface ActivityDefinition { +export interface ActivityDefinition { /** * The human readable/visual name of the Activity. */ @@ -90,9 +85,7 @@ interface InteractionActivityDefinitionType extends ActivityDefinition { /** * This interface represents the xAPI Interaction Component object. * - * @see xAPI - * Interaction Components + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-components | xAPI Interaction Components} */ export interface InteractionComponent { /** @@ -108,13 +101,11 @@ export interface InteractionComponent { /** * This interface represents the xAPI Activity Definition object for a True/False interaction. - *

+ * + * @remarks * An interaction with two possible responses: true or false. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface TrueFalseInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -124,14 +115,13 @@ export interface TrueFalseInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Multiple Choice interaction. - *

+ * + * @remarks * An interaction with a number of possible choices from which the learner can select. * This includes interactions in which the learner can select only one answer from the list and * those where the learner can select multiple items. - *

- * @see - * Interaction Types + * + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface ChoiceInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -141,16 +131,14 @@ export interface ChoiceInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Fill-in interaction. - *

+ * + * @remarks * An interaction which requires the learner to supply a short response in the form of one or * more strings of characters. Typically, the correct response consists of part of a word, * one word or a few words. "Short" means that the correct responses pattern and learner * response strings will normally be 250 characters or less. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface FillInInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -159,15 +147,13 @@ export interface FillInInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Long Fill-in interaction. - *

+ * + * @remarks * An interaction which requires the learner to supply a response in the form of a long * string of characters. "Long" means that the correct responses pattern and learner response * strings will normally be more than 250 characters. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface LongFillInInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -176,15 +162,13 @@ export interface LongFillInInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Matching interaction. - *

+ * + * @remarks * An interaction where the learner is asked to match items in one set (the source set) to * items in another set (the target set). Items do not have to pair off exactly and it is * possible for multiple or zero source items to be matched to a given target and vice versa. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface MatchingInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -195,13 +179,11 @@ export interface MatchingInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Performance interaction. - *

+ * + * @remarks * An interaction that requires the learner to perform a task that requires multiple steps. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface PerformanceInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -211,13 +193,11 @@ export interface PerformanceInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Sequencing interaction. - *

+ * + * @remarks * An interaction where the learner is asked to order items in a set. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface SequencingInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -227,13 +207,11 @@ export interface SequencingInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Likert interaction. - *

+ * + * @remarks * An interaction which asks the learner to select from a discrete set of choices on a scale/ - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface LikertInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -243,13 +221,11 @@ export interface LikertInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Numeric interaction. - *

+ * + * @remarks * Any interaction which requires a numeric response from the learner. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface NumericInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -258,13 +234,11 @@ export interface NumericInteractionActivityDefinition /** * This interface represents the xAPI Activity Definition object for a Other interaction. - *

+ * + * @remarks * Another type of interaction that does not fit into other defined types. - *

* - * @see - * Interaction Types + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface OtherInteractionActivityDefinition extends InteractionActivityDefinitionType { @@ -274,9 +248,7 @@ export interface OtherInteractionActivityDefinition /** * This class represents the xAPI Activity object. * - * @see xAPI - * Activity + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#interaction-types | Interaction Types} */ export interface Activity { objectType?: 'Activity'; diff --git a/projects/ngx-xapi/model/src/lib/actor.ts b/projects/ngx-xapi/model/src/lib/actor.ts index fc6c153..4cd1d73 100644 --- a/projects/ngx-xapi/model/src/lib/actor.ts +++ b/projects/ngx-xapi/model/src/lib/actor.ts @@ -50,7 +50,7 @@ type IdentifiedActor = /** * This type represents the xAPI Agent object. * - * @see xAPI Agent + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#agent | xAPI Agent} */ export type Agent = ActorType & IdentifiedActor & { @@ -62,19 +62,19 @@ export type Agent = ActorType & /** * Sub-type for the Anonymous Group. - *

+ * + * @remarks * An Anonymous Group is used to describe a cluster of people where there is * no ready identifier for this cluster, e.g. an ad hoc team. - *

* - * @see - * Requirements for Anonymous Groups + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#requirements-for-anonymous-groups | Requirements for Anonymous Groups} */ export type AnonymousGroup = ActorType & { /** * Mandatory property for Groups. */ objectType: 'Group'; + /** * The members of this Group. This is an unordered list. */ @@ -83,12 +83,11 @@ export type AnonymousGroup = ActorType & { /** * Sub-type for the Identified Group. - *

+ * + * @remarks * An Identified Group is used to uniquely identify a cluster of Agents. - *

* - * @see - * Requirements for Identified Groups + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#requirements-for-identified-groups | Requirements for Identified Groups} */ export type IdentifiedGroup = ActorType & IdentifiedActor & { @@ -104,20 +103,20 @@ export type IdentifiedGroup = ActorType & /** * This type represents the xAPI Group object. - *

+ * + * @remarks * A Group is used to identify a set of Agents. A Group can be anonymous or identified. - *

* - * @see xAPI Group + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#group | xAPI Group} */ export type Group = AnonymousGroup | IdentifiedGroup; /** * This class represents the xAPI Actor object. - *

+ * + * @remarks * An Actor is used to identify the Agent or Group that performed the action. - *

* - * @see xAPI Actor + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#actor | xAPI Actor} */ export type Actor = Agent | Group; diff --git a/projects/ngx-xapi/model/src/lib/attachment.ts b/projects/ngx-xapi/model/src/lib/attachment.ts index 3fb4324..31a9e1a 100644 --- a/projects/ngx-xapi/model/src/lib/attachment.ts +++ b/projects/ngx-xapi/model/src/lib/attachment.ts @@ -3,8 +3,7 @@ import { LanguageMap } from './language-map'; /** * This interface represents the xAPI Attachment object. * - * @see xAPI - * Attachment + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#attachments | xAPI Attachment} */ export interface Attachment { /** diff --git a/projects/ngx-xapi/model/src/lib/extensions.ts b/projects/ngx-xapi/model/src/lib/extensions.ts index 9db2d24..490a75f 100644 --- a/projects/ngx-xapi/model/src/lib/extensions.ts +++ b/projects/ngx-xapi/model/src/lib/extensions.ts @@ -1,15 +1,14 @@ /** * This interface represents the xAPI Extensions object. - *

+ * + * @remarks * Extensions are available as part of Activity Definitions, as part of a Statement's "context" * property, or as part of a Statement's "result" property. In each case, extensions are intended * to provide a natural way to extend those properties for some specialized use. The contents of * these extensions might be something valuable to just one application, or it might be a * convention used by an entire Community of Practice. - *

* - * @see xAPI - * Extensions + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#41-extensions | xAPI Extensions} */ export interface Extensions { [key: string]: any; diff --git a/projects/ngx-xapi/model/src/lib/language-map.ts b/projects/ngx-xapi/model/src/lib/language-map.ts index bfac79f..3598f4f 100644 --- a/projects/ngx-xapi/model/src/lib/language-map.ts +++ b/projects/ngx-xapi/model/src/lib/language-map.ts @@ -2,8 +2,7 @@ * A language map is a dictionary where the key is a RFC 5646 Language Tag, and the value is a * string in the language specified in the tag. * - * @see Language - * Maps + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#lang-maps | Language Maps} */ export interface LanguageMap { [key: string]: string; diff --git a/projects/ngx-xapi/model/src/lib/person.ts b/projects/ngx-xapi/model/src/lib/person.ts index 392dae8..c9275eb 100644 --- a/projects/ngx-xapi/model/src/lib/person.ts +++ b/projects/ngx-xapi/model/src/lib/person.ts @@ -3,9 +3,7 @@ import { Account } from './account'; /** * This interface represents the xAPI Person object. * - * @see xAPI - * Person + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#person-properties | xAPI Person} */ export interface Person { objectType: 'Person'; diff --git a/projects/ngx-xapi/model/src/lib/result.ts b/projects/ngx-xapi/model/src/lib/result.ts index c7e328b..5284f0f 100644 --- a/projects/ngx-xapi/model/src/lib/result.ts +++ b/projects/ngx-xapi/model/src/lib/result.ts @@ -3,8 +3,7 @@ import { Extensions } from './extensions'; /** * This interface represents the xAPI Score object. * - * @see xAPI - * Score + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#2451-score | xAPI Score} */ export interface Score { /** @@ -33,8 +32,7 @@ export interface Score { /** * This interface represents the xAPI Result object. * - * @see xAPI - * Result + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#result | xAPI Result} */ export interface Result { /** diff --git a/projects/ngx-xapi/model/src/lib/statement-result.ts b/projects/ngx-xapi/model/src/lib/statement-result.ts index f561dcd..d48f0b2 100644 --- a/projects/ngx-xapi/model/src/lib/statement-result.ts +++ b/projects/ngx-xapi/model/src/lib/statement-result.ts @@ -3,9 +3,7 @@ import { Statement } from './statement'; /** * This interface represents the xAPI Statement Result object. * - * @see xAPI - * Statement Result + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#25-retrieval-of-statements | xAPI Statement Result} */ export interface StatementResult { /** diff --git a/projects/ngx-xapi/model/src/lib/statement.ts b/projects/ngx-xapi/model/src/lib/statement.ts index 0f83169..4510eec 100644 --- a/projects/ngx-xapi/model/src/lib/statement.ts +++ b/projects/ngx-xapi/model/src/lib/statement.ts @@ -8,9 +8,7 @@ import { Verb } from './verb'; /** * This interface represents the xAPI Statement Reference object. * - * @see xAPI - * Statement Reference + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#statement-references | xAPI Statement Reference} */ export interface StatementReference { /** @@ -27,9 +25,7 @@ export interface StatementReference { /** * This interface represents the xAPI Context Activities object. * - * @see xAPI - * Context Activities + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#2462-contextactivities-property | xAPI Context Activities} */ export interface ContextActivities { /** @@ -56,8 +52,7 @@ export interface ContextActivities { /** * This interface represents the xAPI Context object. * - * @see xAPI - * Context + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#context | xAPI Context} */ export interface Context { /** @@ -106,9 +101,7 @@ export interface Context { /** * This interface represents the xAPI Statement object. * - * @see xAPI - * Statement + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#statement-properties | xAPI Statement} */ export interface Statement { /** @@ -170,8 +163,7 @@ export interface Statement { /** * This interface represents the xAPI SubStatement object. * - * @see xAPI - * SubStatement + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#substatements | xAPI SubStatement} */ export interface SubStatement extends Statement { objectType: 'SubStatement'; diff --git a/projects/ngx-xapi/model/src/lib/verb.ts b/projects/ngx-xapi/model/src/lib/verb.ts index 4019234..fcf4cae 100644 --- a/projects/ngx-xapi/model/src/lib/verb.ts +++ b/projects/ngx-xapi/model/src/lib/verb.ts @@ -3,8 +3,7 @@ import { LanguageMap } from './language-map'; /** * The Verb defines the action between an Actor and an Activity. * - * @see xAPI - * Verb + * @see {@link https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#243-verb | xAPI Verb} */ export interface Verb { /** @@ -26,9 +25,7 @@ export interface Verb { * representing the question. The text of the answer will often be included in the response inside * result. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const answered: Verb = { id: 'http://adlnet.gov/expapi/verbs/answered', @@ -38,9 +35,7 @@ export const answered: Verb = { /** * Indicates an inquiry by an actor with the expectation of a response or answer to a question. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const asked: Verb = { id: 'http://adlnet.gov/expapi/verbs/asked', @@ -51,9 +46,7 @@ export const asked: Verb = { * Indicates the actor made an effort to access the object. An attempt statement without * additional activities could be considered incomplete in some cases. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const attempted: Verb = { id: 'http://adlnet.gov/expapi/verbs/attempted', @@ -63,9 +56,7 @@ export const attempted: Verb = { /** * Indicates the actor was present at a virtual or physical event or activity. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const attended: Verb = { id: 'http://adlnet.gov/expapi/verbs/attended', @@ -75,9 +66,7 @@ export const attended: Verb = { /** * Indicates the actor provided digital or written annotations on or about an object. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const commented: Verb = { id: 'http://adlnet.gov/expapi/verbs/commented', @@ -87,9 +76,7 @@ export const commented: Verb = { /** * Indicates the actor finished or concluded the activity normally. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const completed: Verb = { id: 'http://adlnet.gov/expapi/verbs/completed', @@ -99,9 +86,7 @@ export const completed: Verb = { /** * Indicates the actor intentionally departed from the activity or object. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const exited: Verb = { id: 'http://adlnet.gov/expapi/verbs/exited', @@ -112,9 +97,7 @@ export const exited: Verb = { * Indicates the actor only encountered the object, and is applicable in situations where a * specific achievement or completion is not required. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const experienced: Verb = { id: 'http://adlnet.gov/expapi/verbs/experienced', @@ -125,9 +108,7 @@ export const experienced: Verb = { * Indicates the actor did not successfully pass an activity to a level of predetermined * satisfaction. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const failed: Verb = { id: 'http://adlnet.gov/expapi/verbs/failed', @@ -137,9 +118,7 @@ export const failed: Verb = { /** * Indicates the actor introduced an object into a physical or virtual location. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const imported: Verb = { id: 'http://adlnet.gov/expapi/verbs/imported', @@ -149,9 +128,7 @@ export const imported: Verb = { /** * Indicates the activity provider has determined that the actor successfully started an activity. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const initialized: Verb = { id: 'http://adlnet.gov/expapi/verbs/initialized', @@ -161,9 +138,7 @@ export const initialized: Verb = { /** * Indicates the actor engaged with a physical or virtual object. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const interacted: Verb = { id: 'http://adlnet.gov/expapi/verbs/interacted', @@ -173,9 +148,7 @@ export const interacted: Verb = { /** * Indicates the actor attempted to start an activity. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const launched: Verb = { id: 'http://adlnet.gov/expapi/verbs/launched', @@ -185,9 +158,7 @@ export const launched: Verb = { /** * Indicates the highest level of comprehension or competence the actor performed in an activity. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const mastered: Verb = { id: 'http://adlnet.gov/expapi/verbs/mastered', @@ -197,9 +168,7 @@ export const mastered: Verb = { /** * Indicates the actor successfully passed an activity to a level of predetermined satisfaction. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const passed: Verb = { id: 'http://adlnet.gov/expapi/verbs/passed', @@ -210,9 +179,7 @@ export const passed: Verb = { * Indicates the selected choices, favoured options or settings of an actor in relation to an * object or activity. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const preferred: Verb = { id: 'http://adlnet.gov/expapi/verbs/preferred', @@ -222,9 +189,7 @@ export const preferred: Verb = { /** * Indicates a value of how much of an actor has advanced or moved through an activity. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const progressed: Verb = { id: 'http://adlnet.gov/expapi/verbs/progressed', @@ -234,9 +199,7 @@ export const progressed: Verb = { /** * Indicates the actor is officially enrolled or inducted in an activity. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const registered: Verb = { id: 'http://adlnet.gov/expapi/verbs/registered', @@ -246,9 +209,7 @@ export const registered: Verb = { /** * Indicates an actor reacted or replied to an object. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const responded: Verb = { id: 'http://adlnet.gov/expapi/verbs/responded', @@ -259,9 +220,7 @@ export const responded: Verb = { * Indicates the application has determined that the actor continued or reopened a suspended * attempt on an activity. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const resumed: Verb = { id: 'http://adlnet.gov/expapi/verbs/resumed', @@ -271,9 +230,7 @@ export const resumed: Verb = { /** * Indicates a numerical value related to an actor's performance on an activity. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const scored: Verb = { id: 'http://adlnet.gov/expapi/verbs/scored', @@ -284,9 +241,7 @@ export const scored: Verb = { * Indicates the actor's intent to openly provide access to an object of common interest to other * actors or groups. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const shared: Verb = { id: 'http://adlnet.gov/expapi/verbs/shared', @@ -297,9 +252,7 @@ export const shared: Verb = { * Indicates the status of a temporarily halted activity when an actor's intent is returning to * the or object activity at a later time. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const suspended: Verb = { id: 'http://adlnet.gov/expapi/verbs/suspended', @@ -309,9 +262,7 @@ export const suspended: Verb = { /** * Indicates that the actor successfully ended an activity. * - * @see SCORM - * Profile + * @see {@link https://profiles.adlnet.gov/profile/b4a24801-c630-4990-ac80-6281b794e311/concepts/ec3b0c8c-db7c-4bb5-8c2d-0bb6ff387e15 | SCORM Profile} */ export const terminated: Verb = { id: 'http://adlnet.gov/expapi/verbs/terminated', @@ -322,9 +273,7 @@ export const terminated: Verb = { * A special reserved verb used by a LRS or application to mark a statement as invalid. See the * xAPI specification for details on Voided statements. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const voided: Verb = { id: 'http://adlnet.gov/expapi/verbs/voided', @@ -335,9 +284,7 @@ export const voided: Verb = { * Indicates that the AU session was abnormally terminated by a learner's action (or due to a * system failure). * - * @see cmi5 - * Profile + * @see {@link https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/582cbd06-8920-4748-917f-5c1af8244a82 | cmi5 Profile} */ export const abandoned: Verb = { id: 'https://w3id.org/xapi/adl/verbs/abandoned', @@ -348,9 +295,7 @@ export const abandoned: Verb = { * Indicates the actor gained access to a system or service by identifying and authenticating with * the credentials provided by the actor. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const loggedIn: Verb = { id: 'https://w3id.org/xapi/adl/verbs/logged-in', @@ -360,9 +305,7 @@ export const loggedIn: Verb = { /** * Indicates the actor either lost or discontinued access to a system or service. * - * @see ADL - * Vocabulary + * @see {@link https://profiles.adlnet.gov/profile/3270df72-2d3a-40fe-adf6-86db6d8671b1/concepts/c0d5a500-886e-4e85-9cea-121f07c79860 | ADL Vocabulary} */ export const loggedOut: Verb = { id: 'https://w3id.org/xapi/adl/verbs/logged-out', @@ -373,9 +316,7 @@ export const loggedOut: Verb = { * Indicates that the authority or activity provider determined the actor has fulfilled the * criteria of the object or activity. * - * @see cmi5 - * Profile + * @see {@link https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/582cbd06-8920-4748-917f-5c1af8244a82 | cmi5 Profile} */ export const satisfied: Verb = { id: 'https://w3id.org/xapi/adl/verbs/satisfied', @@ -386,9 +327,7 @@ export const satisfied: Verb = { * Indicates that the learning activity requirements were met by means other than completing the * activity. A waived statement is used to indicate that the activity may be skipped by the actor. * - * @see cmi5 - * Profile + * @see {@link https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/582cbd06-8920-4748-917f-5c1af8244a82 | cmi5 Profile} */ export const waived: Verb = { id: 'https://w3id.org/xapi/adl/verbs/waived',