Used main branch as base branch in the last time
This commit is contained in:
11
src/utils/ai.detection.ts
Normal file
11
src/utils/ai.detection.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user