Skip to content

Commit fc47f54

Browse files
committed
Feat: refactor with sorting fix
1 parent f459595 commit fc47f54

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/filters/question.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ export const questionFilters = [
2424
label: "Extreme"
2525
}
2626
]
27+
},
28+
{
29+
key: "max_score",
30+
label: "Max Score"
2731
}
2832
];
2933

3034
export const questionSorts = [
3135
{
3236
key: "max_score",
3337
label: "Sort by points",
34-
direction: 0
38+
direction: -1
3539
},
3640
{
3741
key: "created_at",

src/filters/submission.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ export const submissionFilters = [
1212
label: "Not Graded"
1313
}
1414
]
15+
},
16+
{
17+
key: "automatically_graded",
18+
label: "Grading Type",
19+
options: [
20+
{
21+
key: "true",
22+
label: "Auto Graded"
23+
},
24+
{
25+
key: "false",
26+
label: "Manually Graded"
27+
}
28+
]
1529
}
1630
];
1731

@@ -24,6 +38,6 @@ export const submissionSorts = [
2438
{
2539
key: "score",
2640
label: "Sort by score",
27-
direction: 0
41+
direction: -1
2842
}
2943
];

src/hooks/auth.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const useAuth = () => {
1616
navigate("/");
1717
}
1818
setCompleted(true);
19-
}, [location]);
19+
}, [location, navigate]);
2020

2121
return completed;
2222
};

0 commit comments

Comments
 (0)