@@ -15,7 +15,7 @@ import {
15
15
Repository ,
16
16
SelfReviewSettings ,
17
17
SubmissionWithGraderResultsAndReview ,
18
- UserRole ,
18
+ UserRole
19
19
} from "@/utils/supabase/DatabaseTypes" ;
20
20
import { Alert , Box , Flex , Heading , HStack , Link , Skeleton , Table } from "@chakra-ui/react" ;
21
21
import { TZDate } from "@date-fns/tz" ;
@@ -75,17 +75,16 @@ export default function AssignmentPage() {
75
75
} ) ;
76
76
77
77
useEffect ( ( ) => {
78
- async function fetchSubmissionLimits ( ) {
79
- const supabaseClient = createClient ( ) ;
80
- const { data, error } = await supabaseClient
81
- . rpc ( 'get_submissions_limits' , { p_assignment_id : assignment_id } ) ;
82
- if ( error ) {
83
- console . error ( 'Failed to fetch submission limits:' , error ) ;
84
- }
85
- autograderData . current = data ;
86
- }
87
- fetchSubmissionLimits ( ) ;
88
- } , [ assignment_id ] ) ;
78
+ async function fetchSubmissionLimits ( ) {
79
+ const supabaseClient = createClient ( ) ;
80
+ const { data, error } = await supabaseClient . rpc ( "get_submissions_limits" , { p_assignment_id : assignment_id } ) ;
81
+ if ( error ) {
82
+ console . error ( "Failed to fetch submission limits:" , error ) ;
83
+ }
84
+ autograderData . current = data ;
85
+ }
86
+ fetchSubmissionLimits ( ) ;
87
+ } , [ assignment_id ] ) ;
89
88
90
89
const submissions = submissionsData ?. data ;
91
90
const autograder = autograderData . current ;
@@ -107,14 +106,14 @@ export default function AssignmentPage() {
107
106
is_group_assignment : isGroupAssignment ,
108
107
days_until_due : daysUntilDue ,
109
108
has_submissions : hasSubmissions ,
110
- assignment_slug : assignment . slug
109
+ assignment_slug : assignment . slug
111
110
} ) ;
112
111
}
113
112
} , [ assignment , course_id , assignment_id , submissions , trackEvent ] ) ; // Include all values used inside
114
113
115
114
const autograderRow = autograder ?. [ 0 ] ;
116
- const submissionsPeriod = autograderRow ?. max_submissions_period_secs != null
117
- ? secondsToHours ( autograderRow . max_submissions_period_secs ) : 0 ;
115
+ const submissionsPeriod =
116
+ autograderRow ?. max_submissions_period_secs != null ? secondsToHours ( autograderRow . max_submissions_period_secs ) : 0 ;
118
117
const maxSubmissions = autograderRow ?. max_submissions_count ;
119
118
120
119
if ( ! assignment ) {
@@ -157,16 +156,17 @@ export default function AssignmentPage() {
157
156
} ) }
158
157
/>
159
158
{ submissionsPeriod > 0 ? (
160
- < Box w = "925px" >
161
- < Alert . Root status = "info" flexDirection = "column" size = "md" >
162
- < Alert . Title > Submission Limit for this assignment</ Alert . Title >
163
- < Alert . Description >
164
- This assignment has a submission limit of { maxSubmissions } submission{ maxSubmissions !== 1 ? 's' : '' } per { submissionsPeriod } hour{ submissionsPeriod !== 1 ? 's' : '' } .
165
- </ Alert . Description >
166
- </ Alert . Root >
167
- </ Box >
159
+ < Box w = "925px" >
160
+ < Alert . Root status = "info" flexDirection = "column" size = "md" >
161
+ < Alert . Title > Submission Limit for this assignment</ Alert . Title >
162
+ < Alert . Description >
163
+ This assignment has a submission limit of { maxSubmissions } submission{ maxSubmissions !== 1 ? "s" : "" } per{ " " }
164
+ { submissionsPeriod } hour{ submissionsPeriod !== 1 ? "s" : "" } .
165
+ </ Alert . Description >
166
+ </ Alert . Root >
167
+ </ Box >
168
168
) : (
169
- < > </ >
169
+ < > </ >
170
170
) }
171
171
< Heading size = "md" > Submission History</ Heading >
172
172
< CommitHistoryDialog
0 commit comments