from odoo import models, fields


class EncoachFeedback(models.Model):
    _name = 'encoach.feedback'
    _description = 'Exam Feedback'

    attempt_id = fields.Many2one('encoach.student.attempt', required=True, ondelete='cascade', index=True)
    question_id = fields.Many2one('encoach.question', ondelete='set null')
    feedback_text = fields.Text()
    source = fields.Selection([
        ('teacher', 'Teacher'),
        ('ai', 'AI'),
    ], required=True)
    rubric_scores = fields.Text()
    graded_by = fields.Many2one('res.users', ondelete='set null')
