fix: link + exporteren questions
This commit is contained in:
parent
3a44e02970
commit
5e18691c65
1 changed files with 75 additions and 45 deletions
|
@ -1,82 +1,81 @@
|
|||
import { EntityManager } from '@mikro-orm/core';
|
||||
import { Question } from '../../../src/entities/questions/question.entity';
|
||||
import { Language } from '@dwengo-1/common/util/language';
|
||||
import { Student } from '../../../src/entities/users/student.entity';
|
||||
import { Group } from '../../../src/entities/assignments/group.entity';
|
||||
import { getTestleerling1 } from '../users/students.testdata';
|
||||
import { testLearningObjectMultipleChoice } from '../content/learning-objects.testdata';
|
||||
import { getGroup1ConditionalLearningPath } from '../assignments/groups.testdata';
|
||||
import { getDireStraits, getNoordkaap, getTestleerling1, getTool } from '../users/students.testdata';
|
||||
import { testLearningObject01, testLearningObject04, testLearningObject05, testLearningObjectMultipleChoice } from '../content/learning-objects.testdata';
|
||||
import { getGroup1ConditionalLearningPath, getTestGroup01, getTestGroup02 } from '../assignments/groups.testdata';
|
||||
|
||||
export function makeTestQuestions(em: EntityManager, students: Student[], groups: Group[]): Question[] {
|
||||
const question01 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id05',
|
||||
inGroup: groups[0], // Group #1 for Assignment #1 in class 'id01'
|
||||
question01 = em.create(Question, {
|
||||
learningObjectLanguage: testLearningObject05.language,
|
||||
learningObjectVersion: testLearningObject05.version,
|
||||
learningObjectHruid: testLearningObject05.hruid,
|
||||
inGroup: getTestGroup01(), // Group #1 for Assignment #1 in class 'id01'
|
||||
sequenceNumber: 1,
|
||||
author: students[0],
|
||||
author: getNoordkaap(),
|
||||
timestamp: new Date(),
|
||||
content: 'question',
|
||||
});
|
||||
|
||||
const question02 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id05',
|
||||
inGroup: groups[0], // Group #1 for Assignment #1 in class 'id01'
|
||||
question02 = em.create(Question, {
|
||||
learningObjectLanguage: testLearningObject05.language,
|
||||
learningObjectVersion: testLearningObject05.version,
|
||||
learningObjectHruid: testLearningObject05.hruid,
|
||||
inGroup: getTestGroup01(), // Group #1 for Assignment #1 in class 'id01'
|
||||
sequenceNumber: 2,
|
||||
author: students[2],
|
||||
author: getTool(),
|
||||
timestamp: new Date(),
|
||||
content: 'question',
|
||||
});
|
||||
|
||||
const question03 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id04',
|
||||
question03 = em.create(Question, {
|
||||
learningObjectLanguage: testLearningObject04.language,
|
||||
learningObjectVersion: testLearningObject04.version,
|
||||
learningObjectHruid: testLearningObject04.hruid,
|
||||
sequenceNumber: 1,
|
||||
author: students[0],
|
||||
inGroup: groups[0], // Group #1 for Assignment #1 in class 'id01'
|
||||
author: getNoordkaap(),
|
||||
inGroup: getTestGroup01(), // Group #1 for Assignment #1 in class 'id01'
|
||||
timestamp: new Date(),
|
||||
content: 'question',
|
||||
});
|
||||
|
||||
const question04 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id01',
|
||||
question04 = em.create(Question, {
|
||||
learningObjectLanguage: testLearningObject01.language,
|
||||
learningObjectVersion: testLearningObject01.version,
|
||||
learningObjectHruid: testLearningObject01.hruid,
|
||||
sequenceNumber: 1,
|
||||
author: students[1],
|
||||
inGroup: groups[1], // Group #2 for Assignment #1 in class 'id01'
|
||||
author: getDireStraits(),
|
||||
inGroup: getTestGroup02(), // Group #2 for Assignment #1 in class 'id01'
|
||||
timestamp: new Date(),
|
||||
content: 'question',
|
||||
});
|
||||
|
||||
const question05 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id05',
|
||||
question05 = em.create(Question, {
|
||||
learningObjectLanguage: testLearningObject05.language,
|
||||
learningObjectVersion: testLearningObject05.version,
|
||||
learningObjectHruid: testLearningObject05.hruid,
|
||||
sequenceNumber: 3,
|
||||
author: students[1],
|
||||
inGroup: groups[1], // Group #2 for Assignment #1 in class 'id01'
|
||||
author: getDireStraits(),
|
||||
inGroup: getTestGroup02(), // Group #2 for Assignment #1 in class 'id01'
|
||||
timestamp: new Date(),
|
||||
content: 'question',
|
||||
});
|
||||
|
||||
const question06 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id05',
|
||||
question06 = em.create(Question, {
|
||||
learningObjectLanguage: testLearningObject05.language,
|
||||
learningObjectVersion: testLearningObject05.version,
|
||||
learningObjectHruid: testLearningObject05.hruid,
|
||||
sequenceNumber: 4,
|
||||
author: students[2],
|
||||
inGroup: groups[5], // Group #4 for Assignment #2 in class 'id02'
|
||||
author: getTool(),
|
||||
inGroup: getGroup1ConditionalLearningPath(), // Group #4 for Assignment #2 in class 'id02'
|
||||
timestamp: new Date(),
|
||||
content: 'question',
|
||||
});
|
||||
|
||||
question07 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectLanguage: testLearningObjectMultipleChoice.language,
|
||||
learningObjectVersion: testLearningObjectMultipleChoice.version,
|
||||
learningObjectHruid: testLearningObjectMultipleChoice.hruid,
|
||||
sequenceNumber: 1,
|
||||
author: getTestleerling1(),
|
||||
|
@ -86,8 +85,8 @@ export function makeTestQuestions(em: EntityManager, students: Student[], groups
|
|||
});
|
||||
|
||||
question08 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: 1,
|
||||
learningObjectLanguage: testLearningObjectMultipleChoice.language,
|
||||
learningObjectVersion: testLearningObjectMultipleChoice.version,
|
||||
learningObjectHruid: testLearningObjectMultipleChoice.hruid,
|
||||
sequenceNumber: 2,
|
||||
author: getTestleerling1(),
|
||||
|
@ -99,8 +98,39 @@ export function makeTestQuestions(em: EntityManager, students: Student[], groups
|
|||
return [question01, question02, question03, question04, question05, question06, question07, question08];
|
||||
}
|
||||
|
||||
let question08: Question;
|
||||
let question01: Question;
|
||||
let question02: Question;
|
||||
let question03: Question;
|
||||
let question04: Question;
|
||||
let question05: Question;
|
||||
let question06: Question;
|
||||
let question07: Question;
|
||||
let question08: Question;
|
||||
|
||||
export function getQuestion01(): Question {
|
||||
return question01;
|
||||
}
|
||||
|
||||
export function getQuestion02(): Question {
|
||||
return question02;
|
||||
}
|
||||
|
||||
export function getQuestion03(): Question {
|
||||
return question03;
|
||||
}
|
||||
|
||||
export function getQuestion04(): Question {
|
||||
return question04;
|
||||
}
|
||||
|
||||
export function getQuestion05(): Question {
|
||||
return question05;
|
||||
}
|
||||
|
||||
export function getQuestion06(): Question {
|
||||
return question06;
|
||||
}
|
||||
|
||||
|
||||
export function getQuestion07(): Question {
|
||||
return question07;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue