fix: bug gefixt bij zoeken naar items in databank
This commit is contained in:
parent
1a344088ab
commit
10749012c6
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createGroup, deleteGroup, getAllGroups, getGroup, getGroupSubmissions, putGroup } from '../services/groups.js';
|
||||
import { createGroup, deleteGroup, getAllGroups, getGroup, getGroupQuestions, getGroupSubmissions, putGroup } from '../services/groups.js';
|
||||
import { GroupDTO } from '@dwengo-1/common/interfaces/group';
|
||||
import { requireFields } from './error-helper.js';
|
||||
import { BadRequestException } from '../exceptions/bad-request-exception.js';
|
||||
|
|
|
@ -62,9 +62,7 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
|
|||
|
||||
public async findAllByAssignment(assignment: Assignment): Promise<Question[]> {
|
||||
return this.find({
|
||||
inGroup: {
|
||||
$contained: assignment.groups,
|
||||
},
|
||||
inGroup: assignment.groups.getItems(),
|
||||
learningObjectHruid: assignment.learningPathHruid,
|
||||
learningObjectLanguage: assignment.learningPathLanguage,
|
||||
});
|
||||
|
|
|
@ -134,6 +134,8 @@ export async function getAssignmentsSubmissions(
|
|||
export async function getAssignmentsQuestions(classid: string, assignmentNumber: number, full: boolean): Promise<QuestionDTO[] | QuestionId[]> {
|
||||
const assignment = await fetchAssignment(classid, assignmentNumber);
|
||||
|
||||
console.log(assignment);
|
||||
|
||||
const questionRepository = getQuestionRepository();
|
||||
const questions = await questionRepository.findAllByAssignment(assignment);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue