feat: per-category evaluation criteria (startup vs business concept)
Add ability to define completely different evaluation criteria for each competition category. Admins toggle "Separate Criteria per Category" in round config, then configure criteria independently via tabbed editor. - Schema: add nullable `category` to EvaluationForm with updated constraints - Config: add `perCategoryCriteria` boolean to EvaluationConfigSchema - Helper: new `findActiveForm()` with category-aware resolution + fallback - Backend: getForm, upsertForm, getStageForm, startStage all category-aware - AI services: use project category for form lookup in summaries + ranking - Export/ranking: merge criteria from all active forms for cross-category reports - Admin UI: toggle switch + tabbed criteria editor with per-category builders - Jury UI: auto-selects correct form based on project category (invisible to juror) - Fully backwards compatible: toggle defaults OFF, existing forms unchanged Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,8 @@ type EvaluationEditSheetProps = {
|
||||
onOpenChange: (open: boolean) => void
|
||||
/** Called after a successful feedback edit */
|
||||
onSaved?: () => void
|
||||
/** Optional project competition category for category-aware form lookup */
|
||||
category?: 'STARTUP' | 'BUSINESS_CONCEPT' | null
|
||||
}
|
||||
|
||||
export function EvaluationEditSheet({
|
||||
@@ -41,6 +43,7 @@ export function EvaluationEditSheet({
|
||||
open,
|
||||
onOpenChange,
|
||||
onSaved,
|
||||
category,
|
||||
}: EvaluationEditSheetProps) {
|
||||
const [isEditing, setIsEditing] = useState(false)
|
||||
const [editedFeedback, setEditedFeedback] = useState('')
|
||||
@@ -115,7 +118,7 @@ export function EvaluationEditSheet({
|
||||
|
||||
{/* Criterion Scores */}
|
||||
{hasScores && (
|
||||
<CriterionScoresSection criterionScores={criterionScores} roundId={roundId} />
|
||||
<CriterionScoresSection criterionScores={criterionScores} roundId={roundId} category={category ?? assignment.project?.competitionCategory} />
|
||||
)}
|
||||
|
||||
{/* Feedback Text — editable */}
|
||||
@@ -147,12 +150,14 @@ export function EvaluationEditSheet({
|
||||
function CriterionScoresSection({
|
||||
criterionScores,
|
||||
roundId,
|
||||
category,
|
||||
}: {
|
||||
criterionScores: Record<string, number | boolean | string>
|
||||
roundId?: string
|
||||
category?: 'STARTUP' | 'BUSINESS_CONCEPT' | null
|
||||
}) {
|
||||
const { data: activeForm } = trpc.evaluation.getStageForm.useQuery(
|
||||
{ roundId: roundId ?? '' },
|
||||
{ roundId: roundId ?? '', category },
|
||||
{ enabled: !!roundId }
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user