Skip to content

Commit b05b510

Browse files
committed
feat: add deadline check to assessment completion dialog
1 parent 6dc7553 commit b05b510

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clients/assessment_component/src/assessment/pages/AssessmentPage/components/AssessmentCompletion/AssessmentCompletion.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export function AssessmentCompletion({
282282
error={error}
283283
setError={setError}
284284
handleConfirm={handleConfirm}
285+
isDeadlinePassed={isDeadlinePassed}
285286
/>
286287
</div>
287288
)

clients/assessment_component/src/assessment/pages/AssessmentPage/components/AssessmentCompletion/components/AssessmentCompletionDialog.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface AssessmentCompletionDialogProps {
2222
error: string | null
2323
setError: (error: string | null) => void
2424
handleConfirm: () => void
25+
isDeadlinePassed?: boolean
2526
}
2627

2728
export function AssessmentCompletionDialog({
@@ -32,6 +33,7 @@ export function AssessmentCompletionDialog({
3233
error,
3334
setError,
3435
handleConfirm,
36+
isDeadlinePassed = false,
3537
}: AssessmentCompletionDialogProps) {
3638
return (
3739
<div>
@@ -61,8 +63,19 @@ export function AssessmentCompletionDialog({
6163
Are you sure you want to reopen this assessment for editing? This will allow you
6264
to make changes to the assessment.
6365
</>
66+
) : !isDeadlinePassed ? (
67+
<>
68+
<strong>Are you sure you want to mark this assessment as final?</strong>
69+
<br />
70+
You can still unmark and edit it until the deadline. After the deadline, the
71+
assessment will be locked permanently and no further changes will be possible.
72+
</>
6473
) : (
65-
'Are you sure you want to mark this assessment as final? This will lock the assessment and prevent further changes.'
74+
<>
75+
<strong>Are you sure you want to mark this assessment as final?</strong>
76+
<br />
77+
This will lock the assessment permanently and prevent further changes.
78+
</>
6679
)}
6780
</DialogDescription>
6881
</DialogHeader>

0 commit comments

Comments
 (0)