style: fix linting issues met Prettier
This commit is contained in:
parent
af8c783a26
commit
5168ceaee0
56 changed files with 680 additions and 741 deletions
|
@ -2,8 +2,8 @@ import { EntityManager } from '@mikro-orm/core';
|
|||
import { Assignment } from '../../../src/entities/assignments/assignment.entity';
|
||||
import { Class } from '../../../src/entities/classes/class.entity';
|
||||
import { Language } from '@dwengo-1/common/util/language';
|
||||
import {testLearningPathWithConditions} from "../content/learning-paths.testdata";
|
||||
import {getClassWithTestleerlingAndTestleerkracht} from "../classes/classes.testdata";
|
||||
import { testLearningPathWithConditions } from '../content/learning-paths.testdata';
|
||||
import { getClassWithTestleerlingAndTestleerkracht } from '../classes/classes.testdata';
|
||||
|
||||
export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assignment[] {
|
||||
assignment01 = em.create(Assignment, {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {EntityManager} from '@mikro-orm/core';
|
||||
import { EntityManager } from '@mikro-orm/core';
|
||||
import { Group } from '../../../src/entities/assignments/group.entity';
|
||||
import { Assignment } from '../../../src/entities/assignments/assignment.entity';
|
||||
import { Student } from '../../../src/entities/users/student.entity';
|
||||
import {getConditionalPathAssignment} from "./assignments.testdata";
|
||||
import {getTestleerling1} from "../users/students.testdata";
|
||||
import { getConditionalPathAssignment } from './assignments.testdata';
|
||||
import { getTestleerling1 } from '../users/students.testdata';
|
||||
|
||||
export function makeTestGroups(em: EntityManager, students: Student[], assignments: Assignment[]): Group[] {
|
||||
/*
|
||||
|
@ -62,8 +62,8 @@ export function makeTestGroups(em: EntityManager, students: Student[], assignmen
|
|||
group1ConditionalLearningPath = em.create(Group, {
|
||||
assignment: getConditionalPathAssignment(),
|
||||
groupNumber: 1,
|
||||
members: [getTestleerling1()]
|
||||
})
|
||||
members: [getTestleerling1()],
|
||||
});
|
||||
|
||||
return [group01, group02, group03, group04, group05, group1ConditionalLearningPath];
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ import { EntityManager } from '@mikro-orm/core';
|
|||
import { Class } from '../../../src/entities/classes/class.entity';
|
||||
import { Student } from '../../../src/entities/users/student.entity';
|
||||
import { Teacher } from '../../../src/entities/users/teacher.entity';
|
||||
import {getTestleerkracht1} from "../users/teachers.testdata";
|
||||
import {getTestleerling1} from "../users/students.testdata";
|
||||
import { getTestleerkracht1 } from '../users/teachers.testdata';
|
||||
import { getTestleerling1 } from '../users/students.testdata';
|
||||
|
||||
export function makeTestClasses(em: EntityManager, students: Student[], teachers: Teacher[]): Class[] {
|
||||
const studentsClass01 = students.slice(0, 8);
|
||||
|
@ -47,10 +47,10 @@ export function makeTestClasses(em: EntityManager, students: Student[], teachers
|
|||
});
|
||||
|
||||
classWithTestleerlingAndTestleerkracht = em.create(Class, {
|
||||
classId: "a75298b5-18aa-471d-8eeb-5d77eb989393",
|
||||
classId: 'a75298b5-18aa-471d-8eeb-5d77eb989393',
|
||||
displayName: 'Testklasse',
|
||||
teachers: [getTestleerkracht1()],
|
||||
students: [getTestleerling1()]
|
||||
students: [getTestleerling1()],
|
||||
});
|
||||
|
||||
return [class01, class02, class03, class04, classWithTestleerlingAndTestleerkracht];
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import {EntityManager, RequiredEntityData} from '@mikro-orm/core';
|
||||
import {LearningObject} from '../../../src/entities/content/learning-object.entity';
|
||||
import {Language} from '@dwengo-1/common/util/language';
|
||||
import {DwengoContentType} from '../../../src/services/learning-objects/processing/content-type';
|
||||
import {ReturnValue} from '../../../src/entities/content/return-value.entity';
|
||||
import {envVars, getEnvVar} from "../../../src/util/envVars";
|
||||
import {loadTestAsset} from "../../test-utils/load-test-asset";
|
||||
import {v4} from "uuid";
|
||||
import { EntityManager, RequiredEntityData } from '@mikro-orm/core';
|
||||
import { LearningObject } from '../../../src/entities/content/learning-object.entity';
|
||||
import { Language } from '@dwengo-1/common/util/language';
|
||||
import { DwengoContentType } from '../../../src/services/learning-objects/processing/content-type';
|
||||
import { ReturnValue } from '../../../src/entities/content/return-value.entity';
|
||||
import { envVars, getEnvVar } from '../../../src/util/envVars';
|
||||
import { loadTestAsset } from '../../test-utils/load-test-asset';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
export function makeTestLearningObjects(em: EntityManager): LearningObject[] {
|
||||
const returnValue: ReturnValue = new ReturnValue();
|
||||
|
@ -19,13 +19,19 @@ export function makeTestLearningObjects(em: EntityManager): LearningObject[] {
|
|||
const learningObject05 = em.create(LearningObject, testLearningObject05);
|
||||
|
||||
const learningObjectMultipleChoice = em.create(LearningObject, testLearningObjectMultipleChoice);
|
||||
const learningObjectEssayQuestion= em.create(LearningObject, testLearningObjectEssayQuestion);
|
||||
const learningObjectEssayQuestion = em.create(LearningObject, testLearningObjectEssayQuestion);
|
||||
|
||||
const learningObjectPnNotebooks = em.create(LearningObject, testLearningObjectPnNotebooks);
|
||||
|
||||
return [
|
||||
learningObject01, learningObject02, learningObject03, learningObject04, learningObject05,
|
||||
learningObjectMultipleChoice, learningObjectEssayQuestion, learningObjectPnNotebooks
|
||||
learningObject01,
|
||||
learningObject02,
|
||||
learningObject03,
|
||||
learningObject04,
|
||||
learningObject05,
|
||||
learningObjectMultipleChoice,
|
||||
learningObjectEssayQuestion,
|
||||
learningObjectPnNotebooks,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -164,14 +170,14 @@ export const testLearningObjectMultipleChoice: RequiredEntityData<LearningObject
|
|||
hruid: `${getEnvVar(envVars.UserContentPrefix)}test_multiple_choice`,
|
||||
language: Language.English,
|
||||
version: 1,
|
||||
title: "Self-evaluation",
|
||||
title: 'Self-evaluation',
|
||||
description: "Time to evaluate how well you understand what you've learned so far.",
|
||||
keywords: ["test"],
|
||||
keywords: ['test'],
|
||||
teacherExclusive: false,
|
||||
skosConcepts: [],
|
||||
educationalGoals: [],
|
||||
copyright: "Groep 1 SEL-2 2025",
|
||||
license: "CC0",
|
||||
copyright: 'Groep 1 SEL-2 2025',
|
||||
license: 'CC0',
|
||||
difficulty: 1,
|
||||
estimatedTime: 1,
|
||||
attachments: [],
|
||||
|
@ -183,21 +189,21 @@ export const testLearningObjectMultipleChoice: RequiredEntityData<LearningObject
|
|||
returnValue: {
|
||||
callbackUrl: `%SUBMISSION%`,
|
||||
callbackSchema: '["antwoord vraag 1"]',
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const testLearningObjectEssayQuestion: RequiredEntityData<LearningObject> = {
|
||||
hruid: `${getEnvVar(envVars.UserContentPrefix)}test_essay_question`,
|
||||
language: Language.English,
|
||||
version: 1,
|
||||
title: "Reflection",
|
||||
description: "Reflect on your learning progress.",
|
||||
keywords: ["test"],
|
||||
title: 'Reflection',
|
||||
description: 'Reflect on your learning progress.',
|
||||
keywords: ['test'],
|
||||
teacherExclusive: false,
|
||||
skosConcepts: [],
|
||||
educationalGoals: [],
|
||||
copyright: "Groep 1 SEL-2 2025",
|
||||
license: "CC0",
|
||||
copyright: 'Groep 1 SEL-2 2025',
|
||||
license: 'CC0',
|
||||
difficulty: 1,
|
||||
estimatedTime: 1,
|
||||
attachments: [],
|
||||
|
@ -209,47 +215,47 @@ export const testLearningObjectEssayQuestion: RequiredEntityData<LearningObject>
|
|||
returnValue: {
|
||||
callbackUrl: `%SUBMISSION%`,
|
||||
callbackSchema: '["antwoord vraag 1"]',
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const testLearningObjectPnNotebooks: RequiredEntityData<LearningObject> = {
|
||||
hruid: `${getEnvVar(envVars.UserContentPrefix)}pn_werkingnotebooks`,
|
||||
version: 3,
|
||||
language: Language.Dutch,
|
||||
title: "Werken met notebooks",
|
||||
description: "Leren werken met notebooks",
|
||||
keywords: ["Python", "KIKS", "Wiskunde", "STEM", "AI"],
|
||||
title: 'Werken met notebooks',
|
||||
description: 'Leren werken met notebooks',
|
||||
keywords: ['Python', 'KIKS', 'Wiskunde', 'STEM', 'AI'],
|
||||
targetAges: [14, 15, 16, 17, 18],
|
||||
admins: [],
|
||||
copyright: "dwengo",
|
||||
copyright: 'dwengo',
|
||||
educationalGoals: [],
|
||||
license: "dwengo",
|
||||
license: 'dwengo',
|
||||
contentType: DwengoContentType.TEXT_MARKDOWN,
|
||||
difficulty: 3,
|
||||
estimatedTime: 10,
|
||||
uuid: "2adf9929-b424-4650-bf60-186f730d38ab",
|
||||
uuid: '2adf9929-b424-4650-bf60-186f730d38ab',
|
||||
teacherExclusive: false,
|
||||
skosConcepts: [
|
||||
"http://ilearn.ilabt.imec.be/vocab/curr1/s-vaktaal",
|
||||
"http://ilearn.ilabt.imec.be/vocab/curr1/s-digitale-media-en-toepassingen",
|
||||
"http://ilearn.ilabt.imec.be/vocab/curr1/s-computers-en-systemen",
|
||||
'http://ilearn.ilabt.imec.be/vocab/curr1/s-vaktaal',
|
||||
'http://ilearn.ilabt.imec.be/vocab/curr1/s-digitale-media-en-toepassingen',
|
||||
'http://ilearn.ilabt.imec.be/vocab/curr1/s-computers-en-systemen',
|
||||
],
|
||||
attachments: [
|
||||
{
|
||||
name: "dwengo.png",
|
||||
mimeType: "image/png",
|
||||
content: loadTestAsset("/content/learning-object-resources/pn_werkingnotebooks/dwengo.png")
|
||||
name: 'dwengo.png',
|
||||
mimeType: 'image/png',
|
||||
content: loadTestAsset('/content/learning-object-resources/pn_werkingnotebooks/dwengo.png'),
|
||||
},
|
||||
{
|
||||
name: "Knop.png",
|
||||
mimeType: "image/png",
|
||||
content: loadTestAsset("/content/learning-object-resources/pn_werkingnotebooks/Knop.png")
|
||||
}
|
||||
name: 'Knop.png',
|
||||
mimeType: 'image/png',
|
||||
content: loadTestAsset('/content/learning-object-resources/pn_werkingnotebooks/Knop.png'),
|
||||
},
|
||||
],
|
||||
available: false,
|
||||
content: loadTestAsset("/content/learning-object-resources/pn_werkingnotebooks/content.md"),
|
||||
content: loadTestAsset('/content/learning-object-resources/pn_werkingnotebooks/content.md'),
|
||||
returnValue: {
|
||||
callbackUrl: "%SUBMISSION%",
|
||||
callbackSchema: "[]"
|
||||
}
|
||||
}
|
||||
callbackUrl: '%SUBMISSION%',
|
||||
callbackSchema: '[]',
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -24,5 +24,5 @@ export function makeTestStudents(em: EntityManager): Student[] {
|
|||
}
|
||||
|
||||
export function getTestleerling1(): Student {
|
||||
return testStudents.find(it => it.username === "testleerling1");
|
||||
return testStudents.find((it) => it.username === 'testleerling1');
|
||||
}
|
||||
|
|
|
@ -62,4 +62,3 @@ export function getTeacher04(): Teacher {
|
|||
export function getTestleerkracht1(): Teacher {
|
||||
return testleerkracht1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue