Skip to content

Commit

Permalink
Merge pull request #15 from team-inu/development
Browse files Browse the repository at this point in the history
Fix coures porfoilo page and add percentage description
  • Loading branch information
Porping committed Mar 22, 2024
2 parents 4631d72 + 2f24510 commit 052e46a
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 44 deletions.
2 changes: 1 addition & 1 deletion app/(main)/graduation/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const GraduationPage = () => {
lastName: 'Doe',
workPlace: 'jo',
year: 2556,
remarks: 'ตาย',
remarks: '',
},
]}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand Down Expand Up @@ -132,6 +133,10 @@ const AssignmentEdotDialog: React.FC<StudentEdotDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Expected passing student percentage</FormLabel>
<FormDescription>
% of how many students need to pass this assignment for it
to succeed
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} type="number" min={0} max={100} />
Expand All @@ -147,6 +152,10 @@ const AssignmentEdotDialog: React.FC<StudentEdotDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Expected score percentage</FormLabel>
<FormDescription>
% of score of max score a student needed to pass this
assignment
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} type="number" min={0} max={100} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand Down Expand Up @@ -146,6 +147,10 @@ const AssignmentAddDialog: React.FC<StudentAddDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Expected passing student percentage</FormLabel>
<FormDescription>
% of how many students need to pass this assignment for it
to succeed
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} type="number" min={0} max={100} />
Expand All @@ -161,6 +166,10 @@ const AssignmentAddDialog: React.FC<StudentAddDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Expected score percentage</FormLabel>
<FormDescription>
% of score of max score a student needed to pass this
assignment
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} type="number" min={0} max={100} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const CreateCourseHeader = () => {
<div className="pt-6">
<Breadcrumb>
<BreadcrumbItem>
<BreadcrumbLink href={'http://localhost:3000/course'}>
Courses
</BreadcrumbLink>
<BreadcrumbLink href={'/course'}>Courses</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbItem isCurrentPage>
<BreadcrumbLink>Create course</BreadcrumbLink>
Expand Down
4 changes: 4 additions & 0 deletions components/features/course/course-form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CourseFormGrade from '@/components/features/course/course-form/form-grade
import Loading from '@/components/features/loading-screen';
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand Down Expand Up @@ -186,6 +187,9 @@ const CourseForm = () => {
render={({ field }) => (
<FormItem>
<FormLabel>Expected Passing CLO Percentage</FormLabel>
<FormDescription>
% of how many CLOs a student need to pass to pass each PLO and PO
</FormDescription>
<FormControl>
<Input {...field} type="number" />
</FormControl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const CoursePortfolioHeader = () => {
<div className="pt-6">
<Breadcrumb>
<BreadcrumbItem>
<BreadcrumbLink href={'http://localhost:3000/course/1'}>
Dashboard
</BreadcrumbLink>
<BreadcrumbLink href={'/course/1'}>Dashboard</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbItem isCurrentPage>
<BreadcrumbLink>Course-Portfolio</BreadcrumbLink>
Expand Down
21 changes: 11 additions & 10 deletions components/features/course/course-portfolio/outcome-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ const OutcomeTable: React.FC<OutcomeTableProps> = ({ tabeeOutcomes }) => {
{tabeeOutcome.courseOutcomes.map((courseOutcome, i) => (
<TableRow className="w-4/5" key={i}>
<TableCell className="w-96"> {courseOutcome.name}</TableCell>
{courseOutcome.assessments.map((assessment, i) => (
<TableRow key={i}>
<TableHead>Assessment</TableHead>
<TableCell>{assessment.assessmentTask}</TableCell>
<TableHead>Passing Criteria</TableHead>
<TableCell> {assessment.passingCriteria}</TableCell>
<TableHead>Student Pass</TableHead>
<TableCell>{assessment.studentPassPercentage}</TableCell>
</TableRow>
))}
{courseOutcome.assessments &&
courseOutcome.assessments.map((assessment, i) => (
<TableRow key={i}>
<TableHead>Assessment</TableHead>
<TableCell>{assessment.assessmentTask}</TableCell>
<TableHead>Passing Criteria</TableHead>
<TableCell> {assessment.passingCriteria}</TableCell>
<TableHead>Student Pass</TableHead>
<TableCell>{assessment.studentPassPercentage}</TableCell>
</TableRow>
))}
</TableRow>
))}
<TableRow>
Expand Down
8 changes: 2 additions & 6 deletions components/features/course/history/course-history-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ const CourseHistoryHeader = () => {
<div className="pt-6">
<Breadcrumb>
<BreadcrumbItem>
<BreadcrumbLink href={'http://localhost:3000/course'}>
Courses
</BreadcrumbLink>
<BreadcrumbLink href={'/course'}>Courses</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbItem>
<BreadcrumbLink href={'http://localhost:3000/course/create'}>
Create course
</BreadcrumbLink>
<BreadcrumbLink href={'/course/create'}>Create course</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbItem isCurrentPage>
<BreadcrumbLink>Create course</BreadcrumbLink>
Expand Down
28 changes: 22 additions & 6 deletions components/features/course/outcome/clo-add-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand Down Expand Up @@ -107,12 +108,19 @@ const CloAddDialog: React.FC<PloDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Status</FormLabel>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} />
<FormMessage />
</div>
</FormControl>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a status" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="from curriculum">
From curriculum
</SelectItem>
<SelectItem value="modified">Modified</SelectItem>
</SelectContent>
</Select>
</FormItem>
)}
/>
Expand Down Expand Up @@ -140,6 +148,10 @@ const CloAddDialog: React.FC<PloDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Passing Student %</FormLabel>
<FormDescription>
% of how many students need to pass this CLO for it to
succeed
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} type="number" min={0} max={100} />
Expand All @@ -155,6 +167,10 @@ const CloAddDialog: React.FC<PloDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Passing Assignment %</FormLabel>
<FormDescription>
% of how many assignments a student need to pass to pass
this CLO
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} />
Expand Down
28 changes: 22 additions & 6 deletions components/features/course/outcome/clo-edit-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand Down Expand Up @@ -81,12 +82,19 @@ const CloEditDialog: React.FC<PloDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Status</FormLabel>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} />
<FormMessage />
</div>
</FormControl>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a status" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="from curriculum">
From curriculum
</SelectItem>
<SelectItem value="modified">Modified</SelectItem>
</SelectContent>
</Select>
</FormItem>
)}
/>
Expand Down Expand Up @@ -114,6 +122,10 @@ const CloEditDialog: React.FC<PloDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Passing Student %</FormLabel>
<FormDescription>
% of how many students need to pass this CLO for it to
succeed
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} type="number" min={0} max={100} />
Expand All @@ -129,6 +141,10 @@ const CloEditDialog: React.FC<PloDialogProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Passing Assignment %</FormLabel>
<FormDescription>
% of how many assignments a student need to pass to pass
this CLO
</FormDescription>
<FormControl>
<div className="flex flex-col space-y-3">
<Input {...field} />
Expand Down
4 changes: 4 additions & 0 deletions components/features/course/settings/course-setting-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ const CourseSettingForm: React.FC<CourseSettingFormProps> = ({
render={({ field }) => (
<FormItem>
<FormLabel>Expected Passing CLO Percentage</FormLabel>
<FormDescription>
% of how many CLOs a student need to pass to pass each PLO and
PO
</FormDescription>
<FormControl>
<Input {...field} type="number" />
</FormControl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const CourseSettingHeader: React.FC<CourseSettingHeaderProps> = ({
return (
<Breadcrumb>
<BreadcrumbItem>
<BreadcrumbLink href={`http://localhost:3000/course/${courseId}`}>
Dashboard
</BreadcrumbLink>
<BreadcrumbLink href={`/course/${courseId}`}>Dashboard</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbItem isCurrentPage>
<BreadcrumbLink>Settings</BreadcrumbLink>
Expand Down
12 changes: 6 additions & 6 deletions types/schema/course-portfolio-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ const CourseDevelopmentSchema = z.object({
subjectComments: z.object({
upstreamSubjects: z.array(
z.object({
courseName: z.string().min(1, { message: 'required' }),
comments: z.string().min(1, { message: 'required' }),
courseName: z.string().optional(),
comments: z.string().optional(),
}),
),
downstreamSubjects: z.array(
z.object({
courseName: z.string().min(1, { message: 'required' }),
comments: z.string().min(1, { message: 'required' }),
courseName: z.string().optional(),
comments: z.string().optional(),
}),
),
other: z.string().min(1, { message: 'required' }),
other: z.string().optional(),
}),
otherComment: z.string().min(1, { message: 'required' }),
otherComment: z.string().optional(),
});

export type CourseDevelopment = z.infer<typeof CourseDevelopmentSchema>;
Expand Down

0 comments on commit 052e46a

Please sign in to comment.