refactor(common): Learning content
This commit is contained in:
parent
70a31a292c
commit
5a90862098
19 changed files with 36 additions and 22 deletions
|
@ -1,5 +1,4 @@
|
|||
import { LearningPathProvider } from './learning-path-provider.js';
|
||||
import { FilteredLearningObject, LearningObjectNode, LearningPath, LearningPathResponse, Transition } from '../../interfaces/learning-content.js';
|
||||
import { LearningPath as LearningPathEntity } from '../../entities/content/learning-path.entity.js';
|
||||
import { getLearningPathRepository } from '../../data/repositories.js';
|
||||
import { Language } from '../../entities/content/language.js';
|
||||
|
@ -7,6 +6,13 @@ import learningObjectService from '../learning-objects/learning-object-service.j
|
|||
import { LearningPathNode } from '../../entities/content/learning-path-node.entity.js';
|
||||
import { LearningPathTransition } from '../../entities/content/learning-path-transition.entity.js';
|
||||
import { getLastSubmissionForCustomizationTarget, isTransitionPossible, PersonalizationTarget } from './learning-path-personalization-util.js';
|
||||
import {
|
||||
FilteredLearningObject,
|
||||
LearningObjectNode,
|
||||
LearningPath,
|
||||
LearningPathResponse,
|
||||
Transition,
|
||||
} from 'dwengo-1-common/src/interfaces/learning-content';
|
||||
|
||||
/**
|
||||
* Fetches the corresponding learning object for each of the nodes and creates a map that maps each node to its
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { fetchWithLogging } from '../../util/api-helper.js';
|
||||
import { DWENGO_API_BASE } from '../../config.js';
|
||||
import { LearningPath, LearningPathResponse } from '../../interfaces/learning-content.js';
|
||||
import { LearningPathProvider } from './learning-path-provider.js';
|
||||
import { getLogger, Logger } from '../../logging/initalize.js';
|
||||
import { LearningPath, LearningPathResponse } from 'dwengo-1-common/src/interfaces/learning-content';
|
||||
|
||||
const logger: Logger = getLogger();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { LearningPath, LearningPathResponse } from '../../interfaces/learning-content.js';
|
||||
import { Language } from '../../entities/content/language.js';
|
||||
import { PersonalizationTarget } from './learning-path-personalization-util.js';
|
||||
import { LearningPath, LearningPathResponse } from 'dwengo-1-common/src/interfaces/learning-content';
|
||||
|
||||
/**
|
||||
* Generic interface for a service which provides access to learning paths from a data source.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { LearningPath, LearningPathResponse } from '../../interfaces/learning-content.js';
|
||||
import dwengoApiLearningPathProvider from './dwengo-api-learning-path-provider.js';
|
||||
import databaseLearningPathProvider from './database-learning-path-provider.js';
|
||||
import { EnvVars, getEnvVar } from '../../util/envvars.js';
|
||||
import { Language } from '../../entities/content/language.js';
|
||||
import { PersonalizationTarget } from './learning-path-personalization-util.js';
|
||||
import { LearningPath, LearningPathResponse } from 'dwengo-1-common/src/interfaces/learning-content';
|
||||
|
||||
const userContentPrefix = getEnvVar(EnvVars.UserContentPrefix);
|
||||
const allProviders = [dwengoApiLearningPathProvider, databaseLearningPathProvider];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue