diff --git a/Frontend/grader-frontend/src/app/globals.css b/Frontend/grader-frontend/src/app/globals.css
index bd8c3d51..225c5bfd 100644
--- a/Frontend/grader-frontend/src/app/globals.css
+++ b/Frontend/grader-frontend/src/app/globals.css
@@ -135,6 +135,10 @@
font-family: var(--font-sans);
}
+.Chip{
+ @apply px-2 py-1 bg-pink-100 ring ring-primary rounded-md text-sm
+}
+
@layer base {
:root {
--sidebar: oklch(0.985 0 0);
@@ -146,4 +150,8 @@
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
+}
+
+button {
+ cursor: pointer;
}
\ No newline at end of file
diff --git a/Frontend/grader-frontend/src/app/instructor/class/[class_id]/assignments/[assignment_id]/submissions/[submissions_id]/page.tsx b/Frontend/grader-frontend/src/app/instructor/class/[class_id]/assignments/[assignment_id]/submissions/[submissions_id]/page.tsx
new file mode 100644
index 00000000..b6ade29d
--- /dev/null
+++ b/Frontend/grader-frontend/src/app/instructor/class/[class_id]/assignments/[assignment_id]/submissions/[submissions_id]/page.tsx
@@ -0,0 +1,56 @@
+'use client'
+import { NavSub } from "@/components/page/submissions/navigate"
+import { HeaderSub } from "@/components/page/submissions/header";
+import { CodeSection } from "@/components/page/submissions/codeSection";
+import { CommentScreenSection } from "@/components/page/submissions/comment/screen";
+import { FormInputComment,FeedbackFormData } from "@/components/page/submissions/comment/formInput";
+import dayjs from "dayjs";
+import { mockComments } from "@/variables/page/submissions/mockComment";
+import { useState } from "react";
+
+export default function Page({ params }: { params: Promise<{ submissions_id: string; }>; }) {
+ const [code, setCode] = useState("# Write your Python code here\nprint('Hello, World!')");
+ function DayFormat(date:number){
+ return dayjs.unix(date).format('DD MMMM YYYY HH:mm');
+ }
+ const formattedComments = mockComments.map(comment => ({
+ ...comment,
+ date: DayFormat(parseInt(comment.date))
+ }));
+
+ const ProfileData = {
+ image: 'https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg',
+ name: "Alex Chen",
+ lab:1,
+ question: "Question 1: Median of Two Sorted Arrays",
+ date: DayFormat(parseInt("1703721600")),
+ score:20,
+ maxScore: 100
+ }
+ // mock นะจะ
+ const handleFeedbackSubmit = async (data: FeedbackFormData) => {
+ console.log('Submitting feedback:', data.comment)
+ await fetch('/api/feedback', {
+ method: 'POST',
+ body: JSON.stringify(data)
+ })
+ }
+
+ return(
+
+
console.log("awdwad")} />
+
+
+ )
+}
diff --git a/Frontend/grader-frontend/src/components/page/submissions/codeSection.tsx b/Frontend/grader-frontend/src/components/page/submissions/codeSection.tsx
new file mode 100644
index 00000000..8c3b4a41
--- /dev/null
+++ b/Frontend/grader-frontend/src/components/page/submissions/codeSection.tsx
@@ -0,0 +1,33 @@
+'use client'
+import { Button } from "@/components/ui/button";
+import Editor from "@monaco-editor/react";
+
+export function CodeSection({code, setCode, language}:{code:string, setCode:(data:string) => void, language:string}) {
+ return (
+
+
+
+
+
+ setCode(value || "")}
+ theme="light"
+ options={{
+ readOnly: true,
+ minimap: { enabled: false },
+ fontSize: 14,
+ lineNumbers: "on",
+ scrollBeyondLastLine: false,
+ automaticLayout: true,
+ wordWrap: "on",
+ }}
+ />
+
+
+ );
+}
\ No newline at end of file
diff --git a/Frontend/grader-frontend/src/components/page/submissions/comment/formInput.tsx b/Frontend/grader-frontend/src/components/page/submissions/comment/formInput.tsx
new file mode 100644
index 00000000..6701fcb1
--- /dev/null
+++ b/Frontend/grader-frontend/src/components/page/submissions/comment/formInput.tsx
@@ -0,0 +1,59 @@
+'use client'
+import { useForm } from "react-hook-form"
+import { Button } from "@/components/ui/button"
+import { Textarea } from "@/components/ui/textarea"
+
+interface FeedbackFormData {
+ comment: string
+}
+
+interface FormInputCommentProps {
+ onSubmit: (data: FeedbackFormData) => Promise | void
+}
+
+export function FormInputComment({ onSubmit }: FormInputCommentProps) {
+ const {
+ register,
+ handleSubmit,
+ formState: { errors, isSubmitting },
+ reset
+ } = useForm()
+
+ const handleFormSubmit = async (data: FeedbackFormData) => {
+ try {
+ await onSubmit(data)
+ reset()
+ } catch (error) {
+ console.error('Error submitting feedback:', error)
+ }
+ }
+
+ return(
+
+ )
+}
+
+export type { FeedbackFormData }
\ No newline at end of file
diff --git a/Frontend/grader-frontend/src/components/page/submissions/comment/screen.tsx b/Frontend/grader-frontend/src/components/page/submissions/comment/screen.tsx
new file mode 100644
index 00000000..17b4fd39
--- /dev/null
+++ b/Frontend/grader-frontend/src/components/page/submissions/comment/screen.tsx
@@ -0,0 +1,46 @@
+'use client'
+import { Button } from "@/components/ui/button";
+import dayjs from "dayjs";
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarImage,
+} from "@/components/ui/avatar"
+
+export function CommentScreenSection({data}: {data:CommentType[]}){
+ return(
+
+ {data.map(( item, index) => (
+
+ ))}
+
+ )
+}
+
+interface CommentType{
+ teacher: boolean;
+ comment: string;
+ name: string;
+ date: string;
+ image: string;
+}
+
+function Comment({ data }: { data:CommentType }) {
+ return(
+
+
+
+
+ {data.teacher ? 'TS': "ST"}
+
+
+ {data.name}
+ {data.date}
+
+
+
+ {data.comment}
+
+
+ )
+}
\ No newline at end of file
diff --git a/Frontend/grader-frontend/src/components/page/submissions/header.tsx b/Frontend/grader-frontend/src/components/page/submissions/header.tsx
new file mode 100644
index 00000000..45ab0649
--- /dev/null
+++ b/Frontend/grader-frontend/src/components/page/submissions/header.tsx
@@ -0,0 +1,39 @@
+'use client'
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarImage,
+} from "@/components/ui/avatar"
+
+interface HeaderType{
+ image:string;
+ name:string;
+ lab:number;
+ question:string;
+ date:string;
+ score:number;
+ maxScore: number;
+}
+
+export function HeaderSub({data}:{data:HeaderType}) {
+ return(
+
+
+
+
+ ST
+
+
{data.name}
+
+
+ Lab {data.lab} / {data.question}
+ Submited {data.date}
+
+
+
+ {data.score}/{data.maxScore}
+
+
+
+ )
+}
diff --git a/Frontend/grader-frontend/src/components/page/submissions/navigate.tsx b/Frontend/grader-frontend/src/components/page/submissions/navigate.tsx
new file mode 100644
index 00000000..1693a95e
--- /dev/null
+++ b/Frontend/grader-frontend/src/components/page/submissions/navigate.tsx
@@ -0,0 +1,19 @@
+'use client'
+import { Button } from "@/components/ui/button"
+import { CircleArrowLeft } from "lucide-react";
+import { useRouter } from "next/navigation";
+
+export function NavSub({ onClickSV } : {onClickSV:() => void}) {
+ const router = useRouter()
+ return(
+
+
+
+
+ )
+}
diff --git a/Frontend/grader-frontend/src/variables/page/submissions/mockComment.ts b/Frontend/grader-frontend/src/variables/page/submissions/mockComment.ts
new file mode 100644
index 00000000..16330597
--- /dev/null
+++ b/Frontend/grader-frontend/src/variables/page/submissions/mockComment.ts
@@ -0,0 +1,44 @@
+export const mockComments = [
+ {
+ teacher: true,
+ comment: "Great work on your project! Your attention to detail really shows. Keep up the excellent progress.",
+ name: "Dr. Sarah Mitchell",
+ date: "1703721600",
+ image: "https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg"
+ },
+ {
+ teacher: false,
+ comment: "Thanks for the feedback! I really appreciate the guidance on the last assignment.",
+ name: "Alex Chen",
+ date: "1703808000",
+ image: "https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg"
+ },
+ {
+ teacher: true,
+ comment: "Remember to submit your homework by Friday. Also, please review chapter 5 before our next class.",
+ name: "Prof. James Wilson",
+ date: "1703894400",
+ image: "https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg"
+ },
+ {
+ teacher: false,
+ comment: "Can we schedule a meeting to discuss the upcoming exam? I have a few questions about the material.",
+ name: "Maria Rodriguez",
+ date: "1703980800",
+ image: "https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg"
+ },
+ {
+ teacher: true,
+ comment: "Your presentation was outstanding! You demonstrated excellent understanding of the concepts.",
+ name: "Dr. Emily Thompson",
+ date: "1704067200",
+ image: "https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg"
+ },
+ {
+ teacher: false,
+ comment: "I'm struggling with the lab assignment. Could you provide some additional resources?",
+ name: "David Park",
+ date: "1704153600",
+ image: "https://i.pinimg.com/736x/f3/ec/94/f3ec94635f2365e3de3782de0aadbe76.jpg"
+ }
+];
\ No newline at end of file
diff --git a/Frontend/grader-frontend/tsconfig.json b/Frontend/grader-frontend/tsconfig.json
index eb4ef8fc..eafdd7b2 100644
--- a/Frontend/grader-frontend/tsconfig.json
+++ b/Frontend/grader-frontend/tsconfig.json
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "ES2017",
- "lib": ["dom", "dom.iterable", "esnext"],
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -11,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
- "jsx": "preserve",
+ "jsx": "react-jsx",
"incremental": true,
"plugins": [
{
@@ -19,9 +23,20 @@
}
],
"paths": {
- "@/*": ["./src/*"]
+ "@/*": [
+ "./src/*"
+ ]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
- "exclude": ["node_modules", "src/lib/api/generated/**"]
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx",
+ ".next/types/**/*.ts",
+ ".next/dev/types/**/*.ts"
+ ],
+ "exclude": [
+ "node_modules",
+ "src/lib/api/generated/**"
+ ]
}