Add 'approve without feedback' button for homework review

Curators/admins can mark a submission APPROVED (and complete the lesson)
without writing feedback. The student sees 'ДЗ принято ✓' and can no
longer resubmit. No email is sent on silent approval.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 16:10:29 +05:00
parent a9869bfac8
commit 2436f77de5
4 changed files with 108 additions and 4 deletions
@@ -3,7 +3,7 @@
import { useState, useTransition, useRef } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
import { submitFeedback, setReviewing } from "./actions";
import { submitFeedback, setReviewing, approveWithoutFeedback } from "./actions";
import { AudioRecorder } from "@/components/curator/audio-recorder";
interface FileItem {
@@ -69,6 +69,13 @@ export function FeedbackForm({
});
}
function handleApproveNoFeedback() {
startTransition(async () => {
await approveWithoutFeedback(submissionId);
router.push("/curator/homework");
});
}
const isWorking = pending || uploading;
return (
@@ -164,6 +171,17 @@ export function FeedbackForm({
{pending ? "Отправка..." : "Отправить ответ"}
</button>
<button
type="button"
onClick={handleApproveNoFeedback}
disabled={isWorking}
className="btn-aubade px-4 py-2 text-sm"
style={{ opacity: isWorking ? 0.5 : 1 }}
title="Засчитать ДЗ без письменного ответа"
>
Принять и отметить выполненным
</button>
{currentStatus !== "REVIEWING" && (
<button
type="button"