from odoo import models, fields


class EncoachStudentAnswer(models.Model):
    _name = 'encoach.student.answer'
    _description = 'Student Answer'

    attempt_id = fields.Many2one('encoach.student.attempt', required=True, ondelete='cascade', index=True)
    question_id = fields.Many2one('encoach.question', required=True, ondelete='cascade')
    answer = fields.Text()
    is_correct = fields.Boolean()
    score = fields.Float()
    time_spent_ms = fields.Integer()
    flagged = fields.Boolean(default=False)
