From d7ac3cebb62041bb55cb7a94c5672e2c0cba2473 Mon Sep 17 00:00:00 2001 From: Jun Hong Date: Mon, 15 Apr 2024 05:47:54 +0800 Subject: [PATCH] Shift grading service interfaces to types folder --- backend/grading-service/src/services/get-handler.ts | 13 +------------ .../grading-service/src/types/grading-service.d.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/grading-service/src/services/get-handler.ts b/backend/grading-service/src/services/get-handler.ts index a9e9971d..36192268 100644 --- a/backend/grading-service/src/services/get-handler.ts +++ b/backend/grading-service/src/services/get-handler.ts @@ -1,6 +1,6 @@ import NotExistingStudentError from "../libs/errors/NotExistingStudentError"; import db from "../models/db"; -import { Submission } from "../types/grading-service"; +import { Submission, SubmissionInfo, Submitter } from "../types/grading-service"; const getSubmissionsByQuestionIdAndStudentId = async ( questionId: string, @@ -110,12 +110,6 @@ const getLatestSubmissionByQuestionIdAndStudentId = async ( }; }; -interface Submitter { - studentId: number; - name: string; - createdOn: number; -} - const getSubmittersByAssignmentId = async ( assignmentId: string ): Promise => { @@ -161,11 +155,6 @@ const getSubmittersByAssignmentId = async ( }); }; -interface SubmissionInfo { - questionId: string; - createdOn: number; -} - const getSubmissionInfo = async ( assignmentId: string, studentId: number diff --git a/backend/grading-service/src/types/grading-service.d.ts b/backend/grading-service/src/types/grading-service.d.ts index 151b1fab..89ad947e 100644 --- a/backend/grading-service/src/types/grading-service.d.ts +++ b/backend/grading-service/src/types/grading-service.d.ts @@ -8,6 +8,17 @@ export interface Submission { createdOn: number; } +export interface SubmissionInfo { + questionId: string; + createdOn: number; +} + +export interface Submitter { + studentId: number; + name: string; + createdOn: number; +} + export interface Feedback { line: number; hints: string[];