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 { EntityManager } from '@mikro-orm/core'; | ||||||
| import { Question } from '../../../src/entities/questions/question.entity'; | 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 { Student } from '../../../src/entities/users/student.entity'; | ||||||
| import { Group } from '../../../src/entities/assignments/group.entity'; | import { Group } from '../../../src/entities/assignments/group.entity'; | ||||||
| import { getTestleerling1 } from '../users/students.testdata'; | import { getDireStraits, getNoordkaap, getTestleerling1, getTool } from '../users/students.testdata'; | ||||||
| import { testLearningObjectMultipleChoice } from '../content/learning-objects.testdata'; | import { testLearningObject01, testLearningObject04, testLearningObject05, testLearningObjectMultipleChoice } from '../content/learning-objects.testdata'; | ||||||
| import { getGroup1ConditionalLearningPath } from '../assignments/groups.testdata'; | import { getGroup1ConditionalLearningPath, getTestGroup01, getTestGroup02 } from '../assignments/groups.testdata'; | ||||||
| 
 | 
 | ||||||
| export function makeTestQuestions(em: EntityManager, students: Student[], groups: Group[]): Question[] { | export function makeTestQuestions(em: EntityManager, students: Student[], groups: Group[]): Question[] { | ||||||
|     const question01 = em.create(Question, { |     question01 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObject05.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObject05.version, | ||||||
|         learningObjectHruid: 'id05', |         learningObjectHruid: testLearningObject05.hruid, | ||||||
|         inGroup: groups[0], // Group #1 for Assignment #1 in class 'id01'
 |         inGroup: getTestGroup01(), // Group #1 for Assignment #1 in class 'id01'
 | ||||||
|         sequenceNumber: 1, |         sequenceNumber: 1, | ||||||
|         author: students[0], |         author: getNoordkaap(), | ||||||
|         timestamp: new Date(), |         timestamp: new Date(), | ||||||
|         content: 'question', |         content: 'question', | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     const question02 = em.create(Question, { |     question02 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObject05.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObject05.version, | ||||||
|         learningObjectHruid: 'id05', |         learningObjectHruid: testLearningObject05.hruid, | ||||||
|         inGroup: groups[0], // Group #1 for Assignment #1 in class 'id01'
 |         inGroup: getTestGroup01(), // Group #1 for Assignment #1 in class 'id01'
 | ||||||
|         sequenceNumber: 2, |         sequenceNumber: 2, | ||||||
|         author: students[2], |         author: getTool(), | ||||||
|         timestamp: new Date(), |         timestamp: new Date(), | ||||||
|         content: 'question', |         content: 'question', | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     const question03 = em.create(Question, { |     question03 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObject04.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObject04.version, | ||||||
|         learningObjectHruid: 'id04', |         learningObjectHruid: testLearningObject04.hruid, | ||||||
|         sequenceNumber: 1, |         sequenceNumber: 1, | ||||||
|         author: students[0], |         author: getNoordkaap(), | ||||||
|         inGroup: groups[0], // Group #1 for Assignment #1 in class 'id01'
 |         inGroup: getTestGroup01(), // Group #1 for Assignment #1 in class 'id01'
 | ||||||
|         timestamp: new Date(), |         timestamp: new Date(), | ||||||
|         content: 'question', |         content: 'question', | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     const question04 = em.create(Question, { |     question04 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObject01.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObject01.version, | ||||||
|         learningObjectHruid: 'id01', |         learningObjectHruid: testLearningObject01.hruid, | ||||||
|         sequenceNumber: 1, |         sequenceNumber: 1, | ||||||
|         author: students[1], |         author: getDireStraits(), | ||||||
|         inGroup: groups[1], // Group #2 for Assignment #1 in class 'id01'
 |         inGroup: getTestGroup02(), // Group #2 for Assignment #1 in class 'id01'
 | ||||||
|         timestamp: new Date(), |         timestamp: new Date(), | ||||||
|         content: 'question', |         content: 'question', | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     const question05 = em.create(Question, { |     question05 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObject05.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObject05.version, | ||||||
|         learningObjectHruid: 'id05', |         learningObjectHruid: testLearningObject05.hruid, | ||||||
|         sequenceNumber: 3, |         sequenceNumber: 3, | ||||||
|         author: students[1], |         author: getDireStraits(), | ||||||
|         inGroup: groups[1], // Group #2 for Assignment #1 in class 'id01'
 |         inGroup: getTestGroup02(), // Group #2 for Assignment #1 in class 'id01'
 | ||||||
|         timestamp: new Date(), |         timestamp: new Date(), | ||||||
|         content: 'question', |         content: 'question', | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     const question06 = em.create(Question, { |     question06 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObject05.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObject05.version, | ||||||
|         learningObjectHruid: 'id05', |         learningObjectHruid: testLearningObject05.hruid, | ||||||
|         sequenceNumber: 4, |         sequenceNumber: 4, | ||||||
|         author: students[2], |         author: getTool(), | ||||||
|         inGroup: groups[5], // Group #4 for Assignment #2 in class 'id02'
 |         inGroup: getGroup1ConditionalLearningPath(), // Group #4 for Assignment #2 in class 'id02'
 | ||||||
|         timestamp: new Date(), |         timestamp: new Date(), | ||||||
|         content: 'question', |         content: 'question', | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     question07 = em.create(Question, { |     question07 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObjectMultipleChoice.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObjectMultipleChoice.version, | ||||||
|         learningObjectHruid: testLearningObjectMultipleChoice.hruid, |         learningObjectHruid: testLearningObjectMultipleChoice.hruid, | ||||||
|         sequenceNumber: 1, |         sequenceNumber: 1, | ||||||
|         author: getTestleerling1(), |         author: getTestleerling1(), | ||||||
|  | @ -86,8 +85,8 @@ export function makeTestQuestions(em: EntityManager, students: Student[], groups | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     question08 = em.create(Question, { |     question08 = em.create(Question, { | ||||||
|         learningObjectLanguage: Language.English, |         learningObjectLanguage: testLearningObjectMultipleChoice.language, | ||||||
|         learningObjectVersion: 1, |         learningObjectVersion: testLearningObjectMultipleChoice.version, | ||||||
|         learningObjectHruid: testLearningObjectMultipleChoice.hruid, |         learningObjectHruid: testLearningObjectMultipleChoice.hruid, | ||||||
|         sequenceNumber: 2, |         sequenceNumber: 2, | ||||||
|         author: getTestleerling1(), |         author: getTestleerling1(), | ||||||
|  | @ -99,8 +98,39 @@ export function makeTestQuestions(em: EntityManager, students: Student[], groups | ||||||
|     return [question01, question02, question03, question04, question05, question06, question07, question08]; |     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 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 { | export function getQuestion07(): Question { | ||||||
|     return question07; |     return question07; | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 laurejablonski
						laurejablonski