fix(backend): group toch niet deel van primaire sleutel van vragen en submissions gemaakt, maar verplicht veld
This commit is contained in:
		
							parent
							
								
									b1df95da63
								
							
						
					
					
						commit
						7b79348985
					
				
					 10 changed files with 21 additions and 20 deletions
				
			
		|  | @ -37,7 +37,7 @@ export async function setupTestApp(): Promise<void> { | |||
| 
 | ||||
|     learningObjects[1].attachments = attachments; | ||||
| 
 | ||||
|     const questions = makeTestQuestions(em, students); | ||||
|     const questions = makeTestQuestions(em, students, groups); | ||||
|     const answers = makeTestAnswers(em, teachers, questions); | ||||
|     const submissions = makeTestSubmissions(em, students, groups); | ||||
| 
 | ||||
|  |  | |||
|  | @ -34,6 +34,7 @@ export function makeTestSubmissions(em: EntityManager, students: Student[], grou | |||
|         submissionNumber: 1, | ||||
|         submitter: students[0], | ||||
|         submissionTime: new Date(2025, 2, 20), | ||||
|         onBehalfOf: groups[0], | ||||
|         content: '', | ||||
|     }); | ||||
| 
 | ||||
|  | @ -44,6 +45,7 @@ export function makeTestSubmissions(em: EntityManager, students: Student[], grou | |||
|         submissionNumber: 2, | ||||
|         submitter: students[0], | ||||
|         submissionTime: new Date(2025, 2, 25), | ||||
|         onBehalfOf: groups[0], | ||||
|         content: '', | ||||
|     }); | ||||
| 
 | ||||
|  | @ -54,6 +56,7 @@ export function makeTestSubmissions(em: EntityManager, students: Student[], grou | |||
|         submissionNumber: 1, | ||||
|         submitter: students[1], | ||||
|         submissionTime: new Date(2025, 2, 20), | ||||
|         onBehalfOf: groups[1], | ||||
|         content: '', | ||||
|     }); | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,12 +2,14 @@ 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"; | ||||
| 
 | ||||
| export function makeTestQuestions(em: EntityManager, students: Student[]): Question[] { | ||||
| 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], | ||||
|         sequenceNumber: 1, | ||||
|         author: students[0], | ||||
|         timestamp: new Date(), | ||||
|  | @ -18,6 +20,7 @@ export function makeTestQuestions(em: EntityManager, students: Student[]): Quest | |||
|         learningObjectLanguage: Language.English, | ||||
|         learningObjectVersion: 1, | ||||
|         learningObjectHruid: 'id05', | ||||
|         inGroup: groups[0], | ||||
|         sequenceNumber: 2, | ||||
|         author: students[2], | ||||
|         timestamp: new Date(), | ||||
|  | @ -30,6 +33,7 @@ export function makeTestQuestions(em: EntityManager, students: Student[]): Quest | |||
|         learningObjectHruid: 'id04', | ||||
|         sequenceNumber: 1, | ||||
|         author: students[0], | ||||
|         inGroup: groups[0], | ||||
|         timestamp: new Date(), | ||||
|         content: 'question', | ||||
|     }); | ||||
|  | @ -40,6 +44,7 @@ export function makeTestQuestions(em: EntityManager, students: Student[]): Quest | |||
|         learningObjectHruid: 'id01', | ||||
|         sequenceNumber: 1, | ||||
|         author: students[1], | ||||
|         inGroup: groups[1], | ||||
|         timestamp: new Date(), | ||||
|         content: 'question', | ||||
|     }); | ||||
|  |  | |||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger