Public Access
feat: integrate AI grading functionality
- Added OpenAI package to backend dependencies for AI grading. - Implemented new grading routes and services to handle AI grading requests. - Updated admin settings to include AI provider configuration options. - Enhanced frontend components to support AI grading, including UI for testing AI connection and displaying AI feedback. - Updated results component to allow for AI-assisted grading and display of suggested grades. - Added internationalization support for new AI grading features in both English and Dutch.
This commit is contained in:
1 parent
f40f4508fd
commit
993265318b
13 files changed
+927
-31
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { apiFetch } from '../utils/api.js'
|
||||
|
||||
export interface GradingResult {
|
||||
suggestedGrade: number
|
||||
feedback: string
|
||||
detail?: unknown
|
||||
}
|
||||
|
||||
export interface GradeRequest {
|
||||
type: 'essay' | 'short-answer' | 'translation' | 'math' | 'ordering' | 'match'
|
||||
question: Record<string, unknown>
|
||||
answer: unknown
|
||||
language: string
|
||||
}
|
||||
|
||||
export function gradeQuestion(req: GradeRequest): Promise<GradingResult> {
|
||||
return apiFetch('/api/grade', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(req),
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user