style: fix linting issues met Prettier
This commit is contained in:
parent
ba725f67b2
commit
8a55c0f003
22 changed files with 137 additions and 157 deletions
|
@ -5,13 +5,13 @@ import {
|
|||
getAllQuestions,
|
||||
getAnswersByQuestion,
|
||||
getQuestion,
|
||||
getQuestionsAboutLearningObjectInAssignment
|
||||
getQuestionsAboutLearningObjectInAssignment,
|
||||
} from '../services/questions.js';
|
||||
import { FALLBACK_LANG, FALLBACK_SEQ_NUM } from '../config.js';
|
||||
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
|
||||
import { QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question';
|
||||
import { Language } from '@dwengo-1/common/util/language';
|
||||
import {AnswerDTO, AnswerId} from "@dwengo-1/common/interfaces/answer";
|
||||
import { AnswerDTO, AnswerId } from '@dwengo-1/common/interfaces/answer';
|
||||
|
||||
interface QuestionPathParams {
|
||||
hruid: string;
|
||||
|
@ -62,10 +62,10 @@ function getQuestionId<ReqBody, ResBody>(
|
|||
}
|
||||
|
||||
interface GetAllQuestionsQueryParams extends QuestionQueryParams {
|
||||
classId?: string,
|
||||
assignmentId?: number,
|
||||
forStudent?: string,
|
||||
full?: boolean
|
||||
classId?: string;
|
||||
assignmentId?: number;
|
||||
forStudent?: string;
|
||||
full?: boolean;
|
||||
}
|
||||
|
||||
export async function getAllQuestionsHandler(
|
||||
|
@ -118,10 +118,10 @@ export async function getQuestionHandler(
|
|||
}
|
||||
|
||||
interface GetQuestionAnswersQueryParams extends QuestionQueryParams {
|
||||
full: boolean
|
||||
full: boolean;
|
||||
}
|
||||
export async function getQuestionAnswersHandler(
|
||||
req: Request<GetQuestionIdPathParams, {answers: AnswerDTO[] | AnswerId[]}, unknown, GetQuestionAnswersQueryParams>,
|
||||
req: Request<GetQuestionIdPathParams, { answers: AnswerDTO[] | AnswerId[] }, unknown, GetQuestionAnswersQueryParams>,
|
||||
res: Response
|
||||
): Promise<void> {
|
||||
const questionId = getQuestionId(req, res);
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
import { Request, Response } from 'express';
|
||||
import {
|
||||
createSubmission,
|
||||
deleteSubmission,
|
||||
getSubmission,
|
||||
getSubmissionsForLearningObjectAndAssignment
|
||||
} from '../services/submissions.js';
|
||||
import { createSubmission, deleteSubmission, getSubmission, getSubmissionsForLearningObjectAndAssignment } from '../services/submissions.js';
|
||||
import { SubmissionDTO } from '@dwengo-1/common/interfaces/submission';
|
||||
import { Language, languageMap } from '@dwengo-1/common/util/language';
|
||||
import {Submission} from "../entities/assignments/submission.entity";
|
||||
import { Submission } from '../entities/assignments/submission.entity';
|
||||
|
||||
interface SubmissionParams {
|
||||
hruid: string;
|
||||
|
@ -15,27 +10,22 @@ interface SubmissionParams {
|
|||
}
|
||||
|
||||
interface SubmissionQuery {
|
||||
language: string,
|
||||
language: string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
interface SubmissionsQuery extends SubmissionQuery {
|
||||
classId: string,
|
||||
assignmentId: number,
|
||||
studentUsername?: string
|
||||
classId: string;
|
||||
assignmentId: number;
|
||||
studentUsername?: string;
|
||||
}
|
||||
|
||||
export async function getSubmissionsHandler(
|
||||
req: Request<SubmissionParams, Submission[], null, SubmissionsQuery>,
|
||||
res: Response
|
||||
): Promise<void> {
|
||||
export async function getSubmissionsHandler(req: Request<SubmissionParams, Submission[], null, SubmissionsQuery>, res: Response): Promise<void> {
|
||||
const loHruid = req.params.hruid;
|
||||
const lang = languageMap[req.query.language] || Language.Dutch;
|
||||
const version = (req.query.version || 1);
|
||||
const version = req.query.version || 1;
|
||||
|
||||
const submissions = await getSubmissionsForLearningObjectAndAssignment(
|
||||
loHruid, lang, version, req.query.classId, req.query.assignmentId
|
||||
);
|
||||
const submissions = await getSubmissionsForLearningObjectAndAssignment(loHruid, lang, version, req.query.classId, req.query.assignmentId);
|
||||
|
||||
res.json(submissions);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue