fix: import errors van gabe gefixt, teacher en student abstractie weggedaan
This commit is contained in:
parent
6404335040
commit
b5390258e3
36 changed files with 9754 additions and 180 deletions
|
@ -32,7 +32,7 @@ describe('SubmissionRepository', () => {
|
|||
});
|
||||
|
||||
it('should find the requested submission', async () => {
|
||||
const id = new LearningObjectIdentifier('id03', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id03', Language.English, 1);
|
||||
const submission = await submissionRepository.findSubmissionByLearningObjectAndSubmissionNumber(id, 1);
|
||||
|
||||
expect(submission).toBeTruthy();
|
||||
|
@ -40,7 +40,7 @@ describe('SubmissionRepository', () => {
|
|||
});
|
||||
|
||||
it('should find the most recent submission for a student', async () => {
|
||||
const id = new LearningObjectIdentifier('id02', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id02', Language.English, 1);
|
||||
const student = await studentRepository.findByUsername('Noordkaap');
|
||||
const submission = await submissionRepository.findMostRecentSubmissionForStudent(id, student!);
|
||||
|
||||
|
@ -49,7 +49,7 @@ describe('SubmissionRepository', () => {
|
|||
});
|
||||
|
||||
it('should find the most recent submission for a group', async () => {
|
||||
const id = new LearningObjectIdentifier('id03', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id03', Language.English, 1);
|
||||
const class_ = await classRepository.findById('id01');
|
||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 1);
|
||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 1);
|
||||
|
@ -60,7 +60,7 @@ describe('SubmissionRepository', () => {
|
|||
});
|
||||
|
||||
it('should not find a deleted submission', async () => {
|
||||
const id = new LearningObjectIdentifier('id01', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id01', Language.English, 1);
|
||||
await submissionRepository.deleteSubmissionByLearningObjectAndSubmissionNumber(id, 1);
|
||||
|
||||
const submission = await submissionRepository.findSubmissionByLearningObjectAndSubmissionNumber(id, 1);
|
||||
|
|
|
@ -17,11 +17,11 @@ describe('AttachmentRepository', () => {
|
|||
});
|
||||
|
||||
it('should return the requested attachment', async () => {
|
||||
const id = new LearningObjectIdentifier('id02', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id02', Language.English, 1);
|
||||
const learningObject = await learningObjectRepository.findByIdentifier(id);
|
||||
|
||||
const attachment = await attachmentRepository.findByMostRecentVersionOfLearningObjectAndName(
|
||||
learningObject!,
|
||||
learningObject!.hruid,
|
||||
Language.English,
|
||||
'attachment01'
|
||||
);
|
||||
|
|
|
@ -13,8 +13,8 @@ describe('LearningObjectRepository', () => {
|
|||
learningObjectRepository = getLearningObjectRepository();
|
||||
});
|
||||
|
||||
const id01 = new LearningObjectIdentifier('id01', Language.English, '1');
|
||||
const id02 = new LearningObjectIdentifier('test_id', Language.English, '1');
|
||||
const id01 = new LearningObjectIdentifier('id01', Language.English, 1);
|
||||
const id02 = new LearningObjectIdentifier('test_id', Language.English, 1);
|
||||
|
||||
it('should return the learning object that matches identifier 1', async () => {
|
||||
const learningObject = await learningObjectRepository.findByIdentifier(id01);
|
||||
|
|
|
@ -20,7 +20,7 @@ describe('AnswerRepository', () => {
|
|||
});
|
||||
|
||||
it('should find all answers to a question', async () => {
|
||||
const id = new LearningObjectIdentifier('id05', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id05', Language.English, 1);
|
||||
const questions = await questionRepository.findAllQuestionsAboutLearningObject(id);
|
||||
|
||||
const question = questions.filter((it) => it.sequenceNumber == 2)[0];
|
||||
|
@ -35,7 +35,7 @@ describe('AnswerRepository', () => {
|
|||
|
||||
it('should create an answer to a question', async () => {
|
||||
const teacher = await teacherRepository.findByUsername('FooFighters');
|
||||
const id = new LearningObjectIdentifier('id05', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id05', Language.English, 1);
|
||||
const questions = await questionRepository.findAllQuestionsAboutLearningObject(id);
|
||||
|
||||
const question = questions[0];
|
||||
|
@ -54,7 +54,7 @@ describe('AnswerRepository', () => {
|
|||
});
|
||||
|
||||
it('should not find a removed answer', async () => {
|
||||
const id = new LearningObjectIdentifier('id04', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id04', Language.English, 1);
|
||||
const questions = await questionRepository.findAllQuestionsAboutLearningObject(id);
|
||||
|
||||
await answerRepository.removeAnswerByQuestionAndSequenceNumber(questions[0], 1);
|
||||
|
|
|
@ -20,7 +20,7 @@ describe('QuestionRepository', () => {
|
|||
});
|
||||
|
||||
it('should return all questions part of the given learning object', async () => {
|
||||
const id = new LearningObjectIdentifier('id05', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id05', Language.English, 1);
|
||||
const questions = await questionRepository.findAllQuestionsAboutLearningObject(id);
|
||||
|
||||
expect(questions).toBeTruthy();
|
||||
|
@ -28,7 +28,7 @@ describe('QuestionRepository', () => {
|
|||
});
|
||||
|
||||
it('should create new question', async () => {
|
||||
const id = new LearningObjectIdentifier('id03', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id03', Language.English, 1);
|
||||
const student = await studentRepository.findByUsername('Noordkaap');
|
||||
await questionRepository.createQuestion({
|
||||
loId: id,
|
||||
|
@ -42,7 +42,7 @@ describe('QuestionRepository', () => {
|
|||
});
|
||||
|
||||
it('should not find removed question', async () => {
|
||||
const id = new LearningObjectIdentifier('id04', Language.English, '1');
|
||||
const id = new LearningObjectIdentifier('id04', Language.English, 1);
|
||||
await questionRepository.removeQuestionByLearningObjectAndSequenceNumber(id, 1);
|
||||
|
||||
const question = await questionRepository.findAllQuestionsAboutLearningObject(id);
|
||||
|
|
|
@ -12,7 +12,7 @@ export function makeTestSubmissions(
|
|||
const submission01 = em.create(Submission, {
|
||||
learningObjectHruid: 'id03',
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
submissionNumber: 1,
|
||||
submitter: students[0],
|
||||
submissionTime: new Date(2025, 2, 20),
|
||||
|
@ -23,7 +23,7 @@ export function makeTestSubmissions(
|
|||
const submission02 = em.create(Submission, {
|
||||
learningObjectHruid: 'id03',
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
submissionNumber: 2,
|
||||
submitter: students[0],
|
||||
submissionTime: new Date(2025, 2, 25),
|
||||
|
@ -34,7 +34,7 @@ export function makeTestSubmissions(
|
|||
const submission03 = em.create(Submission, {
|
||||
learningObjectHruid: 'id02',
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
submissionNumber: 1,
|
||||
submitter: students[0],
|
||||
submissionTime: new Date(2025, 2, 20),
|
||||
|
@ -44,7 +44,7 @@ export function makeTestSubmissions(
|
|||
const submission04 = em.create(Submission, {
|
||||
learningObjectHruid: 'id02',
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
submissionNumber: 2,
|
||||
submitter: students[0],
|
||||
submissionTime: new Date(2025, 2, 25),
|
||||
|
@ -54,7 +54,7 @@ export function makeTestSubmissions(
|
|||
const submission05 = em.create(Submission, {
|
||||
learningObjectHruid: 'id01',
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
submissionNumber: 1,
|
||||
submitter: students[1],
|
||||
submissionTime: new Date(2025, 2, 20),
|
||||
|
|
|
@ -77,7 +77,7 @@ export function makeTestLearningPaths(em: EntityManager<IDatabaseDriver<Connecti
|
|||
admins: [],
|
||||
title: 'repertoire Tool',
|
||||
description: 'all about Tool',
|
||||
image: '',
|
||||
image: null,
|
||||
nodes: nodes01,
|
||||
});
|
||||
|
||||
|
@ -92,7 +92,7 @@ export function makeTestLearningPaths(em: EntityManager<IDatabaseDriver<Connecti
|
|||
admins: [],
|
||||
title: 'repertoire Dire Straits',
|
||||
description: 'all about Dire Straits',
|
||||
image: '',
|
||||
image: null,
|
||||
nodes: nodes02,
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Student } from '../../../src/entities/users/student.entity';
|
|||
export function makeTestQuestions(em: EntityManager<IDatabaseDriver<Connection>>, students: Array<Student>): Array<Question> {
|
||||
const question01 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id05',
|
||||
sequenceNumber: 1,
|
||||
author: students[0],
|
||||
|
@ -16,7 +16,7 @@ export function makeTestQuestions(em: EntityManager<IDatabaseDriver<Connection>>
|
|||
|
||||
const question02 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id05',
|
||||
sequenceNumber: 2,
|
||||
author: students[2],
|
||||
|
@ -26,7 +26,7 @@ export function makeTestQuestions(em: EntityManager<IDatabaseDriver<Connection>>
|
|||
|
||||
const question03 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id04',
|
||||
sequenceNumber: 1,
|
||||
author: students[0],
|
||||
|
@ -36,7 +36,7 @@ export function makeTestQuestions(em: EntityManager<IDatabaseDriver<Connection>>
|
|||
|
||||
const question04 = em.create(Question, {
|
||||
learningObjectLanguage: Language.English,
|
||||
learningObjectVersion: '1',
|
||||
learningObjectVersion: 1,
|
||||
learningObjectHruid: 'id01',
|
||||
sequenceNumber: 1,
|
||||
author: students[1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue