Skip to content

Commit

Permalink
Shift grading service interfaces to types folder
Browse files Browse the repository at this point in the history
  • Loading branch information
junhonglow committed Apr 14, 2024
1 parent bc9d1d9 commit d7ac3ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 1 addition & 12 deletions backend/grading-service/src/services/get-handler.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -110,12 +110,6 @@ const getLatestSubmissionByQuestionIdAndStudentId = async (
};
};

interface Submitter {
studentId: number;
name: string;
createdOn: number;
}

const getSubmittersByAssignmentId = async (
assignmentId: string
): Promise<Submitter[] | null> => {
Expand Down Expand Up @@ -161,11 +155,6 @@ const getSubmittersByAssignmentId = async (
});
};

interface SubmissionInfo {
questionId: string;
createdOn: number;
}

const getSubmissionInfo = async (
assignmentId: string,
studentId: number
Expand Down
11 changes: 11 additions & 0 deletions backend/grading-service/src/types/grading-service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down

0 comments on commit d7ac3ce

Please sign in to comment.