Used main branch as base branch in the last time

This commit is contained in:
Carlos Mesquita
2024-07-25 16:59:15 +01:00
parent 10a3243756
commit 877d2f359f
17 changed files with 9051 additions and 1463 deletions

11
src/utils/ai.detection.ts Normal file
View File

@@ -0,0 +1,11 @@
import { UserSolution } from "@/interfaces/exam";
export default function ai_usage(solutions: UserSolution[]): number {
return solutions.reduce((max, solution) => {
if (solution.type == "writing") {
const aiUse = solution.solutions[0].evaluation?.ai_detection?.class_probabilities["ai"];
return aiUse !== undefined ? Math.max(max, aiUse) : max;
} else {
return 0;
}
}, 0);
}