style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-04-18 23:36:22 +00:00
parent af8c783a26
commit 5168ceaee0
56 changed files with 680 additions and 741 deletions

View file

@ -1,40 +1,39 @@
import {EntityManager} from '@mikro-orm/core';
import {LearningPath} from '../../../src/entities/content/learning-path.entity';
import {Language} from '@dwengo-1/common/util/language';
import {mapToLearningPath} from "../../../src/services/learning-paths/learning-path-service";
import {envVars, getEnvVar} from "../../../src/util/envVars";
import {LearningPath as LearningPathDTO} from "@dwengo-1/common/interfaces/learning-content";
import { EntityManager } from '@mikro-orm/core';
import { LearningPath } from '../../../src/entities/content/learning-path.entity';
import { Language } from '@dwengo-1/common/util/language';
import { mapToLearningPath } from '../../../src/services/learning-paths/learning-path-service';
import { envVars, getEnvVar } from '../../../src/util/envVars';
import { LearningPath as LearningPathDTO } from '@dwengo-1/common/interfaces/learning-content';
import {
testLearningObject01, testLearningObject02, testLearningObject03, testLearningObject04, testLearningObject05,
testLearningObject01,
testLearningObject02,
testLearningObject03,
testLearningObject04,
testLearningObject05,
testLearningObjectEssayQuestion,
testLearningObjectMultipleChoice, testLearningObjectPnNotebooks
} from "./learning-objects.testdata";
testLearningObjectMultipleChoice,
testLearningObjectPnNotebooks,
} from './learning-objects.testdata';
export function makeTestLearningPaths(_em: EntityManager): LearningPath[] {
const learningPath01 = mapToLearningPath(testLearningPath01, []);
const learningPath02 = mapToLearningPath(testLearningPath02, []);
const partiallyDatabasePartiallyDwengoApiLearningPath
= mapToLearningPath(testPartiallyDatabaseAndPartiallyDwengoApiLearningPath, [])
const learningPathWithConditions = mapToLearningPath(testLearningPathWithConditions, [])
const partiallyDatabasePartiallyDwengoApiLearningPath = mapToLearningPath(testPartiallyDatabaseAndPartiallyDwengoApiLearningPath, []);
const learningPathWithConditions = mapToLearningPath(testLearningPathWithConditions, []);
return [
learningPath01,
learningPath02,
partiallyDatabasePartiallyDwengoApiLearningPath,
learningPathWithConditions
];
return [learningPath01, learningPath02, partiallyDatabasePartiallyDwengoApiLearningPath, learningPathWithConditions];
}
const nowString = new Date().toString();
export const testLearningPath01: LearningPathDTO = {
keywords: "test",
keywords: 'test',
target_ages: [16, 17, 18],
hruid: `${getEnvVar(envVars.UserContentPrefix)}id01`,
language: Language.English,
title: "repertoire Tool",
description: "all about Tool",
title: 'repertoire Tool',
description: 'all about Tool',
nodes: [
{
learningobject_hruid: testLearningObject01.hruid,
@ -48,10 +47,10 @@ export const testLearningPath01: LearningPathDTO = {
next: {
hruid: testLearningObject02.hruid,
language: testLearningObject02.language,
version: testLearningObject02.version
}
}
]
version: testLearningObject02.version,
},
},
],
},
{
learningobject_hruid: testLearningObject02.hruid,
@ -59,18 +58,18 @@ export const testLearningPath01: LearningPathDTO = {
version: testLearningObject02.version,
created_at: nowString,
updatedAt: nowString,
transitions: []
}
]
transitions: [],
},
],
};
export const testLearningPath02: LearningPathDTO = {
keywords: "test",
keywords: 'test',
target_ages: [16, 17, 18],
hruid: `${getEnvVar(envVars.UserContentPrefix)}id02`,
language: Language.English,
title: "repertoire Dire Straits",
description: "all about Dire Straits",
title: 'repertoire Dire Straits',
description: 'all about Dire Straits',
nodes: [
{
learningobject_hruid: testLearningObject03.hruid,
@ -84,10 +83,10 @@ export const testLearningPath02: LearningPathDTO = {
next: {
hruid: testLearningObject04.hruid,
language: testLearningObject04.language,
version: testLearningObject04.version
}
}
]
version: testLearningObject04.version,
},
},
],
},
{
learningobject_hruid: testLearningObject04.hruid,
@ -100,10 +99,10 @@ export const testLearningPath02: LearningPathDTO = {
next: {
hruid: testLearningObject05.hruid,
language: testLearningObject05.language,
version: testLearningObject05.version
}
}
]
version: testLearningObject05.version,
},
},
],
},
{
learningobject_hruid: testLearningObject05.hruid,
@ -111,17 +110,17 @@ export const testLearningPath02: LearningPathDTO = {
version: testLearningObject05.version,
created_at: nowString,
updatedAt: nowString,
transitions: []
}
]
transitions: [],
},
],
};
export const testPartiallyDatabaseAndPartiallyDwengoApiLearningPath: LearningPathDTO = {
hruid: `${getEnvVar(envVars.UserContentPrefix)}pn_werking`,
title: "Werken met notebooks",
title: 'Werken met notebooks',
language: Language.Dutch,
description: 'Een korte inleiding tot Python notebooks. Hoe ga je gemakkelijk en efficiënt met de notebooks aan de slag?',
keywords: "Python KIKS Wiskunde STEM AI",
keywords: 'Python KIKS Wiskunde STEM AI',
target_ages: [14, 15, 16, 17, 18],
nodes: [
{
@ -135,15 +134,15 @@ export const testPartiallyDatabaseAndPartiallyDwengoApiLearningPath: LearningPat
{
default: true,
next: {
hruid: "pn_werkingnotebooks2",
hruid: 'pn_werkingnotebooks2',
language: Language.Dutch,
version: 3
}
}
]
version: 3,
},
},
],
},
{
learningobject_hruid: "pn_werkingnotebooks2",
learningobject_hruid: 'pn_werkingnotebooks2',
language: Language.Dutch,
version: 3,
created_at: nowString,
@ -152,30 +151,30 @@ export const testPartiallyDatabaseAndPartiallyDwengoApiLearningPath: LearningPat
{
default: true,
next: {
hruid: "pn_werkingnotebooks3",
hruid: 'pn_werkingnotebooks3',
language: Language.Dutch,
version: 3
}
}
]
version: 3,
},
},
],
},
{
learningobject_hruid: "pn_werkingnotebooks3",
learningobject_hruid: 'pn_werkingnotebooks3',
language: Language.Dutch,
version: 3,
created_at: nowString,
updatedAt: nowString,
transitions: []
}
]
}
transitions: [],
},
],
};
export const testLearningPathWithConditions: LearningPathDTO = {
hruid: `${getEnvVar(envVars.UserContentPrefix)}test_conditions`,
language: Language.English,
title: 'Example learning path with conditional transitions',
description: 'This learning path was made for the purpose of testing conditional transitions',
keywords: "test",
keywords: 'test',
target_ages: [10, 11, 12, 13, 14, 15, 16, 17, 18],
nodes: [
{
@ -193,8 +192,8 @@ export const testLearningPathWithConditions: LearningPathDTO = {
//... we let the student do an extra exercise.
hruid: testLearningObject01.hruid,
language: testLearningObject01.language,
version: testLearningObject01.version
}
version: testLearningObject01.version,
},
},
{
// If the answer to the first question was the second one (I can follow along):
@ -203,10 +202,10 @@ export const testLearningPathWithConditions: LearningPathDTO = {
//... we let the student right through to the final question.
hruid: testLearningObjectEssayQuestion.hruid,
language: testLearningObjectEssayQuestion.language,
version: testLearningObjectEssayQuestion.version
}
}
]
version: testLearningObjectEssayQuestion.version,
},
},
],
},
{
learningobject_hruid: testLearningObject01.hruid,
@ -220,10 +219,10 @@ export const testLearningPathWithConditions: LearningPathDTO = {
next: {
hruid: testLearningObjectEssayQuestion.hruid,
language: testLearningObjectEssayQuestion.language,
version: testLearningObjectEssayQuestion.version
}
}
]
version: testLearningObjectEssayQuestion.version,
},
},
],
},
{
learningobject_hruid: testLearningObjectEssayQuestion.hruid,
@ -231,7 +230,7 @@ export const testLearningPathWithConditions: LearningPathDTO = {
version: testLearningObjectEssayQuestion.version,
created_at: nowString,
updatedAt: nowString,
transitions: []
}
]
}
transitions: [],
},
],
};