refactor(backend): naming-convention

This commit is contained in:
Tibo De Peuter 2025-03-22 17:38:10 +01:00
parent 14e1508d00
commit 7a286f5650
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
23 changed files with 78 additions and 62 deletions

View file

@ -3,7 +3,7 @@ import { LearningObject } from '../../../../src/entities/content/learning-object
import { Language } from '../../../../src/entities/content/language';
import { loadTestAsset } from '../../../test-utils/load-test-asset';
import { DwengoContentType } from '../../../../src/services/learning-objects/processing/content-type';
import { EnvVars, getEnvVar } from '../../../../src/util/envvars';
import { envVars, getEnvVar } from '../../../../src/util/envVars';
/**
* Create a dummy learning object to be used in tests where multiple learning objects are needed (for example for use
@ -13,7 +13,7 @@ export function dummyLearningObject(hruid: string, language: Language, title: st
return {
createLearningObject: () => {
const learningObject = new LearningObject();
learningObject.hruid = getEnvVar(EnvVars.UserContentPrefix) + hruid;
learningObject.hruid = getEnvVar(envVars.UserContentPrefix) + hruid;
learningObject.language = language;
learningObject.version = 1;
learningObject.title = title;

View file

@ -4,14 +4,14 @@ import { DwengoContentType } from '../../../../src/services/learning-objects/pro
import { loadTestAsset } from '../../../test-utils/load-test-asset';
import { EducationalGoal, LearningObject, ReturnValue } from '../../../../src/entities/content/learning-object.entity';
import { Attachment } from '../../../../src/entities/content/attachment.entity';
import { EnvVars, getEnvVar } from '../../../../src/util/envvars';
import { envVars, getEnvVar } from '../../../../src/util/envVars';
const ASSETS_PREFIX = 'learning-objects/pn-werkingnotebooks/';
const example: LearningObjectExample = {
createLearningObject: () => {
const learningObject = new LearningObject();
learningObject.hruid = `${getEnvVar(EnvVars.UserContentPrefix)}pn_werkingnotebooks`;
learningObject.hruid = `${getEnvVar(envVars.UserContentPrefix)}pn_werkingnotebooks`;
learningObject.version = 3;
learningObject.language = Language.Dutch;
learningObject.title = 'Werken met notebooks';

View file

@ -1,14 +1,14 @@
import { LearningObjectExample } from '../learning-object-example';
import { LearningObject } from '../../../../src/entities/content/learning-object.entity';
import { loadTestAsset } from '../../../test-utils/load-test-asset';
import { EnvVars, getEnvVar } from '../../../../src/util/envvars';
import { envVars, getEnvVar } from '../../../../src/util/envVars';
import { Language } from '../../../../src/entities/content/language';
import { DwengoContentType } from '../../../../src/services/learning-objects/processing/content-type';
const example: LearningObjectExample = {
createLearningObject: () => {
const learningObject = new LearningObject();
learningObject.hruid = `${getEnvVar(EnvVars.UserContentPrefix)}test_essay`;
learningObject.hruid = `${getEnvVar(envVars.UserContentPrefix)}test_essay`;
learningObject.language = Language.English;
learningObject.version = 1;
learningObject.title = 'Essay question for testing';

View file

@ -1,14 +1,14 @@
import { LearningObjectExample } from '../learning-object-example';
import { LearningObject } from '../../../../src/entities/content/learning-object.entity';
import { loadTestAsset } from '../../../test-utils/load-test-asset';
import { EnvVars, getEnvVar } from '../../../../src/util/envvars';
import { envVars, getEnvVar } from '../../../../src/util/envVars';
import { Language } from '../../../../src/entities/content/language';
import { DwengoContentType } from '../../../../src/services/learning-objects/processing/content-type';
const example: LearningObjectExample = {
createLearningObject: () => {
const learningObject = new LearningObject();
learningObject.hruid = `${getEnvVar(EnvVars.UserContentPrefix)}test_multiple_choice`;
learningObject.hruid = `${getEnvVar(envVars.UserContentPrefix)}test_multiple_choice`;
learningObject.language = Language.English;
learningObject.version = 1;
learningObject.title = 'Multiple choice question for testing';

View file

@ -1,6 +1,6 @@
import { LearningPath } from '../../../src/entities/content/learning-path.entity';
import { Language } from '../../../src/entities/content/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);

View file

@ -4,7 +4,7 @@ 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 = {
branchingObject: LearningObject;
@ -15,7 +15,7 @@ export type ConditionTestLearningPathAndLearningObjects = {
export function createConditionTestLearningPathAndLearningObjects() {
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,
};