Merge branch 'dev' into refactor/common
This commit is contained in:
commit
a4408b5bc0
145 changed files with 3437 additions and 2822 deletions
|
@ -1,3 +1,3 @@
|
|||
type LearningPathExample = {
|
||||
interface LearningPathExample {
|
||||
createLearningPath: () => LearningPath;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,12 @@ import { LearningPathTransition } from '../../../src/entities/content/learning-p
|
|||
import { LearningPathNode } from '../../../src/entities/content/learning-path-node.entity';
|
||||
import { LearningPath } from '../../../src/entities/content/learning-path.entity';
|
||||
|
||||
export function createLearningPathTransition(node: LearningPathNode, transitionNumber: number, condition: string | null, to: LearningPathNode) {
|
||||
export function createLearningPathTransition(
|
||||
node: LearningPathNode,
|
||||
transitionNumber: number,
|
||||
condition: string | null,
|
||||
to: LearningPathNode
|
||||
): LearningPathTransition {
|
||||
const trans = new LearningPathTransition();
|
||||
trans.node = node;
|
||||
trans.transitionNumber = transitionNumber;
|
||||
|
@ -19,7 +24,7 @@ export function createLearningPathNode(
|
|||
version: number,
|
||||
language: Language,
|
||||
startNode: boolean
|
||||
) {
|
||||
): LearningPathNode {
|
||||
const node = new LearningPathNode();
|
||||
node.learningPath = learningPath;
|
||||
node.nodeNumber = nodeNumber;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { LearningPath } from '../../../src/entities/content/learning-path.entity';
|
||||
import { Language } from 'dwengo-1-common/src/util/language';
|
||||
import { EnvVars, getEnvVar } from '../../../src/util/envvars';
|
||||
import { envVars, getEnvVar } from '../../../src/util/envVars';
|
||||
import { createLearningPathNode, createLearningPathTransition } from './learning-path-utils';
|
||||
import { LearningPathNode } from '../../../src/entities/content/learning-path-node.entity';
|
||||
|
||||
|
@ -19,7 +19,7 @@ const example: LearningPathExample = {
|
|||
createLearningPath: () => {
|
||||
const path = new LearningPath();
|
||||
path.language = Language.Dutch;
|
||||
path.hruid = `${getEnvVar(EnvVars.UserContentPrefix)}pn_werking`;
|
||||
path.hruid = `${getEnvVar(envVars.UserContentPrefix)}pn_werking`;
|
||||
path.title = 'Werken met notebooks';
|
||||
path.description = 'Een korte inleiding tot Python notebooks. Hoe ga je gemakkelijk en efficiënt met de notebooks aan de slag?';
|
||||
path.nodes = createNodes(path);
|
||||
|
|
|
@ -4,18 +4,18 @@ import testMultipleChoiceExample from '../learning-objects/test-multiple-choice/
|
|||
import { dummyLearningObject } from '../learning-objects/dummy/dummy-learning-object-example';
|
||||
import { createLearningPathNode, createLearningPathTransition } from './learning-path-utils';
|
||||
import { LearningObject } from '../../../src/entities/content/learning-object.entity';
|
||||
import { EnvVars, getEnvVar } from '../../../src/util/envvars';
|
||||
import { envVars, getEnvVar } from '../../../src/util/envVars';
|
||||
|
||||
export type ConditionTestLearningPathAndLearningObjects = {
|
||||
export interface ConditionTestLearningPathAndLearningObjects {
|
||||
branchingObject: LearningObject;
|
||||
extraExerciseObject: LearningObject;
|
||||
finalObject: LearningObject;
|
||||
learningPath: LearningPath;
|
||||
};
|
||||
}
|
||||
|
||||
export function createConditionTestLearningPathAndLearningObjects() {
|
||||
export function createConditionTestLearningPathAndLearningObjects(): ConditionTestLearningPathAndLearningObjects {
|
||||
const learningPath = new LearningPath();
|
||||
learningPath.hruid = `${getEnvVar(EnvVars.UserContentPrefix)}test_conditions`;
|
||||
learningPath.hruid = `${getEnvVar(envVars.UserContentPrefix)}test_conditions`;
|
||||
learningPath.language = Language.English;
|
||||
learningPath.title = 'Example learning path with conditional transitions';
|
||||
learningPath.description = 'This learning path was made for the purpose of testing conditional transitions';
|
||||
|
@ -78,7 +78,3 @@ export function createConditionTestLearningPathAndLearningObjects() {
|
|||
learningPath: learningPath,
|
||||
};
|
||||
}
|
||||
|
||||
const example: LearningPathExample = {
|
||||
createLearningPath: () => createConditionTestLearningPathAndLearningObjects().learningPath,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue